-
Notifications
You must be signed in to change notification settings - Fork 4
729 lines (722 loc) · 35.7 KB
/
build.yaml
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
name: Build and Test
on: [ push, pull_request ]
permissions:
contents: read
jobs:
linux:
if: false
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
qt:
- 5
- 5.9.9
- 5.10.1
- 5.11.3
- 5.12.12
- 5.13.2
- 5.14.2
- 5.15.2
- 6
- 6.2.4
- 6.3.2
- 6.4.3
- 6.5.3
- 6.6.3
- 6.7.3
- 6.8.0
cc:
- clang
- gcc
steps:
- name: Upgrade OS
run: |
sudo apt-mark hold firefox grub-efi-amd64-signed
sudo apt update && sudo apt upgrade
sudo apt install lcov llvm
- uses: actions/setup-python@v5
with:
python-version: '>=3.9'
- name: Install Ubuntu's Qt5
if: matrix.qt == 5
run: sudo apt install qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
- name: Install Ubuntu's Qt6
if: matrix.qt == 6
run: >
sudo apt install qt6-{base-{dev{,-tools},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}}
- name: Install online Qt version
if: contains(matrix.qt, '.') # ie if not using Ubuntu's Qt5/Qt6.
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
setup-python: false
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-linux-${{ matrix.cc }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Install linuxdeploy
uses: pcolby/install-linuxdeploy@v1
with:
plugins: appimage qt
- uses: actions/checkout@v4
- name: Build
id: build
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cc == 'gcc' && 'g++' || 'clang++' }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.cc }}.qt-${{ matrix.qt }}
run: |
[[ '${{ matrix.qt }}' =~ ^[56]$ ]] ||
qtInstallDocs="$RUNNER_WORKSPACE/Qt/Docs/Qt-${QT_VERSION:-${{ matrix.qt }}}"
# With coverage instrumentation.
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=true \
${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/coverage"
# Without coverage instrumentation.
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=false \
${qtInstallDocs:+-D "QT_INSTALL_DOCS=$qtInstallDocs"} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/release"
tee -a "$GITHUB_OUTPUT" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")"
cmake --build "$RUNNER_TEMP/coverage"
cmake --build "$RUNNER_TEMP/release"
"$RUNNER_TEMP/coverage/src/cli/dokit" --version
"$RUNNER_TEMP/release/src/cli/dokit" --version
- name: Test
run: |
ctest --output-on-failure --test-dir "$RUNNER_TEMP/coverage" --verbose
ctest --output-on-failure --test-dir "$RUNNER_TEMP/release" --verbose
cmake --build "$RUNNER_TEMP/coverage" --target coverage
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: >
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial \
-l CPP -r "${{ runner.temp }}/coverage/coverage.info"
- name: Report parallel coverage to Coveralls
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage/coverage.info
format: lcov
flag-name: linux-${{ matrix.cc }}-${{ matrix.qt }}
parallel: true
- name: Build AppImage
run: cmake --build "$RUNNER_TEMP/release" --target cli-appimage
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/release/src/lib/libQtPokit.so
${{ runner.temp }}/release/src/cli/dokit
if-no-files-found: error
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
path: ${{ runner.temp }}/release/dokit-${{ steps.build.outputs.dokitVersion }}.AppImage
if-no-files-found: error
mac:
if: false
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
qt:
- 5.9.9
- 5.10.1
- 5.11.3
- 5.12.12
- 5.13.2
- 5.14.2
- 5.15.2
- 6.2.4
- 6.3.2
- 6.4.3
- 6.5.3
- 6.6.3
- 6.7.3
- 6.8.0
os:
- macos-13
- macos-14
- macos-15
cc:
- clang
- gcc
exclude:
# GitHub's macOS 14+ gcc can only target arm64, but Qt didn't add Apple arm64 support until Qt 6.2, so:
# Exclude Qt 5.x (and 6.0, 6.1) with GCC on macOS 14+. Also see the `arch` step below for more details.
- { qt: '5.9.9', os: macos-14, cc: gcc }
- { qt: '5.9.9', os: macos-15, cc: gcc }
- { qt: '5.10.1', os: macos-14, cc: gcc }
- { qt: '5.10.1', os: macos-15, cc: gcc }
- { qt: '5.11.3', os: macos-14, cc: gcc }
- { qt: '5.11.3', os: macos-15, cc: gcc }
- { qt: '5.12.12', os: macos-14, cc: gcc }
- { qt: '5.12.12', os: macos-15, cc: gcc }
- { qt: '5.13.2', os: macos-14, cc: gcc }
- { qt: '5.13.2', os: macos-15, cc: gcc }
- { qt: '5.14.2', os: macos-14, cc: gcc }
- { qt: '5.14.2', os: macos-15, cc: gcc }
- { qt: '5.15.2', os: macos-14, cc: gcc }
- { qt: '5.15.2', os: macos-15, cc: gcc }
# Exclude Qt 5.10 with GCC on macOS. See https://bugreports.qt.io/browse/QTBUG-66585
- { qt: '5.10.1', cc: gcc }
# Exclude Qt 6.x with GCC on macOS for now. See https://bugreports.qt.io/browse/QTBUG-107050
- { qt: '6.2.4', cc: gcc }
- { qt: '6.3.2', cc: gcc }
- { qt: '6.4.3', cc: gcc }
- { qt: '6.5.3', cc: gcc }
- { qt: '6.6.3', cc: gcc }
- { qt: '6.7.3', cc: gcc }
- { qt: '6.8.0', cc: gcc }
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: brew install lcov
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Choose target architectures
id: arch
run: |
# Qt only supports x86-64 (not arm64) prior to Qt 6.2.0. See https://www.qt.io/blog/qt-on-apple-silicon
if [[ '${{ matrix.qt }}' =~ ^(5|6\.[01])\. ]]; then arch=x86_64
# GitHub runners' (homebrew'd) gcc's only support support x86-64 prior to macos-14, and only arm64 after.
# Note: if we attempt to use multiple archs, gcc will warn, but continue, resulting in later failures.
elif [[ '${{ matrix.cc }}' == 'gcc' ]]; then
if [[ '${{ matrix.os }}' == 'macos-13' ]]; then arch='x86_64'; else arch='arm64'; fi
# Otherwise, default to universal binaries, where possible.
else arch='arm64;x86_64'; fi
tee -a "$GITHUB_ENV" <<< "CMAKE_OSX_ARCHITECTURES=${arch}"
tee -a "$GITHUB_OUTPUT" <<< "buildId=${arch//;/-}"
- name: Build
id: build
env:
CC: ${{ matrix.cc == 'gcc' && 'gcc-14' || 'clang' }}
CXX: ${{ matrix.cc == 'gcc' && 'g++-14' || 'clang++' }}
PROJECT_BUILD_ID: "${{ github.run_number }}.${{ matrix.os }}.${{ steps.arch.outputs.buildId }}.\
${{ matrix.cc }}.qt-${{ matrix.qt }}"
run: |
# With coverage instrumentation.
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake -D CMAKE_BUILD_TYPE=Release \
-D CODECOV_GCOV=/usr/local/bin/gcov-14 \
-D ENABLE_COVERAGE=true \
-D LLVM_COV=/Library/Developer/CommandLineTools/usr/bin/llvm-cov \
-D LLVM_PROFDATA=/Library/Developer/CommandLineTools/usr/bin/llvm-profdata \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/coverage"
# Without coverage instrumentation.
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=false \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP/release"
tee -a "$GITHUB_OUTPUT" <<< "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } |
tee -a "$GITHUB_OUTPUT"
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
cmake --build "$RUNNER_TEMP/coverage" -- VERBOSE=1
cmake --build "$RUNNER_TEMP/release" -- VERBOSE=1
"$RUNNER_TEMP/release/src/cli/dokit.app/Contents/MacOS/dokit" --version
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
"$RUNNER_TEMP/coverage/src/cli/dokit.app/Contents/MacOS/dokit" --version
- name: Grant Bluetooth access # Only needed for unit tests with older Qt's on newer runners.
if: matrix.os != 'macos-13' && ( startsWith(matrix.qt, '5') || startsWith(matrix.qt, '6.2.') )
run: >
sudo sqlite3 "$HOME/Library/Application Support/com.apple.TCC/TCC.db" "INSERT or REPLACE INTO access
( service, client, client_type, auth_value, auth_reason, auth_version, flags ) VALUES
( 'kTCCServiceBluetoothAlways', '/usr/local/opt/runner/provisioner/provisioner', 1, 2, 3, 1, 0 )"
- name: Test
run: |
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
ctest --output-on-failure --test-dir "$RUNNER_TEMP/coverage" --verbose
ctest --output-on-failure --test-dir "$RUNNER_TEMP/release" --verbose
timeout-minutes: 1
- name: Collate test coverage
if: matrix.os != 'macos-13' || matrix.cc == 'gcc'
run: cmake --build "$RUNNER_TEMP/coverage" --target coverage
- name: Upload test results
if: matrix.os != 'macos-13' || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: >-
( matrix.os != 'macos-13' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: >
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial \
-l CPP -r "${{ runner.temp }}/coverage/coverage.info"
- name: Report parallel coverage to Coveralls
if: >-
( matrix.os != 'macos-13' || matrix.cc == 'gcc' )
&& github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
file: ${{ runner.temp }}/coverage/coverage.info
format: lcov
flag-name: mac-${{ matrix.cc }}-${{ matrix.qt }}
parallel: true
- name: Make app bundle
run: macdeployqt "$RUNNER_TEMP/release/src/cli/dokit.app" -dmg -verbose=2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.build.outputs.dokitVersion }}
path: ${{ runner.temp }}/release/src/cli/*.app
if-no-files-found: error
win:
runs-on: windows-latest
defaults: { run: { shell: cmd } }
strategy:
fail-fast: false
matrix:
qt:
#- 5.9.9
#- 5.10.1
#- 5.11.3
#- 5.12.12
#- 5.13.2
#- 5.14.2
#- 5.15.2
#- 6.2.4
#- 6.3.2
#- 6.4.3
#- 6.5.3
#- 6.6.3
- 6.7.3
- 6.8.0
arch: [ x86, x86-64 ] #, arm64 ]
toolchain: [ llvm, mingw, msvc ]
exclude:
# Exclude arm64 builds for Qt's earlier than 6.2, since Qt only added (Windows) arm64
# 'Technology Preview' support in 6.2.
- { arch: arm64, qt: '5.9.9' }
- { arch: arm64, qt: '5.10.1' }
- { arch: arm64, qt: '5.11.3' }
- { arch: arm64, qt: '5.12.12' }
- { arch: arm64, qt: '5.13.2' }
- { arch: arm64, qt: '5.14.2' }
- { arch: arm64, qt: '5.15.2' }
# Also exclude arm64 for Qt 6.8 for now, as Qt 6.8 is moving to native-only (not cross-compiling) arm64 on
# Windows (https://www.qt.io/blog/qt-for-windows-on-arm-may21-update) and there are not compatible runners.
- { arch: arm64, qt: '6.8.0' }
# Exclude MinGW (including LLVM) builds for arm64, since Qt does not provide those binaries yet.
- { arch: arm64, toolchain: llvm }
- { arch: arm64, toolchain: mingw }
# Exclude LLVM builds for x86, since neither Qt nor GitHub runners provide 32-bit LLVM MinGW binaries.
- { arch: x86, toolchain: llvm }
# Exclude x86 (32-bit) builds for Qt 5.10.1 with MSVC. See https://bugreports.qt.io/browse/QTBUG-67259
- { arch: x86, qt: '5.10.1', toolchain: msvc }
# Exclude x86 (32-bit) builds for Qt 6.x, since the Qt online installer dropped those.
- { arch: x86, qt: '6.2.4' }
- { arch: x86, qt: '6.3.2' }
- { arch: x86, qt: '6.4.3' }
- { arch: x86, qt: '6.5.3' }
- { arch: x86, qt: '6.6.3' }
- { arch: x86, qt: '6.7.3' }
- { arch: x86, qt: '6.8.0' }
# Exclude MinGW (including LLVM) builds for x86-64 with Qt's earlier than 5.12, since the Qt online
# installer (as used by aqtinstaller) did not include x86-64 binaries until Qt 5.12.
- { arch: x86-64, qt: '5.9.9', toolchain: llvm }
- { arch: x86-64, qt: '5.9.9', toolchain: mingw }
- { arch: x86-64, qt: '5.10.1', toolchain: llvm }
- { arch: x86-64, qt: '5.10.1', toolchain: mingw }
- { arch: x86-64, qt: '5.11.3', toolchain: llvm }
- { arch: x86-64, qt: '5.11.3', toolchain: mingw }
# Exclude LLVM builds before Qt 6.7, since Qt didn't begin shipping llvm-mingw support until then.
- { toolchain: llvm, qt: '5.9.9' }
- { toolchain: llvm, qt: '5.10.1' }
- { toolchain: llvm, qt: '5.11.3' }
- { toolchain: llvm, qt: '5.12.12' }
- { toolchain: llvm, qt: '5.13.2' }
- { toolchain: llvm, qt: '5.14.2' }
- { toolchain: llvm, qt: '5.15.2' }
- { toolchain: llvm, qt: '6.2.4' }
- { toolchain: llvm, qt: '6.3.2' }
- { toolchain: llvm, qt: '6.4.3' }
- { toolchain: llvm, qt: '6.5.3' }
- { toolchain: llvm, qt: '6.6.3' }
include:
# Map the aqtinstall (aqt) architectures.
#- { qt: '5.9.9', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
#- { qt: '5.9.9', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 }
#- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2013_64 }
#- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.9.9', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.10.1', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
# { qt: '5.10.1', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 } # Excluded above (QTBUG-67259).
#- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2013_64 }
#- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.10.1', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.11.3', toolchain: mingw, arch: x86, aqtArch: win32_mingw53 }
#- { qt: '5.11.3', toolchain: msvc, arch: x86, aqtArch: win32_msvc2015 }
#- { qt: '5.11.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.11.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.12.12', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
#- { qt: '5.12.12', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
#- { qt: '5.12.12', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
#- { qt: '5.12.12', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.12.12', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.13.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
#- { qt: '5.13.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
#- { qt: '5.13.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
#- { qt: '5.13.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.13.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.14.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw73 }
#- { qt: '5.14.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw73 }
#- { qt: '5.14.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2017 }
#- { qt: '5.14.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.14.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2017_64 }
#- { qt: '5.15.2', toolchain: mingw, arch: x86, aqtArch: win32_mingw81 }
#- { qt: '5.15.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw81 }
#- { qt: '5.15.2', toolchain: msvc, arch: x86, aqtArch: win32_msvc2019 }
#- { qt: '5.15.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2015_64 }
#- { qt: '5.15.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
#- { qt: '6.2.4', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.2.4', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
#- { qt: '6.2.4', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
#- { qt: '6.3.2', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.3.2', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
#- { qt: '6.3.2', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
#- { qt: '6.4.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.4.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
#- { qt: '6.4.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
#- { qt: '6.5.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.5.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
#- { qt: '6.5.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
#- { qt: '6.6.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.6.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
#- { qt: '6.6.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.7.3', toolchain: llvm, arch: x86-64, aqtArch: win64_llvm_mingw }
- { qt: '6.7.3', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
#- { qt: '6.7.3', toolchain: msvc, arch: arm64, aqtArch: win64_msvc2019_arm64 }
- { qt: '6.7.3', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2019_64 }
- { qt: '6.8.0', toolchain: llvm, arch: x86-64, aqtArch: win64_llvm_mingw }
- { qt: '6.8.0', toolchain: mingw, arch: x86-64, aqtArch: win64_mingw }
- { qt: '6.8.0', toolchain: msvc, arch: x86-64, aqtArch: win64_msvc2022_64 }
# Map the MSVC architecture.
#- { toolchain: msvc, arch: arm64, msvcArch: amd64_arm64 }
- { toolchain: msvc, arch: x86, msvcArch: amd64_x86 }
- { toolchain: msvc, arch: x86-64, msvcArch: amd64 }
# Define the generator and dll names per toolchain.
- { toolchain: 'llvm', generator: 'MinGW Makefiles', dll: libQtPokit.dll }
- { toolchain: 'mingw', generator: 'MinGW Makefiles', dll: libQtPokit.dll }
- { toolchain: 'msvc', generator: 'NMake Makefiles', dll: QtPokit.dll }
# Use Qt-provided 64-bit MinGW for recent Qt's (defaulting to GitHub's 12.2.0 version for older Qt versions).
#- { toolchain: 'mingw', arch: x86-64, qt: '5.14.2', aqtTools: 'tools_mingw1310' }
#- { toolchain: 'mingw', arch: x86-64, qt: '5.15.2', aqtTools: 'tools_mingw1310' }
#- { toolchain: 'mingw', arch: x86-64, qt: '6.4.3', aqtTools: 'tools_mingw1310' }
#- { toolchain: 'mingw', arch: x86-64, qt: '6.5.3', aqtTools: 'tools_mingw1310' }
#- { toolchain: 'mingw', arch: x86-64, qt: '6.6.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'llvm', arch: x86-64, qt: '6.7.3', aqtTools: 'tools_llvm_mingw1706' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.7.3', aqtTools: 'tools_mingw1310' }
- { toolchain: 'llvm', arch: x86-64, qt: '6.8.0', aqtTools: 'tools_llvm_mingw1706' }
- { toolchain: 'mingw', arch: x86-64, qt: '6.8.0', aqtTools: 'tools_mingw1310' }
steps:
- name: Configure path
if: matrix.toolchain != 'msvc'
shell: bash
run: |
# Paths needed for MSYS2's LCOV to function properly. Note, its important that we add the mingw64 one here
# before any later mingw installs (including those from install-qt-action) or this would interfere with those.
tee -a "$GITHUB_PATH" <<< 'C:\msys64\usr\bin' # Else geninfo will fail to find .gcda files (not sure why).
tee -a "$GITHUB_PATH" <<< 'C:\msys64\mingw64\bin' # Else lcov will fail to find its own geninfo command.
# For 32-bit (x86) MinGW builds, place GitHub's mingw32 at the head of the path (install-qt-actions would
# supersede this below, but we never install (32-bit) mingw32 via install-qt-actions, so not an issue).
[[ '${{ matrix.toolchain }}' != 'mingw' || '${{ matrix.arch }}' != 'x86' ]] ||
tee -a "$GITHUB_PATH" <<< 'C:\mingw32\bin'
- name: Install LCOV
if: matrix.toolchain != 'msvc'
run: pacman --sync --noconfirm --verbose mingw-w64-x86_64-lcov
- uses: actions/checkout@v4
- name: Install host Qt for cross-compilation
if: matrix.arch == 'arm64'
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
arch: win64_msvc2019_64
set-env: false
- name: Upload aqtinstall log file
if: matrix.arch == 'arm64' && failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.qt }}-cross
path: aqtinstall.log
if-no-files-found: error
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
arch: ${{ matrix.aqtArch }}
tools: ${{ matrix.aqtTools }}
add-tools-to-path: true
documentation: true
doc-archives: >-
${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' ||
(startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
- name: Upload aqtinstall log file
if: failure()
uses: actions/upload-artifact@v4
with:
name: aqtinstall-log-win-${{ matrix.arch }}-${{ matrix.toolchain }}-${{ matrix.qt }}
path: aqtinstall.log
if-no-files-found: error
- name: Configure cross-compilation
if: matrix.arch == 'arm64'
shell: bash
run: |
echo "CMAKE_TOOLCHAIN_FILE=${QT_ROOT_DIR/_64/_arm64/}\lib\cmake\Qt6\qt.toolchain.cmake" >> $GITHUB_ENV
echo "qtHostPath=${QT_ROOT_DIR/_arm64/_64}" >> $GITHUB_ENV
- name: Configure MSVC
if: matrix.toolchain == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvcArch }}
toolset: ${{ startsWith(matrix.qt, '5') && '14.29' || '' }} # MSVC 14.38+ has many deprecation issues w/ Qt5.
- name: Build w/ coverage instrumentation
if: matrix.toolchain != 'msvc'
env:
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
PROJECT_BUILD_ID: ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release ^
-D ENABLE_COVERAGE=true ^
-D QT_HOST_PATH=%qtHostPath% ^
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/coverage"
cmake --build "%RUNNER_TEMP%/coverage" --verbose
- name: Build w/o coverage instrumentation
env:
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
PROJECT_BUILD_ID: ${{ github.run_number }}.win.${{ matrix.arch }}.${{ matrix.toolchain }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release ^
-D ENABLE_COVERAGE=false ^
-D QT_HOST_PATH=%qtHostPath% ^
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/release"
cmake --build "%RUNNER_TEMP%/release" --verbose
- name: Capture build-output variables
id: post-build
shell: bash
run: |
echo "dokitVersion=$(cat "$RUNNER_TEMP/release/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } |
tee -a "$GITHUB_OUTPUT"
- name: Install DLL for tests w/ coverage
if: matrix.toolchain != 'msvc'
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
working-directory: ${{ runner.temp }}/coverage
- name: Install DLL for tests w/o coverage
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\lib
working-directory: ${{ runner.temp }}/release
- name: Test StatusService 0
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: 'D:\a\_temp\coverage\test\unit\lib\testAbstractPokitService 2>&1'
- name: Test StatusService 0.5
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
shell: bash
run: |
echo A
/d/a/_temp/coverage/test/unit/lib/testStatusService.exe || true
echo B
/d/a/_temp/coverage/test/unit/lib/testStatusService.exe >&2 || true
echo C
/d/a/_temp/coverage/test/unit/lib/testStatusService.exe 2>&1 || true
echo D
/d/a/_temp/coverage/test/unit/lib/testStatusService.exe -o foo,txt || true
echo E
cat foo
- name: Test StatusService 3
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: 'D:\a\_temp\coverage\test\unit\lib\testStatusService.exe 2>&1'
- name: Test StatusService 4
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: 'D:\a\_temp\release\test\unit\lib\testStatusService.exe 2>&1'
- name: Test StatusService 1
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: 'D:\a\_temp\coverage\test\unit\lib\testStatusService.exe -o StatusService.tap,tap -o -,txt 2>&1'
- name: Test StatusService 2
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: 'D:\a\_temp\release\test\unit\lib\testStatusService.exe -o StatusService.tap,tap -o -,txt 2>&1'
- name: Test w/ coverage # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64' && matrix.toolchain != 'msvc'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%/coverage" --extra-verbose 2>&1
- name: Test w/o coverage # We can't execute arm64 binaries on an x86-64 host.
if: matrix.arch != 'arm64'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%/release" --extra-verbose 2>&1
- name: Collate test coverage
if: matrix.toolchain != 'msvc'
run: cmake --build "%RUNNER_TEMP%/coverage" --target coverage --verbose
- name: Upload test results
if: matrix.arch != 'arm64' && ( matrix.toolchain != 'msvc' || fromJSON(steps.post-build.outputs.tap) )
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage/coverage.info
${{ runner.temp }}/coverage/removeHtmlDates.sh
${{ runner.temp }}/coverage/test/**/*.tap
${{ runner.temp }}/release/test/**/*.tap
if-no-files-found: error
- name: Make portable
if: matrix.arch != 'arm64'
run: cmake --build "%RUNNER_TEMP%/release" --target cli-portable
- name: Check portable version
if: matrix.arch != 'arm64'
shell: bash
run: '"$RUNNER_TEMP/release/portable/dokit.exe" --version'
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.post-build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/release/src/lib/${{ matrix.dll }}
${{ runner.temp }}/release/src/cli/dokit.exe
if-no-files-found: error
- name: Upload artifacts (portable)
if: matrix.arch != 'arm64'
uses: actions/upload-artifact@v4
with:
name: dokit-${{ steps.post-build.outputs.dokitVersion }}.portable
path: ${{ runner.temp }}/release/portable
if-no-files-found: error
collate-test-results:
needs: [ linux, mac, win ]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: |
sudo apt-mark hold firefox grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov
- name: Download test results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run download "$GITHUB_RUN_ID" --dir "$RUNNER_TEMP/artifacts" --pattern test-results-*
- name: Generate test summary
uses: pcolby/tap-summary@v1
with:
path: ${{ runner.temp }}/artifacts/**/*.tap
- name: Generate HTML coverage report
run: |
shopt -s globstar
# Update source code paths from macOS tracefiles to match Linux.
sed -i -Ee 's|^SF:/Users|SF:/home|' artifacts/*.macos-*/**/coverage.info
# Update source code paths from Windows tracefiles to match Linux, and remove all \r chars from line endings.
sed -i -Ee 's|\r$||' -e 's|\\|/|g' -e 's|^SF:D:/a|SF:/home/runner/work|' artifacts/*.win.*/**/coverage.info
# Combine all tracefiles into one.
lcov $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info
# Generate the HTML report.
echo 'genhtml_sort = 0' >> ~/.lcovrc
genhtml --output-directory coverage/coverage coverage.info
# Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu GCC Qt6 job's version will do.
/usr/bin/env bash ./artifacts/test-results-*.gcc.qt-6/coverage/removeHtmlDates.sh
# Remove build numbers from pre-releases, and remove extra build info (such as ".linux.x86-64.gcc.qt-6")
# from all releases, since this coverage report is an aggregation of many build hosts.
sed -i -Ee 's/(headerValue">([0-9]+\.){2}[0-9]+)(((-pre)\+[0-9]+)|(\+[0-9]+))\..*</\1\5\6</' \
coverage/**/*.html
working-directory: ${{ runner.temp }}
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: "${{ runner.temp }}/coverage/coverage"
if-no-files-found: error
- name: Report partial-finished to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
- name: Report parallel-finished to Coveralls
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
update-tests-on-doc-branch:
permissions:
contents: write
runs-on: ubuntu-24.04
if: success() && (github.ref == 'refs/heads/main')
needs: collate-test-results
steps:
- uses: actions/checkout@v4
with: { ref: doc }
- name: Clear previous coverage report
run: rm -rf main/cov
- name: Download HTML report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: main/cov
- name: Inject version selectors
run: ./.selector.sh
- name: Inspect changes # for diagnostics only.
run: git status && git diff
- name: Push updates
run: |
[[ -z $(git status --porcelain) ]] || {
git config user.name github-actions
git config user.email [email protected]
git pull
git add .
git commit -m "Update coverage report for ${GITHUB_SHA}"
git push
}