-
Notifications
You must be signed in to change notification settings - Fork 0
2283 lines (2037 loc) · 106 KB
/
deploy.yml
File metadata and controls
2283 lines (2037 loc) · 106 KB
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
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Deploy
on:
push:
branches: [ "master", "feat/quads", "feat/quads-*" ]
pull_request:
# `master` covers shipping work; `feat/quads` is the long-lived
# quad-migration integration branch (#326) that chunked PRs land
# on before the final merge to master. The `feat/quads-*` glob
# covers chunked PRs that target a previous chunk's branch
# (stacked PRs). Without these, chunked PRs would have no CI
# safety net.
branches: [ "master", "feat/quads", "feat/quads-*" ]
release:
types: [published]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
AQT_VERSION: '==3.3.*'
QT_VERSION: '6.9.3'
ASSIMP_VERSION: '6.0.4'
ASSIMP_DIR_VERSION: '6.0'
OGRE_VERSION: '14.5.2'
jobs:
# send-slack-notification:
# runs-on: ubuntu-latest
# steps:
# - name: send slack message
# uses: docker://technosophos/slack-notify
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_MESSAGE: "Building QtMeshEditor in GitHub Actions - works! :D"
####################################################################
# Doc pins (README + website hook) must match CMakeLists project() VERSION
####################################################################
verify-doc-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pinned GitHub Action refs match CMakeLists.txt
run: ./scripts/sync-doc-versions-from-cmake.sh --check
####################################################################
# Asset Scan (runs first, before all builds)
####################################################################
scan-assets-qtmesh:
needs: verify-doc-versions
# Validate repo assets using the published Docker image (latest).
# Runs on PRs, pushes to master, and releases.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan media/ via Docker (ghcr.io/fernandotonon/qtmesh:latest)
run: |
set +e
docker run --rm \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
ghcr.io/fernandotonon/qtmesh:latest \
scan --config /workspace/qtmesh.yml --json > qtmesh-scan-report.json
scan_exit=$?
set -e
if [ "$scan_exit" -ne 0 ]; then
echo "::warning::Docker asset scan reported issues (using latest published image)"
fi
if ! jq -e '.summary and .version' qtmesh-scan-report.json >/dev/null 2>&1; then
echo "::warning::Docker scan output was not valid JSON. Cloud upload will be skipped."
echo '{}' > qtmesh-scan-report.json
fi
- name: Upload scan report to QtMesh Cloud
if: always()
env:
QTMESH_CLOUD_TOKEN: ${{ secrets.QTMESH_CLOUD_TOKEN }}
QTMESH_CLOUD_API_URL: https://api.qtmesh.dev
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || '' }}
run: |
if [ -z "${QTMESH_CLOUD_TOKEN:-}" ]; then
echo "::notice::QTMESH_CLOUD_TOKEN is not set. Skipping QtMesh Cloud upload."
exit 0
fi
if ! jq -e '.summary and .version' qtmesh-scan-report.json >/dev/null 2>&1; then
echo "::warning::No valid scan JSON payload found. Skipping QtMesh Cloud upload."
exit 0
fi
if [ -n "${GITHUB_PR_NUMBER:-}" ]; then
jq --arg branch "${GITHUB_REF_NAME}" \
--arg sha "${GITHUB_SHA}" \
--arg runId "${GITHUB_RUN_ID}" \
--argjson pr "${GITHUB_PR_NUMBER}" \
'. + {meta: {branch: $branch, commitSha: $sha, runId: $runId, prNumber: $pr}}' \
qtmesh-scan-report.json > qtmesh-scan-upload.json
else
jq --arg branch "${GITHUB_REF_NAME}" \
--arg sha "${GITHUB_SHA}" \
--arg runId "${GITHUB_RUN_ID}" \
'. + {meta: {branch: $branch, commitSha: $sha, runId: $runId}}' \
qtmesh-scan-report.json > qtmesh-scan-upload.json
fi
upload_report() {
local base_url="${1%/}"
curl --silent --show-error --fail \
-X POST "${base_url}/v1/ingest/scan" \
-H "Authorization: Bearer ${QTMESH_CLOUD_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary @qtmesh-scan-upload.json >/tmp/qtmesh-cloud-upload-response.json
}
if upload_report "${QTMESH_CLOUD_API_URL}"; then
echo "QtMesh Cloud upload succeeded via ${QTMESH_CLOUD_API_URL}"
cat /tmp/qtmesh-cloud-upload-response.json
else
echo "::warning::QtMesh Cloud upload failed via ${QTMESH_CLOUD_API_URL}."
fi
- name: Scan media/ via GitHub Action (root action.yml)
uses: ./
with:
command: scan
input-file: .
options: --config /workspace/qtmesh.yml
####################################################################
# Windows Deploy
####################################################################
build-n-cache-assimp-windows:
needs: scan-assets-qtmesh
runs-on: windows-latest
steps:
- name: Cache Assimp
id: cache-assimp-windows
uses: actions/cache@v3
env:
cache-name: cache-assimp-windows-mingw1310
with:
# It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll
path: |
C:/PROGRA~2/Assimp
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: steps.cache-assimp-windows.outputs.cache-hit != 'true'
name: Install Qt (for MinGW compiler)
uses: jurplel/install-qt-action@v3
with:
aqtversion: ${{ env.AQT_VERSION }}
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
tools: 'tools_cmake tools_mingw1310'
- if: steps.cache-assimp-windows.outputs.cache-hit != 'true'
name: Check out Assimp repo
uses: actions/checkout@master
with:
repository: assimp/assimp
ref: v${{ env.ASSIMP_VERSION }}
path: ${{github.workspace}}/assimp
- if: steps.cache-assimp-windows.outputs.cache-hit != 'true'
name: Build Assimp repo
env:
CMAKE_GENERATOR: "MinGW Makefiles"
PATH: "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin;D:/a/QtMeshEditor/Qt/Tools/CMake_64/bin;${{ env.PATH }}"
run: |
Write-Host "Building Assimp with Qt MinGW 13.1.0"
Write-Host "gcc version: $(gcc.exe --version | Select-Object -First 1)"
Write-Host "cmake version: $(cmake --version | Select-Object -First 1)"
Set-Location "${{github.workspace}}/assimp"
cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_GENERATOR="MinGW Makefiles" -DCMAKE_C_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/g++.exe" -DASSIMP_WARNINGS_AS_ERRORS=OFF
D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/mingw32-make.exe install -j8
Copy-Item -Recurse -Force "C:/PROGRA~2/Assimp" "${{github.workspace}}/assimp-build"
shell: powershell
build-n-cache-ogre-windows:
needs: build-n-cache-assimp-windows
runs-on: windows-latest
steps:
- name: Cache Assimp
id: cache-assimp-windows
uses: actions/cache@v3
env:
cache-name: cache-assimp-windows-mingw1310
with:
path: |
C:/PROGRA~2/Assimp
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache Ogre
id: cache-ogre-windows
uses: actions/cache@v3
env:
cache-name: cache-ogre-windows
with:
path: ${{github.workspace}}/ogre-build/SDK
# Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo.
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: steps.cache-ogre-windows.outputs.cache-hit != 'true'
name: Install Doxygen
shell: cmd
run: |
curl -L -o doxygen-installer.exe "https://www.doxygen.nl/files/doxygen-1.9.7-setup.exe"
doxygen-installer.exe /VERYSILENT
- if: steps.cache-ogre-windows.outputs.cache-hit != 'true'
name: Check out ogre repo
uses: actions/checkout@master
with:
repository: OGRECave/ogre
ref: v${{ env.OGRE_VERSION }}
path: ${{github.workspace}}/ogre
- if: steps.cache-ogre-windows.outputs.cache-hit != 'true'
name: Install Qt (for MinGW)
uses: jurplel/install-qt-action@v3
with:
aqtversion: ${{ env.AQT_VERSION }}
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
tools: 'tools_cmake tools_mingw1310'
- if: steps.cache-ogre-windows.outputs.cache-hit != 'true'
name: Add Qt MinGW to PATH for Ogre build
run: |
echo "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "Added Qt MinGW 13.1.0 to PATH for Ogre build"
where gcc.exe
gcc --version
shell: powershell
- if: steps.cache-ogre-windows.outputs.cache-hit != 'true'
name: Build Ogre3D
shell: powershell
env:
CMAKE_GENERATOR: "MinGW Makefiles"
ASSIMP_DIR: "C:/Program Files (x86)/Assimp/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }}/"
PATH: "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin;D:/a/QtMeshEditor/Qt/Tools/CMake_64/bin;${{ env.PATH }}"
run: |
Write-Host "Verifying Ogre build tools:"
Write-Host "gcc location: $((Get-Command gcc.exe).Source)"
Write-Host "g++ location: $((Get-Command g++.exe).Source)"
Write-Host "mingw32-make location: $((Get-Command mingw32-make.exe).Source)"
Write-Host "cmake location: $((Get-Command cmake.exe).Source)"
Set-Location "${{github.workspace}}/ogre"
cmake -B "${{github.workspace}}/ogre-build" -S . -DDOXYGEN_EXECUTABLE="C:\Program Files\doxygen\bin\doxygen.exe" -DCMAKE_C_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/g++.exe" -DCMAKE_CXX_STANDARD=17 -DOGRE_BUILD_PLUGIN_ASSIMP=ON -DOGRE_BUILD_PLUGIN_PCZ=ON -DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D9=OFF -DOGRE_BUILD_RENDERSYSTEM_D3D11=OFF -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF -DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF -DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF -DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
Set-Location "${{github.workspace}}/ogre-build"
D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/mingw32-make.exe install -j8
build-windows:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
needs: [build-n-cache-assimp-windows, build-n-cache-ogre-windows]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache Assimp
id: cache-assimp-windows
uses: actions/cache@v3
env:
cache-name: cache-assimp-windows-mingw1310
with:
# It is caching the folder that also contains source and building files, maybe in the future it would be nice cache only the includes and dll
path: |
C:/PROGRA~2/Assimp
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Cache Ogre
id: cache-ogre-windows
uses: actions/cache@v3
env:
cache-name: cache-ogre-windows
with:
path: ${{github.workspace}}/ogre-build/SDK
# Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the ogre repo.
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ${{ env.AQT_VERSION }}
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
tools: 'tools_cmake tools_mingw1310'
- name: Add Qt MinGW to PATH
run: |
echo "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "Added Qt MinGW 13.1.0 to PATH"
where gcc.exe
gcc --version
shell: powershell
- name: Configure CMake
env:
OGRE_DIR: ${{github.workspace}}/ogre-build/SDK/CMake/
CMAKE_GENERATOR: "MinGW Makefiles"
ASSIMP_DIR: C:/PROGRA~2/Assimp
PATH: "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin;D:/a/QtMeshEditor/Qt/Tools/CMake_64/bin;${{ env.PATH }}"
run: |
Write-Host "Verifying compiler paths:"
Write-Host "gcc location: $((Get-Command gcc.exe).Source)"
Write-Host "g++ location: $((Get-Command g++.exe).Source)"
Write-Host "mingw32-make location: $((Get-Command mingw32-make.exe).Source)"
Write-Host "cmake location: $((Get-Command cmake.exe).Source)"
gcc --version
cmake --version
cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-g" -DCMAKE_C_FLAGS="-g" -DQT_QMAKE_EXECUTABLE=qmake -DCMAKE_C_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/g++.exe" -DCMAKE_EXE_LINKER_FLAGS=-static -DQt6_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQT_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6GuiTools -DOGRE_DIR=${{github.workspace}}/ogre-build/SDK/CMake/ -DASSIMP_DIR=C:/PROGRA~2/Assimp/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }}
shell: powershell
- name: Build
env:
PATH: "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin;D:/a/QtMeshEditor/Qt/Tools/CMake_64/bin;${{ env.PATH }}"
run: |
Write-Host "Using make from:"
Write-Host "mingw32-make location: $((Get-Command mingw32-make.exe).Source)"
mingw32-make --version
D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/mingw32-make.exe install -j8
shell: powershell
- name: Upload debug symbols to Sentry
if: github.event_name == 'release' && github.event.action == 'published'
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
run: |
cp "${{github.workspace}}/bin/QtMeshEditor.exe" "${{github.workspace}}/bin/QtMeshEditor.debug.exe"
"D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/strip.exe" --strip-debug "${{github.workspace}}/bin/QtMeshEditor.exe"
curl -sL https://sentry.io/get-cli/ | bash
/usr/local/bin/sentry-cli debug-files upload --include-sources "${{github.workspace}}/bin/QtMeshEditor.debug.exe"
rm -f "${{github.workspace}}/bin/QtMeshEditor.debug.exe"
shell: bash
- name: Copy assimp dll to the binary folder
run: |
Write-Host "Checking available DLL files:"
Get-ChildItem C:/PROGRA~2/Assimp/bin
if (Test-Path "C:/PROGRA~2/Assimp/bin/libassimp-6.dll") {
Copy-Item "C:/PROGRA~2/Assimp/bin/libassimp-6.dll" "${{github.workspace}}/bin"
} elseif (Test-Path "C:/PROGRA~2/Assimp/bin/libassimp.dll") {
Copy-Item "C:/PROGRA~2/Assimp/bin/libassimp.dll" "${{github.workspace}}/bin"
} else {
Write-Host "Looking for any assimp dll files:"
Copy-Item "C:/PROGRA~2/Assimp/bin/libassimp*.dll" "${{github.workspace}}/bin"
}
shell: powershell
- name: Copy gcc dll to the binary folder
run: |
Write-Host "Using Qt MinGW 13.1.0 DLLs"
$mingwBin = "D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin"
Write-Host "MinGW bin directory: $mingwBin"
Get-ChildItem "$mingwBin/*.dll" | Where-Object { $_.Name -match "(libgcc|libstdc|libwinpthread)" }
Copy-Item "$mingwBin/libgcc_s_seh-1.dll" "${{github.workspace}}/bin" -ErrorAction SilentlyContinue
Copy-Item "$mingwBin/libstdc++-6.dll" "${{github.workspace}}/bin" -ErrorAction SilentlyContinue
Copy-Item "$mingwBin/libwinpthread-1.dll" "${{github.workspace}}/bin" -ErrorAction SilentlyContinue
Copy-Item "${{github.workspace}}/src/dependencies/zlib1.dll" "${{github.workspace}}/bin/zlib1__.dll" -ErrorAction SilentlyContinue
Copy-Item "${{github.workspace}}/src/dependencies/zlib1.dll" "${{github.workspace}}/bin/libzlib.dll" -ErrorAction SilentlyContinue
shell: powershell
- name: Copy Qt QML modules for Inspector and Material Editor
run: |
$qtDir = "D:/a/QtMeshEditor/Qt/${{ env.QT_VERSION }}/mingw_64"
$qmlDest = "${{github.workspace}}/bin/qml"
New-Item -ItemType Directory -Force -Path $qmlDest | Out-Null
Copy-Item -Recurse "$qtDir/qml/QtQuick" "$qmlDest/" -ErrorAction SilentlyContinue
Copy-Item -Recurse "$qtDir/qml/QtQml" "$qmlDest/" -ErrorAction SilentlyContinue
Write-Host "QML modules copied to $qmlDest"
Get-ChildItem $qmlDest -Directory
# Verify critical modules were copied
if (-not (Test-Path "$qmlDest/QtQuick")) {
Write-Error "Critical: QtQuick module not found after copy"
exit 1
}
if (-not (Test-Path "$qmlDest/QtQml")) {
Write-Error "Critical: QtQml module not found after copy"
exit 1
}
shell: powershell
- name: Copy Qt QML runtime libraries
run: |
$qtDir = "D:/a/QtMeshEditor/Qt/${{ env.QT_VERSION }}/mingw_64"
$dest = "${{github.workspace}}/bin"
foreach ($lib in @("Qt6QuickControls2", "Qt6QuickControls2Impl", "Qt6QuickControls2Basic",
"Qt6QuickControls2BasicStyleImpl", "Qt6QuickTemplates2", "Qt6QuickLayouts",
"Qt6QuickDialogs2", "Qt6QuickDialogs2Utils", "Qt6QuickDialogs2QuickImpl",
"Qt6OpenGL")) {
$dll = "$qtDir/bin/${lib}.dll"
if (Test-Path $dll) {
Copy-Item $dll $dest
Write-Host "Copied $lib.dll"
}
}
shell: powershell
- name: Remove test-only dance models from package
run: |
Remove-Item "${{github.workspace}}/bin/media/models/Twist Dance.fbx" -ErrorAction SilentlyContinue
Remove-Item "${{github.workspace}}/bin/media/models/Rumba Dancing.fbx" -ErrorAction SilentlyContinue
Remove-Item "${{github.workspace}}/bin/media/models/Hip Hop Dancing.fbx" -ErrorAction SilentlyContinue
shell: powershell
- name: Smoke-test CLI (bin directory)
shell: powershell
run: |
$exe = "${{github.workspace}}\bin\qtmesh.exe"
Write-Host "Running: $exe --version"
$output = & $exe --version
$exitCode = $LASTEXITCODE
Write-Host "Output: $output"
Write-Host "Exit code: $exitCode"
if ($output -notmatch "qtmesh \d+\.\d+\.\d+") {
Write-Error "CLI smoke test FAILED: output '$output' does not match expected 'qtmesh X.Y.Z'"
exit 1
}
# Note: qtmesh.exe may exit with STATUS_DLL_NOT_FOUND (0xC0000135, -1073741515)
# during ExitProcess() DLL unload on Windows — a known MinGW DLL detach artifact
# when the exit happens before Ogre statics are initialised. This does not indicate
# a functional failure; the version string was produced correctly.
# Fail only on codes that mean a genuine crash (non-negative non-zero).
if ($exitCode -gt 0) {
Write-Error "CLI smoke test FAILED: exe exited with code $exitCode"
exit 1
}
Write-Host "CLI smoke test PASSED"
exit 0
- name: Upload Artifact
if: github.event_name == 'release' && github.event.action == 'published'
uses: actions/upload-artifact@v4
with:
name: QtMeshEditor-${{github.ref_name}}-bin-Windows
path: ${{github.workspace}}/bin
- name: Compress File
if: github.event_name == 'release' && github.event.action == 'published'
run: Compress-Archive ${{github.workspace}}/bin QtMeshEditor-${{github.ref_name}}-bin-Windows.zip
shell: powershell
- name: Smoke-test CLI from zip
if: github.event_name == 'release' && github.event.action == 'published'
shell: powershell
run: |
$zipFile = "QtMeshEditor-${{github.ref_name}}-bin-Windows.zip"
$testDir = "${{github.workspace}}\smoketest-zip"
New-Item -ItemType Directory -Force -Path $testDir | Out-Null
Expand-Archive -Path $zipFile -DestinationPath $testDir -Force
$version = "${{github.ref_name}}".TrimStart("v")
$exe = "$testDir\bin\qtmesh.exe"
Write-Host "Running: $exe --version"
$output = & $exe --version
$exitCode = $LASTEXITCODE
Write-Host "Output: $output"
Write-Host "Exit code: $exitCode"
if ($output -notmatch [regex]::Escape($version)) {
Write-Error "Zip smoke test FAILED: expected version '$version' in output '$output'"
exit 1
}
# STATUS_DLL_NOT_FOUND (0xC0000135, -1073741515) during DLL detach is a known MinGW artifact
if ($exitCode -gt 0) {
Write-Error "Zip smoke test FAILED: exe exited with code $exitCode"
exit 1
}
Write-Host "Zip smoke test PASSED"
exit 0
- name: Uploadfile to release
if: github.event_name == 'release' && github.event.action == 'published'
uses: xresloader/upload-to-github-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: QtMeshEditor-${{github.ref_name}}-bin-Windows.zip
update_latest_release: true
overwrite: false
verbose: true
####################################################################
# Linux Deploy
####################################################################
build-n-cache-assimp-linux:
needs: scan-assets-qtmesh
runs-on: ubuntu-latest
steps:
- name: change folder permissions
run: |
sudo chmod 777 /usr/local/lib
sudo chmod 777 /usr/local/include
- name: Cache Assimp
id: cache-assimp-linux
uses: actions/cache@v3
env:
cache-name: cache-assimp-linux
with:
# Assimp cache files are stored in `/home/runner/work/QtMeshEditor/QtMeshEditor/assimp` on Linux
path: |
/usr/local/lib/cmake/
/usr/local/include/assimp
/usr/local/include/contrib
/usr/local/lib/pkgconfig/assimp.pc
/usr/local/lib/libassimp*
/usr/local/lib/libzlibstatic.a
#key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }}
# Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo.
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: steps.cache-assimp-linux.outputs.cache-hit != 'true'
name: Check out Assimp repo
uses: actions/checkout@master
with:
repository: assimp/assimp
ref: v${{ env.ASSIMP_VERSION }}
path: /home/runner/work/QtMeshEditor/QtMeshEditor/assimp
- if: steps.cache-assimp-linux.outputs.cache-hit != 'true'
name: Build Assimp repo
run: |
cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build -S /home/runner/work/QtMeshEditor/QtMeshEditor/assimp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cd /home/runner/work/QtMeshEditor/QtMeshEditor/assimp-build/
sudo make install -j8
build-n-cache-ogre-linux:
needs: build-n-cache-assimp-linux
runs-on: ubuntu-latest
steps:
- name: change folder permissions
run: |
sudo chmod 777 /usr/local/lib
sudo chmod 777 /usr/local/include
sudo chmod 777 /usr/local/share
- name: Cache Ogre
id: cache-ogre-linux
uses: actions/cache@v3
env:
cache-name: cache-ogre-linux
with:
path: |
/usr/local/lib/lib*
/usr/local/share/OGRE/
/usr/local/share/OGRE*
/usr/local/include/OGRE/
/usr/local/lib/OGRE/
/usr/local/lib/pkgconfig/
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: steps.cache-ogre-linux.outputs.cache-hit != 'true'
name: Cache Assimp
id: cache-assimp-linux
uses: actions/cache@v3
env:
cache-name: cache-assimp-linux
with:
# Assimp cache files are stored in `/home/runner/work/QtMeshEditor/assimp` on Linux/macOS
path: |
/usr/local/lib/cmake/
/usr/local/include/assimp
/usr/local/include/contrib
/usr/local/lib/pkgconfig/assimp.pc
/usr/local/lib/libassimp*
/usr/local/lib/libzlibstatic.a
#key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/QtMeshEditor/QtMeshEditor/assimp') }}
# Need to delete manually if needed to rebuild. Until I find a better solution for detecting changes in the assimp repo.
key: ${{ runner.os }}-build-${{ env.cache-name }}
- if: steps.cache-ogre-linux.outputs.cache-hit != 'true'
name: install openGL
run: |
sudo apt update
sudo apt-get install freeglut3-dev libxrandr-dev
- if: steps.cache-ogre-linux.outputs.cache-hit != 'true'
name: Check out ogre repo
uses: actions/checkout@master
with:
repository: OGRECave/ogre
ref: v${{ env.OGRE_VERSION }}
path: /home/runner/work/QtMeshEditor/QtMeshEditor/ogre
- if: steps.cache-ogre-linux.outputs.cache-hit != 'true'
name: Build Ogre3D repo
run: |
sudo cmake -B /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build \
-S /home/runner/work/QtMeshEditor/QtMeshEditor/ogre \
-DOGRE_BUILD_PLUGIN_ASSIMP=ON -Dassimp_DIR=/usr/local/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }} \
-DOGRE_BUILD_PLUGIN_DOT_SCENE=ON -DOGRE_BUILD_RENDERSYSTEM_GL=ON \
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON -DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF \
-DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_TOOLS=OFF -DOGRE_BUILD_SAMPLES=OFF \
-DOGRE_BUILD_COMPONENT_CSHARP=OFF -DOGRE_BUILD_COMPONENT_JAVA=OFF \
-DOGRE_BUILD_COMPONENT_BULLET=OFF \
-DOGRE_BUILD_COMPONENT_PYTHON=OFF -DOGRE_INSTALL_TOOLS=OFF \
-DOGRE_INSTALL_DOCS=OFF -DOGRE_INSTALL_SAMPLES=OFF \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cd /home/runner/work/QtMeshEditor/QtMeshEditor/ogre-build/
sudo make install -j8
build-linux:
needs: [build-n-cache-assimp-linux, build-n-cache-ogre-linux]
runs-on: ubuntu-latest
env:
LD_LIBRARY_PATH: /usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/
steps:
- uses: actions/checkout@v3.5.3
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ${{ env.AQT_VERSION }}
version: ${{ env.QT_VERSION }}
host: 'linux'
target: 'desktop'
arch: 'linux_gcc_64'
- name: change folder permissions
run: |
sudo chmod 777 /usr/local/lib
sudo chmod 777 /usr/local/include
sudo chmod 777 /usr/local/share
- name: Cache Assimp
id: cache-assimp-linux
uses: actions/cache@v3
env:
cache-name: cache-assimp-linux
with:
path: |
/usr/local/lib/cmake/
/usr/local/include/assimp
/usr/local/include/contrib
/usr/local/lib/pkgconfig/assimp.pc
/usr/local/lib/libassimp*
/usr/local/lib/libzlibstatic.a
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache Ogre
id: cache-ogre-linux
uses: actions/cache@v3
env:
cache-name: cache-ogre-linux
with:
path: |
/usr/local/lib/lib*
/usr/local/share/OGRE/
/usr/local/share/OGRE*
/usr/local/include/OGRE/
/usr/local/lib/OGRE/
/usr/local/lib/pkgconfig/
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Sentry dependencies
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Configure CMake
run: |
sudo cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_CXX_FLAGS="-g" -DCMAKE_C_FLAGS="-g" \
-DENABLE_STABLE_DIFFUSION=ON \
-DASSIMP_DIR=/usr/local/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }} \
-DASSIMP_INCLUDE_DIR=/usr/local/include/assimp \
-DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6 \
-DQT_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6 \
-DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6GuiTools
- name: Build
run: sudo make install -j8
- name: Upload debug symbols to Sentry
if: github.event_name == 'release' && github.event.action == 'published'
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
run: |
# Extract debug symbols, strip binary, upload to Sentry
sudo objcopy --only-keep-debug ./bin/QtMeshEditor ./bin/QtMeshEditor.debug
sudo strip --strip-debug --strip-unneeded ./bin/QtMeshEditor
sudo objcopy --add-gnu-debuglink=./bin/QtMeshEditor.debug ./bin/QtMeshEditor
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli debug-files upload --include-sources ./bin/QtMeshEditor.debug
sudo rm -f ./bin/QtMeshEditor.debug
- name: Add missing libraries
run: |
# Create the bin directory since cmake builds to build/bin but we need ./bin for the tests
mkdir -p ./bin
mkdir -p ./build/bin
# Copy Qt ICU libraries to both locations
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicui18n.* ./bin
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicuuc.* ./bin
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicudata.* ./bin
# Also copy to build/bin where cmake actually puts the executables
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicui18n.* ./build/bin/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicuuc.* ./build/bin/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicudata.* ./build/bin/ || true
# Copy libraries to system locations
sudo cp -R ./bin/*.so* /lib/x86_64-linux-gnu || true
sudo cp -R /usr/local/lib/OGRE/* /lib/x86_64-linux-gnu || true
sudo cp -R /usr/local/lib/OGRE/* ./bin || true
sudo cp -R /usr/local/lib/OGRE/* ./build/bin/ || true
- name: Manual Pack
run: |
echo "Creating folders 'n files"
mkdir -p ./pack-deb/usr/bin
mkdir -p ./pack-deb/usr/share/qtmesheditor/
mkdir -p ./pack-deb/usr/share/qtmesheditor/cfg/
mkdir -p ./pack-deb/usr/share/qtmesheditor/media/
mkdir -p ./pack-deb/usr/share/qtmesheditor/platforms/
mkdir -p ./pack-deb/usr/lib/qtmesheditor/
mkdir -p ./pack-deb/usr/share/doc/qtmesheditor/
mkdir ./pack-deb/DEBIAN/
cp ./bin/DEBIAN-control ./pack-deb/DEBIAN/control
cp ./bin/QtMeshEditor ./pack-deb/usr/share/qtmesheditor/qtmesheditor
# Create proper launcher script
printf '#!/bin/sh\nexport LD_LIBRARY_PATH="/usr/lib/qtmesheditor:${LD_LIBRARY_PATH}"\nexport QML2_IMPORT_PATH="/usr/share/qtmesheditor/qml:${QML2_IMPORT_PATH}"\n# Ogre requires X11 window handles; force XCB under Wayland\nexport QT_QPA_PLATFORM="${QT_QPA_PLATFORM:-xcb}"\nexec /usr/share/qtmesheditor/qtmesheditor "$@"\n' > ./pack-deb/usr/bin/qtmesheditor
chmod 755 ./pack-deb/usr/bin/qtmesheditor
# Create qtmesh symlink for CLI mode (name starts with "qtmesh" but not "qtmesheditor")
ln -sf qtmesheditor ./pack-deb/usr/bin/qtmesh
# Copy copyright file
cp ./DEBIAN-copyright ./pack-deb/usr/share/doc/qtmesheditor/copyright
cp -R ./bin/cfg/ ./pack-deb/usr/share/qtmesheditor/
# Fix OGRE plugin path: CI build hardcodes /usr/local/lib/OGRE but
# the .deb bundles plugins in /usr/lib/qtmesheditor/
sed -i 's|^PluginFolder=.*|PluginFolder=/usr/lib/qtmesheditor|' ./pack-deb/usr/share/qtmesheditor/cfg/plugins.cfg
sudo chmod -R 755 ./pack-deb/usr/share/qtmesheditor/cfg
cp -R ./bin/media/ ./pack-deb/usr/share/qtmesheditor/
# Remove large dance model files used only for testing
rm -f ./pack-deb/usr/share/qtmesheditor/media/models/"Twist Dance.fbx"
rm -f ./pack-deb/usr/share/qtmesheditor/media/models/"Rumba Dancing.fbx"
rm -f ./pack-deb/usr/share/qtmesheditor/media/models/"Hip Hop Dancing.fbx"
cp -R ./bin/platforms/ ./pack-deb/usr/share/qtmesheditor/
if [ -d ./bin/tls ]; then
cp -R ./bin/tls/ ./pack-deb/usr/share/qtmesheditor/tls/
fi
# Copy bundled libraries to private lib directory
cp -R ./bin/*.so* ./pack-deb/usr/lib/qtmesheditor/
# Bundle Assimp (built from source at /usr/local/lib, not in ./bin/)
cp -R /usr/local/lib/libassimp.so* ./pack-deb/usr/lib/qtmesheditor/
# Bundle Ogre component libs from /usr/local/lib/ that are not in the
# OGRE plugin dir (e.g. libOgreMeshLodGenerator, libOgreOverlay, etc.)
cp /usr/local/lib/libOgre*.so* ./pack-deb/usr/lib/qtmesheditor/ 2>/dev/null || true
# Copy Qt QML modules for Material Editor
QT_DIR="/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64"
mkdir -p ./pack-deb/usr/share/qtmesheditor/qml
cp -R "$QT_DIR/qml/QtQuick" ./pack-deb/usr/share/qtmesheditor/qml/
cp -R "$QT_DIR/qml/QtQml" ./pack-deb/usr/share/qtmesheditor/qml/
# Copy Qt QML runtime libraries
for lib in QuickControls2 QuickControls2Impl QuickControls2Basic QuickControls2BasicStyleImpl \
QuickDialogs2 QuickDialogs2Utils QuickDialogs2QuickImpl \
QuickTemplates2 QuickLayouts Quick QmlModels QmlMeta QmlWorkerScript Qml QmlCore \
OpenGL; do
cp -R "$QT_DIR/lib/libQt6${lib}.so"* ./pack-deb/usr/lib/qtmesheditor/ 2>/dev/null || true
done
dpkg-deb --build --root-owner-group pack-deb
mv pack-deb.deb qtmesheditor_amd64.deb
- uses: actions/upload-artifact@v4
if: github.event_name == 'release' && github.event.action == 'published'
with:
name: linux-binaries
path: ${{github.workspace}}/*.deb
- if: github.event_name == 'release' && github.event.action == 'published'
uses: xresloader/upload-to-github-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{github.workspace}}/*.deb
update_latest_release: true
overwrite: false
verbose: true
####################################################################
# Unit Tests - on Linux
####################################################################
unit-tests-linux:
# Skip unit tests on release — they already ran on the PR and master push
if: github.event_name != 'release'
needs: [build-n-cache-assimp-linux, build-n-cache-ogre-linux]
runs-on: ubuntu-latest
permissions: read-all
env:
LD_LIBRARY_PATH: gcc_64/lib/:/usr/local/lib/:/usr/local/lib/OGRE/:/usr/local/lib/pkgconfig/:/lib/x86_64-linux-gnu/
QT_QPA_PLATFORM: xcb
QT_DEBUG_PLUGINS: 0
DISPLAY: :99
steps:
- uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Fix broken apt repositories
run: |
# Remove Microsoft repos that frequently return 403/signature errors on GitHub runners
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list || true
sudo apt-get update || true
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ${{ env.AQT_VERSION }}
version: ${{ env.QT_VERSION }}
host: 'linux'
target: 'desktop'
arch: 'linux_gcc_64'
- name: change folder permissions
run: |
sudo chmod 777 /usr/local/lib
sudo chmod 777 /usr/local/include
sudo chmod 777 /usr/local/share
- name: Cache Assimp
id: cache-assimp-linux
uses: actions/cache@v3
env:
cache-name: cache-assimp-linux
with:
path: |
/usr/local/lib/cmake/
/usr/local/include/assimp
/usr/local/include/contrib
/usr/local/lib/pkgconfig/assimp.pc
/usr/local/lib/libassimp*
/usr/local/lib/libzlibstatic.a
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache Ogre
id: cache-ogre-linux
uses: actions/cache@v3
env:
cache-name: cache-ogre-linux
with:
path: |
/usr/local/lib/lib*
/usr/local/share/OGRE/
/usr/local/share/OGRE*
/usr/local/include/OGRE/
/usr/local/lib/OGRE/
/usr/local/lib/pkgconfig/
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4
env:
SONAR_HOST_URL: https://sonarcloud.io
- name: Install sonar-scanner
run: |
npm install -g sonar-scanner
- name: Setup ccache
# Cache compiler outputs across CI runs so the test build (the
# slowest step in this job, dominated by ~500 .cpp compiles)
# gets near-instant replays for files that haven't changed.
# The cache survives across PRs via the shared key prefix.
uses: hendrikmuhs/ccache-action@v1.2
with:
key: sonar-tests-${{ runner.os }}
max-size: 2G
# ccache wraps gcc/g++ so build-wrapper still sees every
# invocation it needs to record for SonarCloud.
create-symlink: true
- name: Setup headless environment for Qt tests
run: |
sudo apt-get update
sudo apt-get install -y libxcb-cursor0 libxcb-xinerama0 libx11-dev xvfb \
mesa-utils libgl1-mesa-dri libegl-mesa0 libgbm1 libglx-mesa0
# Start Xvfb with GLX support for Ogre GL initialization
Xvfb :99 -screen 0 1024x768x24 +extension GLX > /dev/null 2>&1 &
sleep 3
echo "DISPLAY=:99" >> $GITHUB_ENV
echo "QT_QPA_PLATFORM=xcb" >> $GITHUB_ENV
# Force Mesa software rendering (llvmpipe) - avoids DRI3 hardware errors in CI
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
echo "MESA_GL_VERSION_OVERRIDE=3.3" >> $GITHUB_ENV
- name: Configure CMake for Tests
env:
# ccache + coverage flags interact awkwardly: the default
# hash includes the absolute build directory and source mtimes,
# which guarantees a cache miss on every CI run since the runner
# is ephemeral. Loosening these makes the cache effective without
# affecting correctness — gcov still emits .gcda at runtime, so
# coverage data is regenerated per test run regardless.
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
CCACHE_NOHASHDIR: "true"
run: |
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DASSIMP_DIR=/usr/local/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }} \
-DASSIMP_INCLUDE_DIR=/usr/local/include/assimp \
-DQt6_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6 \
-DQT_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6 \
-DQt6GuiTools_DIR=/home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt6GuiTools \
-DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="--coverage -fprofile-arcs -ftest-coverage -O0 -DCOVERAGE_BUILD" \
-DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage -O0 -DCOVERAGE_BUILD" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DBUILD_QT_MESH_EDITOR=OFF \
-DENABLE_SENTRY=OFF \
-DENABLE_PS1_RIP=ON
- name: Run build-wrapper
env:
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
CCACHE_NOHASHDIR: "true"
run: |
echo "=== Running build-wrapper for SonarCloud analysis ==="
# NB: no `make clean` — ccache handles correctness via its hash,
# and incremental builds let unchanged TUs replay as cached hits.
# build-wrapper still records every compile invocation it sees
# (ccache wraps the compiler, so build-wrapper's intercept is
# transparent to the cache layer).
# Run build-wrapper to capture compilation into a named directory
build-wrapper-linux-x86-64 --out-dir build-wrapper-output make -C build -j$(nproc)
echo "=== ccache statistics ==="
ccache -s || true
echo "=== Build wrapper completed ==="
ls -la build-wrapper-output/ || echo "Build wrapper output directory not created"
ls -la build-wrapper-output/build-wrapper-dump.json 2>/dev/null || echo "build-wrapper-dump.json not found"
- name: Add missing libraries
run: |
# Debug build puts executables in build/debug/, Release in build/bin/
mkdir -p ./bin
mkdir -p ./build/bin
mkdir -p ./build/debug
# Copy Qt ICU libraries
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicui18n.* ./bin
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicuuc.* ./bin
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicudata.* ./bin
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicui18n.* ./build/debug/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicuuc.* ./build/debug/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicudata.* ./build/debug/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicui18n.* ./build/bin/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicuuc.* ./build/bin/ || true
sudo cp -R /home/runner/work/QtMeshEditor/Qt/${{ env.QT_VERSION }}/gcc_64/lib/libicudata.* ./build/bin/ || true
# Copy libraries to system locations
sudo cp -R ./bin/*.so* /lib/x86_64-linux-gnu || true
sudo cp -R /usr/local/lib/OGRE/* /lib/x86_64-linux-gnu || true
sudo cp -R /usr/local/lib/OGRE/* ./bin || true
sudo cp -R /usr/local/lib/OGRE/* ./build/bin/ || true
sudo cp -R /usr/local/lib/OGRE/* ./build/debug/ || true