Debian Codegraph @

.github/workflows/coverity.yml

raw
1 name: Coverity for doxygen
2
3 # Just for tests
4 #on: [push, pull_request]
5
6 # The right schedule
7 on:
8 schedule:
9 - cron: '30 2 * * *' # Run once per day, to avoid Coverity's submission limits
10
11
12 permissions:
13 contents: read
14
15 jobs:
16 check_date:
17 runs-on: ubuntu-22.04
18 name: Check latest commit
19 outputs:
20 should_run: ${{ steps.should_run.outputs.should_run }}
21 steps:
22 - uses: actions/checkout@v5
23 - name: print latest_commit
24 run: echo ${{ github.sha }}
25
26 - id: should_run
27 continue-on-error: true
28 name: check latest commit is less than a day
29 if: ${{ github.event_name == 'schedule' }}
30 run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
31
32 scan:
33 needs: check_date
34 if: ${{ needs.check_date.outputs.should_run != 'false' }}
35 runs-on: ubuntu-22.04
36
37 env:
38 CC: gcc
39 DEBIAN_FRONTEND: noninteractive
40
41 steps:
42 - name: Checkout doxygen
43 uses: actions/checkout@v5
44
45 - name: Download Coverity
46 run: |
47 wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=doxygen%2Fdoxygen" -O coverity_tool.tgz
48 mkdir cov-scan
49 tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
50 env:
51 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
52
53 - name: Setup environment
54 run: |
55 echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
56 echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV
57
58 - name: Configure doxygen
59 run: |
60 mkdir build
61 cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
62
63 - name: Run coverity build/scan
64 run: |
65 cd build && cov-build --dir cov-int make -j${NPROC}
66
67 - name: Submit results
68 run: |
69 cd build
70 tar zcf cov-scan.tgz cov-int
71 curl --form token=$TOKEN \
72 --form email=$EMAIL \
73 --form [email protected] \
74 --form version="$(git rev-parse HEAD)" \
75 --form description="Automatic GHA scan" \
76 'https://scan.coverity.com/builds?project=doxygen%2Fdoxygen'
77 env:
78 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
79 EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
80