Use coverity-scan-action in CI

Simplifies the CI job and adds a cache to avoid downloading the 1GB+
tool archive on every run.
See: https://github.com/vapier/coverity-scan-action

Only run this job when a commit is pushed to the default branch 2.0
(like when a PR is merged) since the required Coverity token/secret
is not available when this job is triggered by forks.
This commit is contained in:
Björn Svensson 2023-09-06 08:53:02 +02:00
parent 91405adda5
commit 58d8b0c028

View file

@ -1,5 +1,7 @@
name: coverity name: coverity
on: [push, pull_request] on:
push:
branches: [2.0]
jobs: jobs:
analyze: analyze:
@ -7,27 +9,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Download Coverity - name: Prepare
run: |
cd ..
wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{secrets.COVERITY_TOKEN}}&project=r3" -O coverity-linux64.tgz
mkdir coverity
tar xzf coverity-linux64.tgz --strip 1 -C coverity
echo "$(pwd)/coverity/bin" >> $GITHUB_PATH
- name: Build with Coverity
run: | run: |
./autogen.sh ./autogen.sh
./configure --enable-check --enable-debug ./configure --enable-check
cov-build --dir cov-int make V=1 - uses: vapier/coverity-scan-action@v1
with:
- name: Submit the result to Coverity project: r3
run: | email: yoanlin93+github@gmail.com
tar czvf r3.tgz cov-int token: ${{ secrets.COVERITY_TOKEN }}
curl \
--form token=${{secrets.COVERITY_TOKEN}} \
--form email=yoanlin93+github@gmail.com \
--form file=@r3.tgz \
--form version=${GITHUB_SHA} \
https://scan.coverity.com/builds?project=r3