-
Notifications
You must be signed in to change notification settings - Fork 5
312 lines (300 loc) · 13 KB
/
analyze.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
name: Analyze
on:
push:
branches: [ '**' ]
pull_request:
branches: [ master ]
jobs:
asan:
runs-on: ubuntu-20.04
name: gcc9 + debug + Qt5 + ASAN
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install g++ gdb qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev
- name: info
run: |
gcc --version
- name: build
run: |
mkdir build-asan-gcc
cd build-asan-gcc
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug CONFIG+=build-asan "OPEN_CV_VERSION_MAJOR=4"
make -j2
- name: test
run: |
cd build-asan-gcc
export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH}
./test/engine/engine
./test/solver/solver
./test/extrapolator/extrapolator
./test/solvers_equality/solvers_equality
./test/stream/stream
astyle:
runs-on: ubuntu-20.04
name: Astyle
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install astyle
- name: info
run: |
astyle --version
- name: analyze
run: |
astyle --options=.astylerc --recursive *.{h,cpp,cl,cu}
git diff --exit-code
codespell:
runs-on: ubuntu-20.04
name: Codespell
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install codespell
- name: info
run: |
codespell --version
- name: analyze
run: |
codespell -x ./docs/habr-437014.html
git diff --exit-code
coverage:
runs-on: ubuntu-20.04
name: gcc9 + debug + Qt5 + gcov
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install g++ gdb qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev ocl-icd-opencl-dev oclgrind
- name: info
run: |
gcc --version
oclgrind --version
- name: build
run: |
mkdir build-debug-gcov
cd build-debug-gcov
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug CONFIG+=NO_UI CONFIG+=build-gcov
make -j2
- name: test
run: |
cd build-debug-gcov
export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH}
oclgrind ./test/engine/engine
oclgrind ./test/solver/solver
./test/extrapolator/extrapolator
./test/solvers_equality/solvers_equality
./test/stream/stream
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE"
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE" --max_time=1 --initial_state=./test/data/zeno_ascii.txt --output=/tmp/nbody/zeno_ascii
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE" --max_time=2 --resume=/tmp/nbody/zeno_ascii
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE" --max_time=1 --initial_state=./test/data/zeno_table.txt --initial_type=G1
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE" --max_time=1 --initial_state=./test/data/zeno_table.txt --initial_type=SI
./test/main/nbody-simulation --engine=simple --solver=rkdp --verbose=1 --check_list="PLVE" --max_time=1 --initial_state=./test/data/zeno_table.txt --initial_type=ADK
- name: codecov
run: |
cd build-debug-gcov/nbody
gcov ./*
bash <(curl -s https://codecov.io/bash)
# coverity:
# runs-on: ubuntu-20.04
# name: gcc9 + debug + Qt5 + coverity
# steps:
# - uses: actions/checkout@v2
# - name: apt-install
# run: |
# set -o xtrace
# # WARNING: Linux users on kernel version 4.8.x and newer will need to apply a sysctl parameter to
# # support our binaries. Without this parameter, our binaries will not work on your platform.
# # This is a known issue which we will address with a future release.
# # See https://scan.coverity.com/download
# sudo sysctl vsyscall=emulate
# sudo apt update
# sudo apt upgrade
# sudo apt install g++ gdb qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev ocl-icd-opencl-dev oclgrind
# - name: coverity-install
# run: |
# wget https://scan.coverity.com/download/linux64 --post-data "token=${{secrets.COVERITY_TOKEN}}&project=drons%2Fnbody" -O coverity_tool.tgz
# tar xzf ./coverity_tool.tgz
# cov-analysis*/bin/cov-configure --comptype gcc --compiler /usr/bin/gcc
# - name: info
# run: |
# gcc --version
# oclgrind --version
# cat cov-analysis*/VERSION | grep externalVersion
# - name: build + analyze
# run: |
# mkdir build-debug-coverity
# cd build-debug-coverity
# /usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug "OPEN_CV_VERSION_MAJOR=4"
# ../cov-analysis*/bin/cov-build --dir cov-int make -j2
# - name: log.txt
# run: |
# cat build-debug-coverity/cov-int/build-log.txt
# - name: upload
# run: |
# cd build-debug-coverity
# tar czvf nbody.tgz cov-int
# curl --form token=${{secrets.COVERITY_TOKEN}} --form [email protected] --form [email protected] --form version=${GITHUB_SHA} --form description="${GITHUB_REF_NAME}" https://scan.coverity.com/builds?project=drons%2Fnbody
cppcheck:
runs-on: ubuntu-20.04
name: CppCheck
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install cppcheck
- name: info
run: |
cppcheck --version
- name: analyze
run: |
cppcheck -DNB_COORD_PRECISION=4 --suppressions-list=./test/cppcheck/supp.txt --library=microsoft_sal,posix,qt,std,windows --quiet --force --enable=all --template=gcc --error-exitcode=1 -j 2 ./
cppcheck -DNB_COORD_PRECISION=2 --suppressions-list=./test/cppcheck/supp.txt --library=microsoft_sal,posix,qt,std,windows --quiet --force --enable=all --template=gcc --error-exitcode=1 -j 2 ./
cppcheck -DNB_COORD_PRECISION=1 --suppressions-list=./test/cppcheck/supp.txt --library=microsoft_sal,posix,qt,std,windows --quiet --force --enable=all --template=gcc --error-exitcode=1 -j 2 ./
flawfinder:
runs-on: ubuntu-20.04
name: Flawfinder
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install lynx wget python curl
wget https://dwheeler.com/flawfinder/flawfinder-2.0.19.tar.gz -O flawfinder.tar.gz
tar xzf flawfinder.tar.gz
- name: analyze
run: |
cd ./flawfinder-2.0.19
sudo make prefix=/usr install
cd .. && rm -rf ./flawfinder-*
flawfinder --html --context --minlevel=0 ./ > output.html
lynx -dump -nolist output.html
oclint:
runs-on: ubuntu-20.04
name: clang11 + debug + Qt5 + oclint
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install clang-11 qt5-qmake qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev bear wget
mkdir build-debug-oclint
cd build-debug-oclint
wget https://github.com/oclint/oclint/releases/download/v21.10/oclint-21.10-llvm-13.0.0-x86_64-linux-ubuntu-20.04.tar.gz -O oclint.tar.gz
tar xzfv oclint.tar.gz
- name: info
run: |
clang --version
- name: build
run: |
export CXX=${CXX:-clang++}
export CC=${CC:-clang}
cd build-debug-oclint
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug -spec linux-clang "OPEN_CV_VERSION_MAJOR=4"
bear make
- name: analyze
run: |
cd build-debug-oclint
oclint-21.10/bin/oclint-json-compilation-database -e test* -e moc_* -p ./ -- -max-priority-1 0 -max-priority-2 4 -max-priority-3 5 -enable-global-analysis -enable-clang-static-analyzer -disable-rule RedundantLocalVariable -disable-rule ParameterReassignment -rc CYCLOMATIC_COMPLEXITY=15 -rc LONG_LINE=180 -rc SHORT_VARIABLE_NAME=1 -rc LONG_VARIABLE_NAME=40 -rc LONG_METHOD=150 -rc NCSS_METHOD=80 -rc NPATH_COMPLEXITY=256
pvs:
runs-on: ubuntu-20.04
name: PVS + debug + Qt5
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install g++ qt5-qmake qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev ocl-icd-opencl-dev opencl-clhpp-headers wget strace
wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt update -y
sudo apt install -y cuda-minimal-build-11-6 libnccl-dev pvs-studio
sudo ln -s /usr/local/cuda-11.6 /usr/local/cuda
- name: info
run: |
gcc --version
/usr/local/cuda/bin/nvcc --version
pvs-studio --version
- name: build + analyze
run: |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH}
mkdir build-debug-pvs
cd build-debug-pvs
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug CONFIG+=USE_NCCL "OPEN_CV_VERSION_MAJOR=4"
pvs-studio-analyzer credentials ${{secrets.PVS_NAME}} ${{secrets.PVS_KEY}}
pvs-studio-analyzer trace -- make -j 2
pvs-studio-analyzer analyze --intermodular --cfg ../test/pvs/analyze.cfg -o ./pvs-studio-analyzer.out.log -j2
plog-converter -a "GA:1,2;64:1,2;OP:1,2" -s ../test/pvs/plog.cfg -t errorfile -e -o ./pvs-error-list.txt -r ../ ./pvs-studio-analyzer.out.log
cat ./pvs-error-list.txt
test "$(cat ./pvs-error-list.txt | wc -l)" -le 1
scanbuild:
runs-on: ubuntu-20.04
name: clang12 + release + Qt5 + scanbuild
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install clang-12 clang-tools-12 qt5-qmake qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev
mkdir build-debug-scanbuild
- name: info
run: |
/usr/lib/llvm-12/bin/clang --version
- name: build + analyze
run: |
cd build-debug-scanbuild
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=release "OPEN_CV_VERSION_MAJOR=4"
/usr/lib/llvm-12/bin/scan-build -maxloop 4 -analyze-headers -analyzer-config stable-report-filename=true -o ./ make -j2
valgrind:
runs-on: ubuntu-20.04
name: gcc9 + debug + Qt5 + valgind
steps:
- uses: actions/checkout@v2
- name: install
run: |
sudo apt update
sudo apt upgrade
sudo apt install g++ gdb valgrind qtbase5-dev qtbase5-dev-tools libqt5opengl5-dev libopencv-dev
- name: info
run: |
gcc --version
valgrind --version
- name: build
run: |
mkdir build-debug-valgrind
cd build-debug-valgrind
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake ../nbody.pro CONFIG+=debug "OPEN_CV_VERSION_MAJOR=4"
make -j2
- name: test
run: |
cd build-debug-valgrind
export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH}
valgrind --tool=memcheck --trace-children=yes --log-file=./memsupp.log --gen-suppressions=all --smc-check=all --read-var-info=yes --leak-check=full --track-origins=yes ./test/memsupp/memsupp
grep -v "==" ./memsupp.log | sed 's/_ZN12test_memsuppC1Ev/\*/g'> ./valg.supp
cat ./valg.supp
valgrind --tool=memcheck --error-exitcode=1 --trace-children=yes --suppressions=./valg.supp --suppressions=../test/memsupp/memcheck.supp --gen-suppressions=all --smc-check=all --read-var-info=yes --leak-check=full --track-origins=yes ./test/engine/engine
valgrind --tool=memcheck --error-exitcode=1 --trace-children=yes --suppressions=./valg.supp --suppressions=../test/memsupp/memcheck.supp --gen-suppressions=all --smc-check=all --read-var-info=yes --leak-check=full --track-origins=yes ./test/solver/solver
valgrind --tool=memcheck --error-exitcode=1 --trace-children=yes --suppressions=./valg.supp --suppressions=../test/memsupp/memcheck.supp --gen-suppressions=all --smc-check=all --read-var-info=yes --leak-check=full --track-origins=yes ./test/extrapolator/extrapolator
valgrind --tool=memcheck --error-exitcode=1 --trace-children=yes --suppressions=./valg.supp --suppressions=../test/memsupp/memcheck.supp --gen-suppressions=all --smc-check=all --read-var-info=yes --leak-check=full --track-origins=yes ./test/stream/stream