@@ -21,60 +21,10 @@ defaults:
2121
2222jobs :
2323
24- build_qt :
25- strategy :
26- matrix :
27- os : [windows-2022, windows-2025]
28- qt_ver : [6.10.0]
29- fail-fast : false
30-
31- runs-on : ${{ matrix.os }}
32-
33- steps :
34- - uses : actions/checkout@v4
35- with :
36- persist-credentials : false
37-
38- - name : Set up Visual Studio environment
39- uses : ilammy/msvc-dev-cmd@v1
40- with :
41- arch : x64
42-
43- - name : Install Qt ${{ matrix.qt_ver }}
44- uses : jurplel/install-qt-action@v4
45- with :
46- version : ${{ matrix.qt_ver }}
47- modules : ' qtcharts'
48- setup-python : ' false'
49- cache : true
50-
51- - name : Run CMake
52- run : |
53- rem TODO: enable rules?
54- rem specify Release build so matchcompiler is used
55- cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
56-
57- - name : Build GUI release
58- run : |
59- cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
60-
61- - name : Deploy GUI
62- run : |
63- windeployqt build\bin\Release || exit /b !errorlevel!
64- del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
65- del build\bin\Release\cppcheck-gui.pdb || exit /b !errorlevel!
66-
67- # TODO: run GUI tests
68-
69- - name : Run CMake install
70- run : |
71- cmake --build build --target install
72- # TODO: validate the installed files
73-
7424 build_cmake_cxxstd :
7525 strategy :
7626 matrix :
77- os : [windows-2022, windows- 2025]
27+ os : [windows-2025]
7828 cxxstd : [14, 17, 20]
7929 fail-fast : false
8030
@@ -97,241 +47,3 @@ jobs:
9747 - name : Build
9848 run : |
9949 cmake --build build.cxxstd --config Debug || exit /b !errorlevel!
100-
101- build_cmake_minimum :
102-
103- runs-on : windows-2022 # use the oldest available runner
104-
105- env :
106- CMAKE_VERSION : 3.22
107- CMAKE_VERSION_FULL : 3.22.6
108-
109- steps :
110- - uses : actions/checkout@v4
111- with :
112- persist-credentials : false
113-
114- - name : Install CMake
115- run : |
116- curl -fsSL https://cmake.org/files/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64.zip -o cmake.zip || exit /b !errorlevel!
117- 7z x cmake.zip || exit /b !errorlevel!
118-
119- - name : Set up Visual Studio environment
120- uses : ilammy/msvc-dev-cmd@v1
121- with :
122- arch : x64
123-
124- - name : Install Qt
125- uses : jurplel/install-qt-action@v4
126- with :
127- version : 6.10.0
128- modules : ' qtcharts'
129- setup-python : ' false'
130- cache : true
131-
132- - name : Run CMake (without GUI)
133- run : |
134- :: TODO: enable DHAVE_RULES?
135- cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On
136-
137- - name : Run CMake (with GUI)
138- run : |
139- :: TODO: enable DHAVE_RULES?
140- cmake-${{ env.CMAKE_VERSION_FULL }}-windows-x86_64\bin\cmake.exe -S . -B cmake.output.gui -A x64 -DHAVE_RULES=Off -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On
141-
142- build :
143- strategy :
144- matrix :
145- os : [windows-2022, windows-2025]
146- config : [debug, release]
147- fail-fast : false
148-
149- runs-on : ${{ matrix.os }}
150-
151- env :
152- # see https://www.pcre.org/original/changelog.txt
153- PCRE_VERSION : 8.45
154-
155- steps :
156- - uses : actions/checkout@v4
157- with :
158- persist-credentials : false
159-
160- - name : Set up Python
161- if : matrix.config == 'release'
162- uses : actions/setup-python@v5
163- with :
164- python-version : ' 3.14'
165- check-latest : true
166-
167- - name : Set up Visual Studio environment
168- uses : ilammy/msvc-dev-cmd@v1
169- with :
170- arch : x64
171-
172- - name : Cache PCRE
173- id : cache-pcre
174- uses : actions/cache@v4
175- with :
176- path : |
177- externals\pcre.h
178- externals\pcre.lib
179- externals\pcre64.lib
180- key : pcre-${{ env.PCRE_VERSION }}-x64-bin-win
181-
182- - name : Download PCRE
183- if : steps.cache-pcre.outputs.cache-hit != 'true'
184- run : |
185- curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
186-
187- - name : Install PCRE
188- if : steps.cache-pcre.outputs.cache-hit != 'true'
189- run : |
190- @echo on
191- 7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
192- cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
193- git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel!
194- cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
195- nmake || exit /b !errorlevel!
196- copy pcre.h ..\externals || exit /b !errorlevel!
197- copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
198- env :
199- CL : /MP
200-
201- - name : Install missing Python packages
202- if : matrix.config == 'release'
203- run : |
204- python -m pip install pip --upgrade || exit /b !errorlevel!
205- python -m pip install pytest || exit /b !errorlevel!
206- python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
207- python -m pip install pytest-timeout || exit /b !errorlevel!
208- python -m pip install pytest-xdist || exit /b !errorlevel!
209- python -m pip install psutil || exit /b !errorlevel!
210-
211- - name : Build CLI debug configuration using MSBuild
212- if : matrix.config == 'debug'
213- run : |
214- :: cmake --build build --target check --config Debug || exit /b !errorlevel!
215- msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
216- env :
217- _CL_ : /WX
218-
219- - name : Run Debug test
220- if : matrix.config == 'debug'
221- run : .\bin\debug\testrunner.exe -t || exit /b !errorlevel!
222-
223- - name : Build CLI release configuration using MSBuild
224- if : matrix.config == 'release'
225- run : |
226- :: cmake --build build --target check --config Release || exit /b !errorlevel!
227- msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=x64 -maxcpucount || exit /b !errorlevel!
228- env :
229- _CL_ : /WX
230-
231- - name : Run Release test
232- if : matrix.config == 'release'
233- run : .\bin\testrunner.exe || exit /b !errorlevel!
234-
235- - name : Prepare test/cli
236- if : matrix.config == 'release'
237- run : |
238- :: since FILESDIR is not set copy the binary to the root so the addons are found
239- :: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
240- copy .\bin\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
241- copy .\bin\cppcheck-core.dll .\cppcheck-core.dll || exit /b !errorlevel!
242-
243- - name : Run test/cli
244- if : matrix.config == 'release'
245- run : |
246- python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
247-
248- - name : Run test/cli (-j2)
249- if : matrix.config == 'release'
250- run : |
251- python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
252- env :
253- TEST_CPPCHECK_INJECT_J : 2
254-
255- # TODO: install clang
256- - name : Run test/cli (--clang)
257- if : false # matrix.config == 'release'
258- run : |
259- python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
260- env :
261- TEST_CPPCHECK_INJECT_CLANG : clang
262-
263- - name : Run test/cli (--cppcheck-build-dir)
264- if : matrix.config == 'release'
265- run : |
266- python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
267- env :
268- TEST_CPPCHECK_INJECT_BUILDDIR : injected
269-
270- # TODO: test with Release configuration?
271- - name : Test SEH wrapper
272- if : matrix.config == 'release'
273- run : |
274- cmake -S . -B build.cmake.seh -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
275- cmake --build build.cmake.seh --target test-sehwrapper || exit /b !errorlevel!
276- :: TODO: how to run this without copying the file?
277- copy build.cmake.seh\bin\Debug\test-sehwrapper.exe . || exit /b !errorlevel!
278- python3 -m pytest -Werror --strict-markers -vv test/seh/test-sehwrapper.py || exit /b !errorlevel!
279- del test-sehwrapper.exe || exit /b !errorlevel!
280-
281- - name : Test addons
282- if : matrix.config == 'release'
283- run : |
284- echo on
285- .\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel!
286- .\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!
287- .\cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c || exit /b !errorlevel!
288- cd addons\test
289- rem We'll force C89 standard to enable an additional verification for
290- rem rules 5.4 and 5.5 which have standard-dependent options.
291- ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 || exit /b !errorlevel!
292- python3 ..\misra.py -verify misra\misra-test.c.dump || exit /b !errorlevel!
293- rem Test slight MISRA differences in C11 standard
294- ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test-c11.c --std=c11 --platform=unix64 || exit /b !errorlevel!
295- python3 ..\misra.py -verify misra\misra-test-c11.c.dump || exit /b !errorlevel!
296- rem TODO: do we need to verify something here?
297- ..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra\misra-test.h || exit /b !errorlevel!
298- ..\..\cppcheck --dump misra\misra-test.cpp || exit /b !errorlevel!
299- python3 ..\misra.py -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
300- python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_ascii.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
301- python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_utf8.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
302- python3 ..\misra.py --rule-texts=misra\misra2012_rules_dummy_windows1250.txt -verify misra\misra-test.cpp.dump || exit /b !errorlevel!
303- ..\..\cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra\misra-test-avr8.c || exit /b !errorlevel!
304- ..\..\cppcheck --dump misc-test.cpp || exit /b !errorlevel!
305- python3 ..\misc.py -verify misc-test.cpp.dump || exit /b !errorlevel!
306- ..\..\cppcheck --dump naming_test.c || exit /b !errorlevel!
307- rem TODO: fix this - does not fail on Linux
308- rem python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump || exit /b !errorlevel!
309- ..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
310- python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!
311-
312- # TODO: run with "-n auto" when misra_test.py can be run in parallel
313- - name : test addons (Python)
314- if : matrix.config == 'release'
315- run : |
316- python -m pytest -Werror --strict-markers -vv -n 1 addons/test || exit /b !errorlevel!
317- env :
318- PYTHONPATH : ./addons
319-
320- - name : Check Windows test syntax
321- if : matrix.config == 'debug'
322- run : |
323- cd test\cfg
324- cl.exe windows.cpp -DUNICODE=1 -D_UNICODE=1 /Zs || exit /b !errorlevel!
325- cl.exe mfc.cpp /EHsc /Zs || exit /b !errorlevel!
326-
327- - name : Show all ignored files
328- if : false # TODO: currently lists all the contents of ignored folders - we only need what actually matched
329- run : |
330- git ls-files --others --ignored --exclude-standard || exit /b !errorlevel!
331-
332- - name : Check for changed and unversioned files
333- run : |
334- :: TODO: how to do this with a single command?
335- git status --ignored=no
336- :: TODO: make this work
337- :: git status --ignored=no | grep -q 'working tree clean'
0 commit comments