99
1010 strategy :
1111 matrix :
12- os : [ubuntu-18.04, ubuntu-20.04, ubuntu- 22.04, macos-10.15, macos-11, macos-12 ]
12+ os : [ubuntu-22.04]
1313 fail-fast : false # Prefer quick result
1414
1515 runs-on : ${{ matrix.os }}
4747 python3 -m pip install pip --upgrade
4848 python3 -m pip install pytest
4949
50- - name : CMake build on ubuntu (with GUI / system tinyxml2)
51- if : contains(matrix.os, 'ubuntu')
52- run : |
53- mkdir cmake.output.tinyxml2
54- cd cmake.output.tinyxml2
55- cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off ..
56- cmake --build . -- -j$(nproc)
57- cd ..
58-
59- - name : Run CMake test (system tinyxml2)
60- if : contains(matrix.os, 'ubuntu')
61- run : |
62- cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc)
63-
6450 - name : CMake build on ubuntu (with GUI)
6551 if : contains(matrix.os, 'ubuntu')
6652 run : |
@@ -69,199 +55,20 @@ jobs:
6955 cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On ..
7056 cmake --build . -- -j$(nproc)
7157
72- - name : CMake build on macos (with GUI)
73- if : contains(matrix.os, 'macos')
74- run : |
75- mkdir cmake.output
76- pushd cmake.output
77- cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 ..
78- cmake --build . -- -j$(nproc)
79-
80- - name : Run CMake test
81- run : |
82- cmake --build cmake.output --target check -- -j$(nproc)
83-
84- - name : Run CTest
85- run : |
86- pushd cmake.output
87- ctest -j$(nproc)
88-
89- - name : Build with Unsigned char
90- run : |
91- make clean
92- make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
93-
94- - name : Test with Unsigned char
95- run : |
96- ./testrunner TestSymbolDatabase
97-
98- - name : Build with TEST_MATHLIB_VALUE
99- run : |
100- make clean
101- touch lib/mathlib.cpp test/testmathlib.cpp
102- make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
103-
104- - name : Test with TEST_MATHLIB_VALUE
105- run : |
106- make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
107-
108- - name : Check syntax with NONNEG
109- run : |
110- ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
111-
112- - name : Build cppcheck
113- run : |
114- make clean
115- make -j$(nproc) HAVE_RULES=yes
116-
117- - name : Build test
118- run : |
119- make -j$(nproc) testrunner HAVE_RULES=yes
120-
121- - name : Run test
122- run : |
123- make -j$(nproc) check HAVE_RULES=yes
124-
125- # the script uses sed parameters not supported by MacOS
126- - name : Run extra tests
127- if : contains(matrix.os, 'ubuntu')
128- run : |
129- tools/generate_and_run_more_tests.sh
130-
131- # do not use pushd in this step since we go below the working directory
132- - name : Run test/cli
133- run : |
134- cd test/cli
135- python3 -m pytest test-*.py
136- cd ../../..
137- ln -s cppcheck 'cpp check'
138- cd 'cpp check/test/cli'
139- python3 -m pytest test-*.py
140-
141- # fails on macos since some includes (e.g. sys/epoll.h) are not available
142- - name : Run cfg tests
143- if : contains(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-22.04'
144- run : |
145- make -j$(nproc) checkcfg
146-
147- - name : Run cfg tests (strict)
148- if : matrix.os == 'ubuntu-22.04'
149- run : |
150- make -j$(nproc) checkcfg
151- env :
152- STRICT : 1
153-
154- # it seems macos has no "wc" command
155- - name : Run showtimetop5 tests
156- if : contains(matrix.os, 'ubuntu')
157- run : |
158- ./tools/test_showtimetop5.sh
159-
160- - name : Run --dump test
161- run : |
162- ./cppcheck test/testpreprocessor.cpp --dump
163- xmllint --noout test/testpreprocessor.cpp.dump
164-
165- - name : Validate
166- run : |
167- make -j$(nproc) checkCWEEntries validateXML
168-
169- # TODO: move to scriptcheck.yml so these are tested with all Python versions?
170- - name : Test addons
171- run : |
172- ./cppcheck --addon=threadsafety addons/test/threadsafety
173- ./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
174- ./cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
175- pushd addons/test
176- # We'll force C89 standard to enable an additional verification for
177- # rules 5.4 and 5.5 which have standard-dependent options.
178- ../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
179- python3 ../misra.py -verify misra/misra-test.c.dump
180- # TODO: do we need to verify something here?
181- ../../cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
182- ../../cppcheck --dump misra/misra-test.cpp
183- python3 ../misra.py -verify misra/misra-test.cpp.dump
184- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
185- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
186- python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
187- ../../cppcheck --addon=misra --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
188- ../../cppcheck --dump misc-test.cpp
189- python3 ../misc.py -verify misc-test.cpp.dump
190- ../../cppcheck --dump naming_test.c
191- python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
192- ../../cppcheck --dump naming_test.cpp
193- python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
194- ../../cppcheck --dump namingng_test.c
195- python3 ../namingng.py --configfile ../naming.json --verify namingng_test.c.dump
196-
197- - name : Ensure misra addon does not crash
198- if : contains(matrix.os, 'ubuntu')
199- run : |
200- ./cppcheck --addon=misra addons/test/misra/crash1.c | ( ! grep 'Bailing out from checking' )
201-
20258 - name : Build GUI on ubuntu
20359 if : contains(matrix.os, 'ubuntu')
20460 run : |
20561 pushd gui
20662 qmake CONFIG+=debug HAVE_QCHART=yes
20763 make -j$(nproc)
20864
209- - name : Run GUI tests on ubuntu
210- if : contains(matrix.os, 'ubuntu')
211- run : |
212- pushd gui/test/cppchecklibrarydata
213- qmake CONFIG+=debug
214- make -j$(nproc)
215- ./test-cppchecklibrarydata
216- popd
217- pushd gui/test/filelist
218- qmake CONFIG+=debug
219- make -j$(nproc)
220- # TODO: requires X session
221- #./test-filelist
222- popd
223- pushd gui/test/projectfile
224- qmake CONFIG+=debug
225- make -j$(nproc)
226- ./test-projectfile
227- popd
228- pushd gui/test/translationhandler
229- qmake CONFIG+=debug
230- make -j$(nproc)
231- # TODO: requires X session
232- #./test-translationhandler
233- popd
234- pushd gui/test/xmlreportv2
235- qmake CONFIG+=debug
236- make -j$(nproc)
237- # TODO: requires X session
238- #./test-xmlreportv2
239-
240- - name : Generate Qt help file on ubuntu 18.04
241- if : matrix.os == 'ubuntu-18.04'
242- run : |
243- pushd gui/help
244- qcollectiongenerator online-help.qhcp -o online-help.qhc
245-
246- - name : Generate Qt help file on ubuntu 20.04
247- if : matrix.os == 'ubuntu-22.04'
248- run : |
249- pushd gui/help
250- qhelpgenerator online-help.qhcp -o online-help.qhc
251-
25265 - name : Build triage on ubuntu
25366 if : matrix.os == 'ubuntu-22.04'
25467 run : |
25568 pushd tools/triage
25669 qmake CONFIG+=debug
25770 make -j$(nproc)
25871
259- - name : Build Fuzzer
260- if : matrix.os == 'ubuntu-22.04'
261- run : |
262- pushd oss-fuzz
263- make -j$(nproc) CXX=clang++ CXXFLAGS="-fsanitize=address" fuzz-client translate
264-
26572 - name : Self check (build)
26673 if : matrix.os == 'ubuntu-22.04'
26774 run : |
0 commit comments