Skip to content

Commit f77997d

Browse files
jprestwoIWDTestBot
authored andcommitted
Add coverity Github action
1 parent 4cad21c commit f77997d

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

.github/workflows/coverity.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Coverity Scan and Submit
2+
description: Runs a coverity scan, then sends results to the cloud
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
scan-and-submit:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- name: Lookup latest tool
13+
id: cache-lookup
14+
run: |
15+
hash=$(curl https://scan.coverity.com/download/cxx/linux64 \
16+
--data "token=${{ secrets.COVERITY_IWD_TOKEN }}&project=IWD&md5=1");
17+
echo "hash=${hash}" >> $GITHUB_OUTPUT
18+
19+
- name: Get cached coverity tool
20+
id: build-cache
21+
uses: actions/cache@v4
22+
with:
23+
path: ${{ github.workspace }}/cov-analysis
24+
key: cov-build-cxx-linux64-${{ steps.cache-lookup.outputs.hash }}
25+
26+
- name: Download Coverity Build Tool
27+
if: steps.build-cache.outputs.cache-hit != 'true'
28+
run: |
29+
curl https://scan.coverity.com/download/cxx/linux64 \
30+
--no-progress-meter \
31+
--output cov-analysis.tar.gz \
32+
--data "token=${{ secrets.COVERITY_IWD_TOKEN }}&project=IWD"
33+
shell: bash
34+
working-directory: ${{ github.workspace }}
35+
36+
- if: steps.build-cache.outputs.cache-hit != 'true'
37+
run: mkdir cov-analysis
38+
shell: bash
39+
working-directory: ${{ github.workspace }}
40+
41+
- if: steps.build-cache.outputs.cache-hit != 'true'
42+
run: tar -xzf cov-analysis.tar.gz --strip 1 -C cov-analysis
43+
shell: bash
44+
working-directory: ${{ github.workspace }}
45+
46+
- name: Checkout IWD
47+
uses: actions/checkout@v3
48+
with:
49+
path: ${{ github.workspace }}/iwd
50+
repository: IWDTestBot/iwd
51+
token: ${{ secrets.ACTION_TOKEN }}
52+
53+
- name: Checkout ELL
54+
uses: actions/checkout@v3
55+
with:
56+
path: ${{ github.workspace }}/ell
57+
repository: IWDTestBot/ell
58+
token: ${{ secrets.ACTION_TOKEN }}
59+
60+
- name: Configure IWD
61+
run: |
62+
cd ${{ github.workspace }}/iwd
63+
./bootstrap-configure --disable-manual-pages
64+
65+
- name: Build with cov-build
66+
run: |
67+
export PATH="${{ github.workspace }}/cov-analysis/bin:${PATH}"
68+
cov-build --dir cov-int make -j4
69+
shell: bash
70+
working-directory: ${{ github.workspace }}/iwd
71+
72+
- name: Tar results
73+
run: tar -czvf cov-int.tgz cov-int
74+
shell: bash
75+
working-directory: ${{ github.workspace }}/iwd
76+
77+
- name: Submit results to Coverity Scan
78+
if: ${{ ! inputs.dry_run }}
79+
run: |
80+
curl \
81+
--form token="${{ secrets.COVERITY_IWD_TOKEN }}" \
82+
--form email="iwd.ci.bot@gmail.com" \
83+
--form file=@cov-int.tgz \
84+
"https://scan.coverity.com/builds?project=IWD"
85+
shell: bash
86+
working-directory: ${{ github.workspace }}/iwd

0 commit comments

Comments
 (0)