Skip to content

Commit d075f64

Browse files
committed
Add Coverity Scan Github Action
WE2-539, WE2-785 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent bc90006 commit d075f64

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/coverity.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Coverity Scan
2+
3+
on:
4+
push:
5+
branches: [coverity_scan]
6+
7+
jobs:
8+
coverity:
9+
if: github.repository == 'web-eid/web-eid-authtoken-validation-php'
10+
runs-on: ubuntu-latest
11+
env:
12+
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
13+
PROJECTNAME: 'web-eid/web-eid-authtoken-validation-php'
14+
steps:
15+
- uses: actions/checkout@v5
16+
#- uses: vapier/coverity-scan-action@v1
17+
# with:
18+
# command: find . -name "*.php"
19+
# email: eid-teenusehaldus@ria.ee
20+
# token: ${{ secrets.COVERITY_SCAN_TOKEN }}
21+
- name: Download Coverity Build Tool
22+
run: |
23+
curl --silent --data "token=$TOKEN&project=$PROJECTNAME" -o cov-analysis-linux64.tar.gz https://scan.coverity.com/download/cxx/linux64
24+
mkdir cov-analysis-linux64
25+
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
26+
27+
- name: Build
28+
run: |
29+
export PATH=$PWD/cov-analysis-linux64/bin:$PATH
30+
coverity capture --dir cov-int --project-dir . --file-include-regex '(^|/)(src|lib)/.*\.(php)$' --file-exclude-regex '(^|/)(vendor|dist|build)(/|$)'
31+
32+
# cov-build --dir cov-int --no-command --fs-capture-search ./src
33+
34+
- name: Submit the result to Coverity Scan
35+
run: |
36+
tar czvf upload.tgz cov-int
37+
curl --silent \
38+
--form project=$PROJECTNAME \
39+
--form token=$TOKEN \
40+
--form email=eid-teenusehaldus@ria.ee \
41+
--form file=@upload.tgz \
42+
--form version=master \
43+
--form description="Github Actions CI build" \
44+
https://scan.coverity.com/builds?project=$PROJECTNAME
45+
46+
- name: Archive artifacts
47+
uses: actions/upload-artifact@v5
48+
with:
49+
name: logs
50+
path: cov-int/build-log.txt

0 commit comments

Comments
 (0)