forked from dosbox-staging/dosbox-staging
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (97 loc) · 3.52 KB
/
pvs-studio.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
108
109
110
111
112
113
114
115
116
117
118
name: PVS-Studio analysis
# If the CI job fails with 404-not-found, then PVS studio has updated the release.
# Get the new DEB version from: https://pvs-studio.com/en/pvs-studio/download-all/
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pvs_studio_analyzer:
name: PVS-Studio static analyzer
runs-on: ubuntu-latest
env:
debfile: pvs-studio-7.25.72091.324-amd64.deb
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: false
- run: sudo apt-get update
- name: Log and setup environment
run: |
./scripts/log-env.sh
mkdir -p pvs-package
- uses: actions/[email protected]
id: cache-pvs
with:
path: pvs-package
key: ${{ env.debfile }}
- name: Fetch PVS-Studio package
if: steps.cache-pvs.outputs.cache-hit != 'true'
run: wget "https://cdn.pvs-studio.com/${debfile}" -O "pvs-package/pvs.deb"
- name: Install dependencies
run: |
set -xeu
sudo apt-get install -y strace $(cat packages/ubuntu-20.04-apt.txt)
sudo pip3 install --upgrade meson ninja
sudo dpkg -i "pvs-package/pvs.deb"
pvs-studio-analyzer credentials "${{ secrets.PvsStudioName }}" "${{ secrets.PvsStudioKey }}"
- name: Cache subprojects
id: cache-subprojects
uses: actions/[email protected]
with:
path: subprojects.tar
key: subprojects-${{ hashFiles('subprojects/*.wrap') }}-4
enableCrossOsArchive: true
- if: steps.cache-subprojects.outputs.cache-hit != 'true'
name: Generate subprojects cache
run: scripts/fetch-and-tar-subprojects.sh
- name: Extract subprojects cache
run: scripts/extract-subprojects-tar.sh
- name: Build
run: |
set -xeu
meson setup -Dbuildtype=debug -Dunit_tests=disabled --native-file=.github/meson/native-clang.ini build
pvs-studio-analyzer trace -- meson compile -C build
- name: Analyze
run: |
set -xeu
log="pvs-report.log"
general_criteria="GA:1,2;64:1;OP:1,2,3;CS:1"
stamp="$(date +'%Y-%m-%d_T%H%M')-${GITHUB_SHA:0:8}"
reportdir="pvs-report/pvs-report-${stamp}"
disable_warnings="V002,V1042,V826,V802,V2008,V1071"
mkdir -p "${reportdir}"
pvs-studio-analyzer analyze \
-a 63 \
-e subprojects \
-s .pvs-suppress \
-j "$(nproc)" \
-o "${log}"
plog-converter \
-p dosbox-staging \
-v "${GITHUB_SHA:0:8}" \
-a "${general_criteria}" \
-d "${disable_warnings}" \
-t fullhtml,csv \
-o "${reportdir}" \
"${log}"
pvs-studio-analyzer suppress \
-a "${general_criteria}" \
-o "${reportdir}/supressible-list.json" \
"${log}"
ln -sf "${reportdir}/pvs-report.csv" .
mv -f "${reportdir}/pvs-report.fullhtml"/* "${reportdir}/"
rm -rf "${reportdir}/pvs-report.fullhtml"
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: pvs-analysis-report
path: pvs-report
- name: Summarize report
env:
MAX_BUGS: 168
run: |
echo "Full report is included in build Artifacts"
echo
./scripts/count-pvs-bugs.py "pvs-report.csv" "${MAX_BUGS}"