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