Skip to content

Commit 48874e3

Browse files
authored
CI-windows.yml: untangle Qt and regular builds (cppcheck-opensource#4454)
1 parent f83b8dd commit 48874e3

1 file changed

Lines changed: 59 additions & 57 deletions

File tree

.github/workflows/CI-windows.yml

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,67 @@ defaults:
1515

1616
jobs:
1717

18+
build_qt:
19+
strategy:
20+
matrix:
21+
os: [windows-2019, windows-2022]
22+
qt_ver: [5.15.2, 6.2.4, 6.3.1]
23+
fail-fast: false
24+
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Set up Visual Studio environment
31+
uses: ilammy/msvc-dev-cmd@v1
32+
with:
33+
arch: x64 # no 32-bit Qt available
34+
35+
- name: Cache Qt ${{ matrix.qt_ver }}
36+
id: cache-qt
37+
uses: actions/cache@v1 # not v2!
38+
with:
39+
path: ../Qt
40+
key: Windows-QtCache-${{ matrix.qt_ver }}-qtcharts
41+
42+
- name: Install Qt ${{ matrix.qt_ver }}
43+
uses: jurplel/install-qt-action@v2
44+
with:
45+
aqtversion: '==2.0.6'
46+
version: ${{ matrix.qt_ver }}
47+
modules: 'qtcharts'
48+
cached: ${{ steps.cache-qt.outputs.cache-hit }}
49+
50+
- name: Build GUI release (qmake)
51+
if: startsWith(matrix.qt_ver, '5')
52+
run: |
53+
cd gui || exit /b !errorlevel!
54+
qmake HAVE_QCHART=yes || exit /b !errorlevel!
55+
nmake release || exit /b !errorlevel!
56+
env:
57+
CL: /MP
58+
59+
- name: Deploy GUI
60+
if: startsWith(matrix.qt_ver, '5')
61+
run: |
62+
windeployqt Build\gui || exit /b !errorlevel!
63+
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
64+
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
65+
66+
- name: Build GUI release (CMake)
67+
if: startsWith(matrix.qt_ver, '6')
68+
run: |
69+
cmake -S . -B build -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_QT6=On || exit /b !errorlevel!
70+
cmake --build build --target cppcheck-gui || exit /b !errorlevel!
71+
72+
# TODO: deploy with CMake/Qt6
73+
1874
build:
1975
strategy:
2076
matrix:
2177
os: [windows-2019, windows-2022]
2278
arch: [x64, x86]
23-
qt_ver: ['', 5.15.2, 6.2.4, 6.3.1]
2479
fail-fast: false
2580

2681
runs-on: ${{ matrix.os }}
@@ -31,24 +86,20 @@ jobs:
3186

3287
steps:
3388
- uses: actions/checkout@v2
34-
if: matrix.arch == 'x64' || matrix.qt_ver == ''
3589

3690
- name: Set up Python 3.10
37-
if: matrix.qt_ver == ''
3891
uses: actions/setup-python@v2
3992
with:
4093
python-version: '3.10'
4194

4295
- name: Set up Visual Studio environment
43-
if: matrix.arch == 'x64' || matrix.qt_ver == ''
4496
uses: ilammy/msvc-dev-cmd@v1
4597
with:
4698
arch: ${{ matrix.arch }}
4799

48100
- name: Cache PCRE
49101
id: cache-pcre
50102
uses: actions/cache@v2
51-
if: matrix.qt_ver == ''
52103
with:
53104
path: |
54105
externals\pcre.h
@@ -57,12 +108,12 @@ jobs:
57108
key: pcre-${{ env.PCRE_VERSION }}-${{ matrix.arch }}-bin-win
58109

59110
- name: Download PCRE
60-
if: matrix.qt_ver == '' && steps.cache-pcre.outputs.cache-hit != 'true'
111+
if: steps.cache-pcre.outputs.cache-hit != 'true'
61112
run: |
62113
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
63114
64115
- name: Install PCRE
65-
if: matrix.qt_ver == '' && steps.cache-pcre.outputs.cache-hit != 'true'
116+
if: steps.cache-pcre.outputs.cache-hit != 'true'
66117
run: |
67118
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
68119
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
@@ -77,57 +128,14 @@ jobs:
77128
env:
78129
CL: /MP
79130

80-
- name: Cache Qt ${{ matrix.qt_ver }}
81-
if: matrix.qt_ver != '' && matrix.arch == 'x64'
82-
id: cache-qt
83-
uses: actions/cache@v1 # not v2!
84-
with:
85-
path: ../Qt
86-
key: Windows-QtCache-${{ matrix.qt_ver }}-qtcharts
87-
88-
# no 32-bit Qt available
89-
- name: Install Qt ${{ matrix.qt_ver }}
90-
if: matrix.qt_ver != '' && matrix.arch == 'x64'
91-
uses: jurplel/install-qt-action@v2
92-
with:
93-
aqtversion: '==2.0.6'
94-
version: ${{ matrix.qt_ver }}
95-
modules: 'qtcharts'
96-
cached: ${{ steps.cache-qt.outputs.cache-hit }}
97-
98131
- name: Install missing Python packages
99-
if: matrix.qt_ver == ''
100132
run: |
101133
python -m pip install pip --upgrade || exit /b !errorlevel!
102134
python -m pip install pytest || exit /b !errorlevel!
103135
python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
104136
105-
- name: Build GUI release (qmake)
106-
if: startsWith(matrix.qt_ver, '5') && matrix.arch == 'x64'
107-
run: |
108-
cd gui || exit /b !errorlevel!
109-
qmake HAVE_QCHART=yes || exit /b !errorlevel!
110-
nmake release || exit /b !errorlevel!
111-
env:
112-
CL: /MP
113-
114-
- name: Deploy GUI
115-
if: startsWith(matrix.qt_ver, '5') && matrix.arch == 'x64'
116-
run: |
117-
windeployqt Build\gui || exit /b !errorlevel!
118-
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
119-
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
120-
121-
- name: Build GUI release (CMake)
122-
if: startsWith(matrix.qt_ver, '6') && matrix.arch == 'x64'
123-
run: |
124-
cmake -S . -B build -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_QT6=On || exit /b !errorlevel!
125-
cmake --build build --target cppcheck-gui || exit /b !errorlevel!
126-
127-
# TODO: deploy with Qt6
128-
129137
- name: Run CMake
130-
if: false && matrix.qt_ver == ''
138+
if: false # TODO: enable
131139
run: |
132140
set ARCH=${{ matrix.arch }}
133141
if "${{ matrix.arch }}" == "x86" (
@@ -136,7 +144,6 @@ jobs:
136144
cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel!
137145
138146
- name: Build CLI debug configuration using MSBuild
139-
if: matrix.qt_ver == ''
140147
run: |
141148
set ARCH=${{ matrix.arch }}
142149
if "${{ matrix.arch }}" == "x86" (
@@ -146,11 +153,9 @@ jobs:
146153
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
147154
148155
- name: Run Debug test
149-
if: matrix.qt_ver == ''
150156
run: .\bin\debug\testrunner.exe || exit /b !errorlevel!
151157

152158
- name: Build CLI release configuration using MSBuild
153-
if: matrix.qt_ver == ''
154159
run: |
155160
set ARCH=${{ matrix.arch }}
156161
if "${{ matrix.arch }}" == "x86" (
@@ -160,11 +165,9 @@ jobs:
160165
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
161166
162167
- name: Run Release test
163-
if: matrix.qt_ver == ''
164168
run: .\bin\testrunner.exe || exit /b !errorlevel!
165169

166170
- name: Run test/cli
167-
if: matrix.qt_ver == ''
168171
run: |
169172
:: since FILESDIR is not set copy the binary to the root so the addons are found
170173
:: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel!
@@ -180,7 +183,6 @@ jobs:
180183
python -m pytest test-suppress-syntaxError.py || exit /b !errorlevel!
181184
182185
- name: Test addons
183-
if: matrix.qt_ver == ''
184186
run: |
185187
.\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel!
186188
.\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!

0 commit comments

Comments
 (0)