-
-
Notifications
You must be signed in to change notification settings - Fork 294
477 lines (444 loc) · 17.9 KB
/
cmake.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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
name: CMake Build Matrix
# Directories
# - $GITHUB_WORKSPACE/qskinny_source : Checkout directory for qskinny sources
# - $GITHUB_WORKSPACE/qskinny_build : Build directory for QSkinny CMake
# - $GITHUB_WORKSPACE/qskinny_install : Install directory for QSkinny package
# - $GITHUB_WORKSPACE/qskinny_build_test : Build directory for QSkinny CMake integration test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC Qt5",
os: windows-latest,
artifact: "windows_msvc.7z",
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
archiver: "7z a",
generators: "Visual Studio 17 2022",
cmake:
{
qtversion: "5.15.2",
qtdirkey: "Qt5_DIR",
qtdirvalue: "../Qt/5.15.2/msvc2019_64/lib/cmake/Qt5",
qtprefixpath: "../Qt/5.15.2/msvc2019_64",
},
screenshot_filename: "windows-latest-msvc-qt-5-15-2.jpg",
}
- {
name: "Windows Latest MSVC Qt6",
os: windows-latest,
artifact: "windows_msvc.7z",
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
archiver: "7z a",
generators: "Visual Studio 17 2022",
cmake:
{
qtversion: "6.5.0",
qtdirkey: "Qt6_DIR",
qtdirvalue: "../Qt/6.5.0/msvc2019_64/lib/cmake/Qt6",
qtprefixpath: "../Qt/6.5.0/msvc2019_64",
},
screenshot_filename: "windows-latest-msvc-qt-6.5.0.jpg",
}
- {
name: "Windows 2019 MSVC Qt5",
os: windows-2019,
artifact: "windows_msvc.7z",
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
archiver: "7z a",
generators: "Visual Studio 16 2019",
cmake:
{
qtversion: "5.15.2",
qtdirkey: "Qt5_DIR",
qtdirvalue: "../Qt/5.15.2/msvc2019_64/lib/cmake/Qt5",
qtprefixpath: "../Qt/5.15.2/msvc2019_64",
},
screenshot_filename: "windows-2019-msvc-qt-5-15-2.jpg",
}
- {
name: "Windows 2019 MSVC Qt6",
os: windows-2019,
artifact: "windows_msvc.7z",
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
archiver: "7z a",
generators: "Visual Studio 16 2019",
cmake:
{
qtversion: "6.5.0",
qtdirkey: "Qt6_DIR",
qtdirvalue: "../Qt/6.5.0/msvc2019_64/lib/cmake/Qt6",
qtprefixpath: "../Qt/6.5.0/msvc2019_64",
},
screenshot_filename: "windows-2019-msvc-qt-6.5.0.jpg",
}
- {
name: "Ubuntu Latest GCC Qt5",
os: ubuntu-latest,
artifact: "ubuntu_gcc.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
# generators: "Ninja Multi-Config",
generators: "Ninja",
env: { DISPLAY: ":1" },
cmake:
{
qtversion: "5.15.2",
qtdirkey: "Qt5_DIR",
qtdirvalue: "../Qt/5.15.2/gcc_64/lib/cmake/Qt5",
qtprefixpath: "../Qt/5.15.2/gcc_64",
},
screenshot_filename: "ubuntu-latest-gcc-qt-5-15-2.jpg",
}
- {
name: "Ubuntu Latest GCC Qt6",
os: ubuntu-latest,
artifact: "ubuntu_gcc.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja",
env: { DISPLAY: ":1" },
cmake:
{
qtversion: "6.5.0",
qtdirkey: "Qt6_DIR",
qtdirvalue: "../Qt/6.5.0/gcc_64/lib/cmake/Qt6",
qtprefixpath: "../Qt/6.5.0/gcc_64",
},
screenshot_filename: "ubuntu-latest-gcc-qt-6.5.0.jpg",
}
- {
name: "Ubuntu GCC 9 Qt5",
os: ubuntu-latest,
artifact: "ubuntu_gcc9.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja",
env: { DISPLAY: ":1" },
cmake:
{
qtversion: "5.15.2",
qtdirkey: "Qt5_DIR",
qtdirvalue: "../Qt/5.15.2/gcc_64/lib/cmake/Qt5",
qtprefixpath: "../Qt/5.15.2/gcc_64",
},
screenshot_filename: "ubuntu-latest-gcc-9-qt-5-15-2.jpg",
}
- {
name: "Ubuntu GCC 9 Qt6",
os: ubuntu-latest,
artifact: "ubuntu_gcc9.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja",
env: { DISPLAY: ":1" },
cmake:
{
qtversion: "6.5.0",
qtdirkey: "Qt6_DIR",
qtdirvalue: "../Qt/6.5.0/gcc_64/lib/cmake/Qt6",
qtprefixpath: "../Qt/6.5.0/gcc_64",
},
screenshot_filename: "ubuntu-latest-gcc-9-qt-6.5.0.jpg",
}
- {
name: "macOS Latest Clang Qt5",
os: macos-13,
artifact: "macos_clang.7z",
build_type: "Release",
cc: "clang",
cxx: "clang++",
archiver: "7za a",
generators: "Ninja",
cmake:
{
qtversion: "5.15.2",
qtdirkey: "Qt5_DIR",
qtdirvalue: "../Qt/5.15.2/clang_64/lib/cmake/Qt5",
qtprefixpath: "../Qt/5.15.2/clang_64",
},
screenshot_filename: "macos-latest-clang-qt-5-15-2.jpg",
}
- {
name: "macOS Latest Clang Qt6",
os: macos-latest,
artifact: "macos_clang.7z",
build_type: "Release",
cc: "clang",
cxx: "clang++",
archiver: "7za a",
generators: "Ninja",
cmake:
{
qtversion: "6.5.0",
qtdirkey: "Qt6_DIR",
qtdirvalue: "../Qt/6.5.0/clang_64/lib/cmake/Qt6",
qtprefixpath: "../Qt/6.5.0/clang_64",
},
screenshot_filename: "macos-latest-clang-qt-6.5.0.jpg",
}
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
path: qskinny_source
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja
choco install cmake --version=3.16.3
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake
ninja --version
cmake --version
gcc --version
- name: Install dependencies on ubuntu9
if: startsWith(matrix.config.name, 'Ubuntu GCC 9')
run: |
echo Update gcc-9 =======================================================================
echo gcc version before
gcc --version
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install ninja-build cmake gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
echo gcc version after
gcc --version
echo Update ninja =======================================================================
echo ninja version before
ninja --version
# wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
wget https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
sudo unzip ninja-linux.zip -d /usr/local/bin/
sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force
echo ninja version after
ninja --version
echo Update cmake =======================================================================
echo cmake version before
cmake --version
# curl --silent "https://api.github.com/repos/Kitware/CMake/releases/latest" | sed -n 's/.*tag_name":\s"\(.*\)".*/\1/p' | head -2
# wget https://github.com/Kitware/CMake/releases/latest/download/cmake-3.16.5-Linux-x86_64.sh
cmake_version=$(curl --silent "https://api.github.com/repos/Kitware/CMake/releases/latest" | sed -n 's/.*tag_name":\s"\(.*\)".*/\1/p' | head -2 | cut -c 2-)
echo cmake download latest v$cmake_version version
wget https://github.com/Kitware/CMake/releases/download/v$cmake_version/cmake-$cmake_version-Linux-x86_64.sh
chmod +x cmake-$cmake_version-Linux-x86_64.sh
sudo mkdir /opt/cmake
sudo ./cmake-$cmake_version-Linux-x86_64.sh --prefix=/opt/cmake --skip-license
sudo update-alternatives --install /usr/bin/cmake cmake /opt/cmake/bin/cmake 1 --force
echo cmake version after
cmake --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
find /opt/homebrew/ -name EXTERNALLY-MANAGED|xargs rm
brew install cmake ninja
ninja --version
cmake --version
- name: Install needed xkbcommon symlink
if: startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get install libxkbcommon-dev -y
sudo apt-get install libxkbcommon-x11-0 -y
sudo apt-get install libxcb-cursor-dev -y
sudo apt-get install x11-xserver-utils -y
- name: Install hunspell for Ubuntu
if: false && startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get install -y libhunspell-dev
- name: Install pinyin for Ubuntu
if: false && startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get install -y libimepinyin-dev
- name: Install imagemagick for Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get install -y imagemagick
#- name: Cache Qt5
# if: endsWith(matrix.config.name, 'Qt5')
# id: cache-qt-5-15
# uses: actions/cache@v1 # not v2!
# with:
# path: ../Qt/5.15.2
# key: ${{ runner.os }}-QtCache-Qt5
#
#- name: Cache Qt6
# if: endsWith(matrix.config.name, 'Qt6')
# id: cache-qt-6-2
# uses: actions/cache@v1 # not v2!
# with:
# path: ../Qt/6.5.0
# key: ${{ runner.os }}-QtCache-Qt6
- name: Install Qt5
if: endsWith(matrix.config.name, 'Qt5')
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
target: "desktop"
install-deps: "true"
modules: "qtwebengine"
cached: ${{ steps.cache-qt-5-15.outputs.cache-hit }}
setup-python: "false"
tools: ""
set-env: "true"
tools-only: "false"
- name: Install Qt6
if: endsWith(matrix.config.name, 'Qt6')
uses: jurplel/install-qt-action@v4
with:
version: "6.5.0"
target: "desktop"
install-deps: "true"
modules: "qtwebengine qtshadertools"
cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }}
setup-python: "false"
tools: ""
set-env: "true"
tools-only: "false"
- name: Configure ( QSkinny )
shell: bash
run: |
mkdir qskinny_build
mkdir qskinny_install
cmake \
-S qskinny_source \
-B qskinny_build \
-G "${{ matrix.config.generators }}" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCMAKE_INSTALL_PREFIX:PATH=qskinny_install \
-DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}"
- name: Build ( QSkinny )
shell: bash
run: cmake --build qskinny_build --config ${{ matrix.config.build_type }}
#- name: Tests
# shell: bash
# run: ctest -j14 -C Release -T test --output-on-failure
- name: Install ( QSkinny ) Strip
shell: bash
run: cmake --install qskinny_build --prefix qskinny_install --strip --config ${{ matrix.config.build_type }}
- name: Smoke test ( QSkinny ) on MacOS
if: startsWith(matrix.config.name, 'macOS')
env:
QT_DEBUG_PLUGINS: "1"
run: |
echo "starting iotdashboard"
DYLD_LIBRARY_PATH=./qskinny_install/lib:./qskinny_install/plugins/skins ./qskinny_build/examples/bin/iotdashboard.app/Contents/MacOS/iotdashboard -qwindowgeometry 1024x600+75+100 --screenshot ${{ matrix.config.screenshot_filename }} &
sleep 10
# TODO remove 'qskinny_build\skins\material3\Release' when skin install is fixed
- name: Smoke Test ( QSkinny ) on Windows
if: startsWith(matrix.config.name, 'Windows')
env:
QT_DEBUG_PLUGINS: "1"
run: |
$env:Path += ";./qskinny_install/bin;./qskinny_install/lib;./qskinny_install/plugins/skins;./qskinny_build/skins/material3/Release;./qskinny_build/skins/windows/Release;./qskinny_build/skins/squiek/Release"
echo "starting iotdashboard"
Start-Process qskinny_build\examples\bin\Release\iotdashboard.exe -ArgumentList "-qwindowgeometry 1024x600+0+0 --screenshot ${{ matrix.config.screenshot_filename }}"
Start-Sleep -Seconds 10
- name: Smoke test ( QSkinny ) on Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
env:
DISPLAY: ":1"
QT_DEBUG_PLUGINS: "1"
run: |
echo starting Xvfb
Xvfb :1 &
sleep 10
echo starting iotdashboard
./qskinny_build/examples/bin/iotdashboard --screenshot ${{ matrix.config.screenshot_filename }} &
sleep 10
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.screenshot_filename }}
path: ${{ matrix.config.screenshot_filename }}
#- uses: OrbitalOwen/[email protected]
# with:
# file-name: ${{ matrix.config.screenshot_filename }}
- name: Smoke Test Cleanup ( QSkinny ) on Windows
if: startsWith(matrix.config.name, 'Windows')
run: |
taskkill /IM iotdashboard.exe /T /F
- name: Smoke Test Cleanup ( QSkinny ) on MacOS
if: startsWith(matrix.config.name, 'macOS')
run: |
killall iotdashboard
- name: Smoke Test Cleanup ( QSkinny ) on Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
run: |
killall iotdashboard
# killall Xvfb
- name: Configure ( CMake Integration Test )
shell: bash
run: |
mkdir qskinny_build_test
cmake \
-S qskinny_source/examples/iotdashboard_smoketest \
-B qskinny_build_test \
-G "${{ matrix.config.generators }}" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \
-DQSkinny_DIR:PATH=$GITHUB_WORKSPACE/qskinny_install/lib/cmake/QSkinny
- name: Build ( CMake Integration Test )
env:
DISPLAY: ":1"
shell: bash
run: cmake --build qskinny_build_test --config ${{ matrix.config.build_type }}
# - name: Pack
# shell: bash
# working-directory: instdir
# run: |
# ls -laR
# ${{ matrix.config.archiver }} ../${{ matrix.config.artifact }} .
# - name: Upload
# uses: actions/upload-artifact@v1
# with:
# path: ./${{ matrix.config.artifact }}
# name: ${{ matrix.config.artifact }}
# - name: Upload release asset
# if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./${{ matrix.config.artifact }}
# asset_name: ${{ matrix.config.artifact }}.zip
# asset_content_type: application/zip