-
-
Notifications
You must be signed in to change notification settings - Fork 1
702 lines (585 loc) · 24.1 KB
/
cmake_build.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
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
name: CMake Build
on:
pull_request:
push:
branches:
- master
- stable
paths-ignore:
- "docs/**"
- '**/*.md'
workflow_dispatch:
env:
BUILD_TYPE: Release
INSTALLBUILDER_VERSION: 23.4.0
jobs:
buildLinux:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip linux ci')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, bits: 64 },
]
name: Linux Build (${{ matrix.bits }} bit / ${{ matrix.arch }})
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Workspace
run: ./setup_workspace.sh
- if: "contains(github.event.head_commit.message, 'codeql')"
name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: cpp
- name: Create Build Directory
run: mkdir -p ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.bits }}
- name: install ccache
run: sudo apt install ccache
- name: Get timestamp
run: echo "timestamp=$(date --iso-8601=seconds)" >> "$GITHUB_OUTPUT"
id: get_timestamp
- name: Setup cache
uses: actions/cache@v3
with:
path: ${{runner.workspace}}/.ccache
key: ccache-${{ runner.os }}-${{ matrix.arch }}-${{ steps.get_timestamp.outputs.timestamp }}
restore-keys: |
ccache-${{ runner.os }}-${{ matrix.arch }}-
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.bits }}
run: |
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_LIBRARY_PATH=/usr/lib/${{ matrix.arch }}-linux-gnu \
-G Ninja
env:
CC: gcc-12
CXX: g++-12
CFLAGS: -m${{ matrix.bits }}
LDFLAGS: -m${{ matrix.bits }}
CXXFLAGS: -m${{ matrix.bits }}
CCACHE_BASEDIR: ${{runner.workspace}}
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- name: Build
working-directory: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.bits }}
shell: bash
run: |
ccache -z # zero statistics
cmake --build . --target BrickSim BrickSimTests --config $BUILD_TYPE -j $(nproc --all)
ccache -s # print statistics
env:
CCACHE_BASEDIR: ${{runner.workspace}}
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- if: "contains(github.event.head_commit.message, 'codeql')"
name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
config-file: ./.github/codeql/codeql-config.yml
- name: list all binaries in runner workspace
run: find ${{runner.workspace}} -type f -executable
- name: BrickSimRawBinary
uses: actions/upload-artifact@v3
with:
name: BrickSimRawBinary_Linux${{ matrix.bits }}
path: |
${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.bits }}/BrickSim
- name: Upload BrickSimTests
uses: actions/upload-artifact@v3
with:
name: BrickSimTests_Linux${{ matrix.bits }}
path: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.bits }}/BrickSimTests
testLinux:
name: Linux Tests (${{ matrix.bits }} bit / ${{ matrix.arch }})
needs: buildLinux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, bits: 64 },
]
steps:
- name: Download test artifact
uses: actions/download-artifact@v3
with:
name: BrickSimTests_Linux64
- name: Make tests executable
run: chmod a+x ${{runner.workspace}}/BrickSim/BrickSimTests
- name: ldd the executable
if: always()
run: ldd ${{runner.workspace}}/BrickSim/BrickSimTests
- name: Run tests with JUnit XML output
run: ${{runner.workspace}}/BrickSim/BrickSimTests -r junit > ${{runner.workspace}}/junitTestReport_Linux64.xml
- name: Run tests with Catch2 XML output
if: always()
run: ${{runner.workspace}}/BrickSim/BrickSimTests -d yes -r xml > ${{runner.workspace}}/catchTestReport_Linux64.xml
- name: Print report to log
run: cat ${{runner.workspace}}/catchTestReport_Linux64.xml
if: always()
- name: Run tests with Console output
if: failure()
run: ${{runner.workspace}}/BrickSim/BrickSimTests -d yes >> $GITHUB_STEP_SUMMARY
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: UnitTestReport_Linux64
path: ${{runner.workspace}}/*TestReport*.xml
buildInstallerLinux:
needs: buildLinux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, bits: 64 },
]
name: Linux Installer (${{ matrix.bits }} bit / ${{ matrix.arch }})
steps:
- name: Setup cache of InstallBuilder installer
id: installbuilder-installer-cache
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/installbuilder_installer.run
key: installbuilder-${{ env.INSTALLBUILDER_VERSION }}-linux-x64-installer
- name: Download InstallBuilder installer on cache miss
if: steps.installbuilder-installer-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.workspace }}
#WARNING: if you change the version here, also change it in the cache key
run: |
wget https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-linux-x64-installer.run -O installbuilder_installer.run
- name: Install InstallBuilder
working-directory: ${{ runner.workspace }}
run: |
chmod a+x installbuilder_installer.run
./installbuilder_installer.run --mode unattended --prefix ${{ runner.workspace }}/installbuilder
- uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: BrickSimRawBinary_Linux${{ matrix.bits }}
path: ${{ runner.workspace }}/artifacts
- name: Create build directory and copy raw binary to it
run: |
mkdir -p $GITHUB_WORKSPACE/cmake-build/release${{ matrix.bits }}
cp ${{ runner.workspace }}/artifacts/BrickSim $GITHUB_WORKSPACE/cmake-build/release${{ matrix.bits }}
chmod a+x $GITHUB_WORKSPACE/cmake-build/release${{ matrix.bits }}/BrickSim
- name: Save license to file
run: |
echo "${{ secrets.INSTALLBUILDER_LICENSE_XML_BASE64 }}" | base64 --decode > ${{ runner.workspace }}/license.xml
- name: Build Installer
run: |
${{ runner.workspace }}/installbuilder/bin/builder build $GITHUB_WORKSPACE/InstallBuilder.xml linux-x64 \
--setvars project.version=$($GITHUB_WORKSPACE/scripts/get_git_tag.sh | tr -d v) \
--license ${{ runner.workspace }}/license.xml
- name: Delete license file
run: rm ${{ runner.workspace }}/license.xml
- name: Upload BrickSimInstaller
uses: actions/upload-artifact@v3
with:
name: BrickSimInstaller_Linux${{ matrix.bits }}
path: ${{runner.workspace}}/installbuilder/output/*.run
buildWindows:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip windows ci')"
runs-on: windows-2022
name: Windows Build (64 bit / x86_64)
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Workspace
shell: powershell
working-directory: ${{runner.workspace}}\BrickSim
run: .\setup_workspace.ps1
- name: Get git info
shell: bash
id: git_info
run: |
echo "commit_hash=$(./scripts/get_git_commit_hash.sh)" >> "$GITHUB_OUTPUT"
echo "commit_count=$(./scripts/get_git_commit_count.sh)" >> "$GITHUB_OUTPUT"
echo "total_hours=$(./scripts/get_git_total_hours.sh)" >> "$GITHUB_OUTPUT"
echo "version_tag=$(./scripts/get_git_tag.sh)" >> "$GITHUB_OUTPUT"
- name: Configure and Build
shell: cmd
working-directory: ${{runner.workspace}}\BrickSim
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
md cmake-build
cd cmake-build
md release64
cd release64
cmake -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake" ^
-DGIT_COMMIT_HASH:STRING=${{ steps.git_info.outputs.commit_hash }} ^
-DGIT_COMMIT_COUNT:STRING=${{ steps.git_info.outputs.commit_count }} ^
-DTOTAL_HOURS:STRING=${{ steps.git_info.outputs.total_hours }} ^
-DGIT_VERSION_TAG:STRING=${{ steps.git_info.outputs.version_tag }} ^
-G "Ninja" ^
..\..
cmake --build . --target BrickSim BrickSimTests --config Release -j 2
- name: Upload BrickSimRawBinary
uses: actions/upload-artifact@v3
with:
name: BrickSimRawBinary_Windows64
path: |
${{runner.workspace}}\BrickSim\cmake-build\release64\BrickSim.exe
${{runner.workspace}}\BrickSim\cmake-build\release64\zlib1.dll
- name: Upload BrickSimTests
uses: actions/upload-artifact@v3
with:
name: BrickSimTests_Windows64
path: ${{runner.workspace}}\BrickSim\cmake-build\release64\BrickSimTests.exe
buildInstallerWindows:
needs: buildWindows
runs-on: windows-latest
name: Windows Installer (64 bit / x86_64)
steps:
- name: Setup cache of InstallBuilder installer
id: installbuilder-installer-cache
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/installbuilder_installer.exe
key: installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-windows-x64-installer
- name: Download InstallBuilder installer on cache miss
if: steps.installbuilder-installer-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.workspace }}
shell: powershell
#WARNING: if you change the version here, also change it in the cache key
run: Invoke-WebRequest -Uri https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-windows-x64-installer.exe -OutFile installbuilder_installer.exe
- name: Install InstallBuilder
working-directory: ${{ runner.workspace }}
shell: powershell
run: |
Start-Process -FilePath installbuilder_installer.exe -ArgumentList "--mode unattended --prefix ${{ runner.workspace }}\installbuilder"
- uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: BrickSimRawBinary_Windows64
path: ${{ runner.workspace }}/artifacts
- name: Create build directory and copy raw binary to it
shell: powershell
run: |
New-Item "${{ runner.workspace }}/BrickSim/cmake-build/release64" -ItemType Directory
Copy-Item "${{ runner.workspace }}/artifacts/BrickSim.exe" -Destination "${{ runner.workspace }}/BrickSim/cmake-build/release64"
- name: Save license to file
shell: powershell
run: |
[Text.Encoding]::Utf8.GetString([Convert]::FromBase64String("${{ secrets.INSTALLBUILDER_LICENSE_XML_BASE64 }}")) | Out-File -FilePath "${{ runner.workspace }}/license.xml"
- name: Build Installer
shell: powershell
run: |
$VERSION = git describe --tags --match v[0-9]*
$VERSION = $VERSION.Substring(1,$VERSION.IndexOf('-'))
New-Item -ItemType directory -Path "${{runner.workspace}}\installbuilder\output"
Start-Process -FilePath "${{ runner.workspace }}\installbuilder\bin\builder-cli.exe" `
-Wait `
-NoNewWindow `
-ArgumentList "build ${{ runner.workspace }}\BrickSim\InstallBuilder.xml windows-x64 --setvars project.version=$VERSION project.outputDirectory=${{runner.workspace}}\installbuilder\output --license ${{ runner.workspace }}\license.xml"
- name: Delete license file
shell: powershell
run: |
Remove-Item -Path "${{ runner.workspace }}/license.xml"
- name: Upload BrickSimInstaller
uses: actions/upload-artifact@v3
with:
name: BrickSimInstaller_Windows64
path: ${{runner.workspace}}\installbuilder\output\*.exe
testWindows:
runs-on: windows-latest
needs: buildWindows
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, bits: 64 },
#{ arch: i686, bits: 32 }
]
name: Windows Tests (64 bit / x86_64)
steps:
- name: Download test artifact
uses: actions/download-artifact@v3
with:
name: BrickSimTests_Windows64
- name: Get info about the .exe
shell: powershell
run: |
Get-Command "${{runner.workspace}}\BrickSim\BrickSimTests.exe" | Format-List
- name: Run tests with JUnit XML output
shell: powershell
run: |
Start-Process -FilePath "${{runner.workspace}}\BrickSim\BrickSimTests.exe" `
-ArgumentList "-r junit" `
-Wait `
-NoNewWindow `
-RedirectStandardOutput "${{runner.workspace}}\junitTestReport_Windows64.xml"
- name: Run tests with Catch2 XML output
shell: powershell
run: |
Start-Process -FilePath "${{runner.workspace}}\BrickSim\BrickSimTests.exe" `
-ArgumentList "-d yes -r xml" `
-Wait `
-NoNewWindow `
-RedirectStandardOutput "${{runner.workspace}}\catchTestReport_Windows64.xml"
- name: Print report to log
if: always()
shell: powershell
run: |
Get-Content "${{runner.workspace}}\catchTestReport_Windows64.xml"
- name: Run tests with Console output
if: always()
shell: powershell
run: |
Start-Process -FilePath "${{runner.workspace}}\BrickSim\BrickSimTests.exe" `
-ArgumentList "-d yes" `
-Wait `
-NoNewWindow
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: UnitTestReport_Windows64
path: ${{runner.workspace}}/*TestReport*.xml
buildMac:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip mac ci')"
runs-on: macos-latest
name: MacOS Build (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, name: 64 },
{ arch: arm64, name: ARM }
]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Workspace
run: ./setup_workspace.sh
- name: Create Build Environment
run: mkdir -p $GITHUB_WORKSPACE/cmake-build/release${{ matrix.name }}
- name: Install ccache
run: brew install ccache
- name: Get timestamp
id: get_timestamp
run: echo "timestamp=$(date --iso-8601=seconds)" >> "$GITHUB_OUTPUT"
- name: Setup Cache
uses: actions/cache@v3
with:
path: ${{runner.workspace}}/.ccache
key: ccache-${{ runner.os }}-${{ matrix.arch }}-${{ steps.get_timestamp.outputs.timestamp }}
restore-keys: |
ccache-${{ runner.os }}-${{ matrix.arch }}-
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.name }}
run: |
cmake $GITHUB_WORKSPACE \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}" \
-G Ninja
env:
CC: clang
CXX: clang++
CCACHE_BASEDIR: ${{runner.workspace}}
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- name: Build
working-directory: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.name }}
shell: bash
run: |
ccache -z # zero statistics
cmake --build . --target BrickSim BrickSimTests --config $BUILD_TYPE -j $(sysctl -n hw.logicalcpu)
ccache -s # print statistics
env:
CCACHE_BASEDIR: ${{runner.workspace}}
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- name: Upload Application Binary
uses: actions/upload-artifact@v3
with:
name: BrickSimRawBinary_Mac${{ matrix.name }}
path: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.name }}/BrickSim
- name: Upload Tests Binary
uses: actions/upload-artifact@v3
with:
name: BrickSimTests_Mac${{ matrix.name }}
path: ${{runner.workspace}}/BrickSim/cmake-build/release${{ matrix.name }}/BrickSimTests
buildInstallerMac:
needs: buildMac
runs-on: macos-latest
name: MacOS Installer (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, name: 64 },
{ arch: arm64, name: ARM }
]
steps:
- name: Setup cache of InstallBuilder installer
id: installbuilder-installer-cache
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/installbuilder_installer.dmg
key: installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-osx-installer
- name: Download InstallBuilder installer on cache miss
if: steps.installbuilder-installer-cache.outputs.cache-hit != 'true'
working-directory: ${{ runner.workspace }}
#WARNING: if you change the version here, also change it in the cache key
run: |
brew install wget
wget -nv https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-osx-installer.dmg -O installbuilder_installer.dmg
- name: Install InstallBuilder
working-directory: ${{ runner.workspace }}
run: |
hdiutil attach -noverify installbuilder_installer.dmg
ls -l -R "/Volumes/InstallBuilder Enterprise"
/Volumes/InstallBuilder\ Enterprise/installbuilder-enterprise-${{ env.INSTALLBUILDER_VERSION }}-osx-installer.app/Contents/MacOS/installbuilder.sh \
--mode unattended --prefix ${{ runner.workspace }}/installbuilder
#sudo hdiutil detach "/Volumes/InstallBuilder Enterprise"
#todo find out why the previous line causes error "hdiutil: couldn't unmount "disk2" - Resource busy"
- uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: BrickSimRawBinary_Mac${{ matrix.name }}
path: ${{ runner.workspace }}/artifacts
- name: Create build directory and copy raw binary to it
run: |
mkdir -p $GITHUB_WORKSPACE/cmake-build/release${{ matrix.name }}
cp ${{ runner.workspace }}/artifacts/BrickSim $GITHUB_WORKSPACE/cmake-build/release${{ matrix.name }}
chmod a+x $GITHUB_WORKSPACE/cmake-build/release${{ matrix.name }}/BrickSim
- name: Save license to file
run: echo "${{ secrets.INSTALLBUILDER_LICENSE_XML_BASE64 }}" | base64 --decode > ${{ runner.workspace }}/license.xml
- name: Build Installer
run: |
${{ runner.workspace }}/installbuilder/bin/builder build $GITHUB_WORKSPACE/InstallBuilder.xml osx \
--setvars project.version=$($GITHUB_WORKSPACE/scripts/get_git_tag.sh | tr -d v) \
--license ${{ runner.workspace }}/license.xml
- name: Delete license file
run: rm ${{ runner.workspace }}/license.xml
- name: Upload BrickSimInstaller
uses: actions/upload-artifact@v3
with:
name: BrickSimInstaller_Mac${{ matrix.name }}
path: ${{runner.workspace}}/installbuilder/output/*.dmg
testMac:
needs: buildMac
runs-on: macos-latest
name: MacOS Tests (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include: [
{ arch: x86_64, name: 64 },
# todo re-enable ARM when there is a GitHub-hosted runner for M1 (https://github.com/github/roadmap/issues/528)
# { arch: arm64, name: ARM }
]
steps:
- uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0
- name: Setup Workspace
run: ./setup_workspace.sh
- name: Download test artifact
uses: actions/download-artifact@v3
with:
name: BrickSimTests_Mac${{ matrix.name }}
- name: Make tests executable
run: chmod a+x ${{runner.workspace}}/BrickSim/BrickSimTests
- name: Run tests with JUnit XML output
run: ${{runner.workspace}}/BrickSim/BrickSimTests -r junit > ${{runner.workspace}}/junitTestReport_Mac${{ matrix.name }}.xml
- name: Run tests with Catch2 XML output
if: always()
run: ${{runner.workspace}}/BrickSim/BrickSimTests -d yes -r xml > ${{runner.workspace}}/catchTestReport_Mac${{ matrix.name }}.xml
- name: Print report to log
run: cat ${{runner.workspace}}/catchTestReport_Mac${{ matrix.name }}.xml
if: always()
- name: Run tests with Console output
if: failure()
run: ${{runner.workspace}}/BrickSim/BrickSimTests -d yes >> $GITHUB_STEP_SUMMARY
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: UnitTestReport_Mac${{ matrix.name }}
path: ${{runner.workspace}}/*TestReport*.xml
publishTestResults:
name: Publish Catch2 Test Results
needs:
- testLinux
- testWindows
- testMac
runs-on: ubuntu-latest
if: success() || failure()
steps:
- if: needs.testLinux.result == 'success'
name: Download UnitTestReport_Linux64
uses: actions/download-artifact@v3
with:
name: UnitTestReport_Linux64
path: artifacts
- if: needs.testWindows.result == 'success'
name: Download UnitTestReport_Windows64
uses: actions/download-artifact@v3
with:
name: UnitTestReport_Windows64
path: artifacts
- if: needs.testMac.result == 'success'
name: Download UnitTestReport_Mac64
uses: actions/download-artifact@v3
with:
name: UnitTestReport_Mac64
path: artifacts
# - name: Download UnitTestReport_MacARM
# uses: actions/download-artifact@v3
# with:
# name: UnitTestReport_MacARM
# path: artifacts
- name: Split files by format
run: |
mkdir junitReports
mkdir catchReports
mv artifacts/*junit* junitReports
mv artifacts/*catch* catchReports
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1.28
with:
files: junitReports/*.xml
check_name: Catch2 Test Results
comment_title: Catch2 Test Results