forked from oshi/oshi
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.8 KB
/
Copy pathcoverity.yaml
File metadata and controls
64 lines (51 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Coverity Scan
on:
workflow_dispatch:
schedule:
- cron: "0 9 */4 * *" # every 4 days at 09:00 UTC
jobs:
build:
if: github.repository_owner == 'oshi'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v5
with:
cache: maven
java-version: 21
distribution: temurin
- name: Analyze with Coverity
shell: bash
env:
COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }}
EMAIL: ${{ secrets.EMAIL }}
COVERITY_PROJECT: "oshi/oshi"
run: |
set -euo pipefail
# Download Coverity tool (Linux 64-bit) for this project
wget -q https://scan.coverity.com/download/linux64 \
--post-data "token=${COVERITY_TOKEN}&project=${COVERITY_PROJECT}" \
-O coverity_tool.tgz
tar -xzf coverity_tool.tgz
TOOL_DIR="$(echo cov-analysis-linux64-*/ | head -n 1)"
echo "Using Coverity tool dir: ${TOOL_DIR}"
# Configure Java capture
"${TOOL_DIR}bin/cov-configure" --java
# IMPORTANT: clean build under cov-build to ensure full capture
rm -rf cov-int
"${TOOL_DIR}bin/cov-build" --dir cov-int \
./mvnw -B -DskipTests=true \
clean compile
# Package results for upload
tar -czf oshi.tgz cov-int
# Upload to Coverity Scan
curl --fail --silent --show-error \
--form token="${COVERITY_TOKEN}" \
--form email="${EMAIL}" \
--form file=@oshi.tgz \
--form version="oshi/coverity_scan" \
--form description="Oshi Coverity Scan" \
"https://scan.coverity.com/builds?project=oshi%2Foshi"