Skip to content

Commit 685edae

Browse files
committed
Implement coverity scan with GitHub Action
1 parent f903765 commit 685edae

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/coverity.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Coverity Scan
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
coverity:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Install dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y build-essential autotools-dev automake curl git libcap2-bin libtest-command-perl
19+
20+
- name: Run Coverity Scan
21+
env:
22+
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
23+
run: |
24+
ci/deploy-coverity.sh

ci/deploy-coverity.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ tar xfz /tmp/cov-analysis-linux64.tgz
1717
./configure --enable-ipv4 --enable-ipv6 --enable-safe-limits --prefix=/opt/fping
1818
cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j4
1919
tar cfz cov-int.tar.gz cov-int
20+
21+
if [ -n "$GITHUB_RUN_ID" ]; then
22+
BUILD_ID="$GITHUB_RUN_ID"
23+
else
24+
BUILD_ID="manual"
25+
fi
26+
2027
curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
2128
--form token=$COVERITY_SCAN_TOKEN \
2229
--form email=$COVERITY_SCAN_EMAIL \
2330
--form file=@cov-int.tar.gz \
2431
--form version="`git rev-parse --short HEAD`" \
25-
--form description="`git rev-parse --short HEAD` / $TRAVIS_BUILD_ID "
32+
--form description="`git rev-parse --short HEAD` / $BUILD_ID "

0 commit comments

Comments
 (0)