-
-
Notifications
You must be signed in to change notification settings - Fork 158
107 lines (79 loc) · 2.56 KB
/
code-qa-coverity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Code QA - Coverity
on:
workflow_dispatch:
push:
branches:
- coverity-scan
tags:
- '*'
paths-ignore:
- '.github/**'
- '.gitignore'
- 'ChangeLog'
- 'COPYING'
- 'configure.scan'
- 'packaging/**'
- 'dev-tools/**'
# - '!dev-tools/libexec/get-release-*.sh'
- 'doc/**'
- 'etc/**'
- 'install/**'
- 'lib/*/IMPORT.defs'
- 'lib/*/LICENSE'
- 'README.md'
jobs:
code-qa-coverity:
name: Static code analysis
runs-on: ubuntu-20.04
container: ciready/ubuntu:20.04-ci-c
steps:
### Fetch the code
#
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# Work around the fix for CVE-2022-24765
- run: git config --global --add safe.directory $GITHUB_WORKSPACE || true
### Install build environment tools
#
- run: ./dev-tools/install-dev-software.sh
### Download and install coverity
#
- name: Download the Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=a2o%2Fsnoopy" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
working-directory: /opt
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
### Configure
#
- run: ./bootstrap.sh
- run: ./configure --enable-option-checking=fatal --enable-everything
### Build with cov-build
#
- name: Build with cov-build
run: |
export PATH=/opt/cov-analysis-linux64/bin:$PATH
cov-build \
--dir cov-int \
make
### Submit to Coverity Scan
#
- name: Submit the result to Coverity Scan
run: |
RELEASE_TAG=`./dev-tools/libexec/get-release-tag.sh`
tar -czf cov-int.tar.gz cov-int
curl \
--form project=a2o%2Fsnoopy \
--form token=$COVERITY_SCAN_TOKEN \
--form email=$COVERITY_SCAN_EMAIL \
--form version=$RELEASE_TAG \
--form description=$RELEASE_TAG \
--form [email protected] \
https://scan.coverity.com/builds?project=a2o%2Fsnoopy
echo "Submission tag: $RELEASE_TAG"
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}