Repository navigation
980 lines (886 loc) · 44.9 KB
/
Copy pathci.yml
File metadata and controls
980 lines (886 loc) · 44.9 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
# Continuous integration for SEA-Stack.
#
# Test suites and CTest labels are described in tests/README.md and
# tests/TEST_SUITES_REFERENCE.md. Each job uses the documented build and test
# entry points under scripts/, so a failure here can be reproduced locally with
# the same commands.
name: CI
on:
push:
branches:
- dev
- main
- 'release/**'
pull_request:
types: [opened, synchronize, reopened, labeled]
# Nightly run of the full test suites on dev. Scheduled runs use the workflow
# file on the default branch.
schedule:
- cron: '17 2 * * *'
workflow_dispatch:
inputs:
full:
description: Run the full test suites (verification, comparison, long regression, demo cases, benchmarks)
type: boolean
default: true
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# Thread counts are fixed so that results and timings are comparable between
# runs: 2 concurrent tests, each with 2 OpenMP threads. The standard Linux
# and Windows runners have 4 virtual CPUs and the macOS runners 3.
OMP_NUM_THREADS: '2'
OPENBLAS_NUM_THREADS: '1'
CTEST_JOBS: '2'
MPLBACKEND: Agg
# The full suites run nightly, on a manual run, and on a pull request that
# carries the label "full-tests". Other runs stop after the unit, regression
# and external tests.
FULL_SUITES: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full) || contains(github.event.pull_request.labels.*.name, 'full-tests') }}
# Scheduled runs test dev; every other run tests the commit that triggered it.
CHECKOUT_REF: ${{ github.event_name == 'schedule' && 'dev' || '' }}
jobs:
chrono-free:
name: Chrono-free build and tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: Linux
id: linux
os: ubuntu-24.04
- name: macOS
id: macos
os: macos-15
steps:
- name: Check out the source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
# Normally under two minutes. The limit stops a hung installation from
# holding the job until the job's own time limit.
- name: Install system packages (Linux)
if: ${{ runner.os == 'Linux' }}
timeout-minutes: 10
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
ninja-build libeigen3-dev libhdf5-dev
# eigen@3 and libomp are keg-only, so CMake needs their prefixes. The
# macOS runner has 7 GB of memory: limit the build to 3 jobs.
- name: Install system packages (macOS)
if: ${{ runner.os == 'macOS' }}
run: |
brew install ninja eigen@3 hdf5 libomp
{
echo "CMAKE_PREFIX_PATH=$(brew --prefix eigen@3):$(brew --prefix hdf5):$(brew --prefix libomp)"
echo "CI_HDF5_DIR=$(brew --prefix hdf5)/lib/cmake/hdf5"
echo "CMAKE_BUILD_PARALLEL_LEVEL=3"
} >> "${GITHUB_ENV}"
- name: Install Python packages
run: python3 -m pip install --requirement tests/regression/run_seastack/requirements.txt
- name: Record the environment
run: |
echo "Runner: ${RUNNER_OS} ${RUNNER_ARCH}, image ${ImageOS:-unknown} ${ImageVersion:-unknown}"
echo "CPUs: $(getconf _NPROCESSORS_ONLN)"
if [[ "${RUNNER_OS}" == "macOS" ]]; then
sw_vers
sysctl -n machdep.cpu.brand_string hw.memsize
brew list --versions eigen@3 hdf5 libomp ninja
else
grep -m1 'model name' /proc/cpuinfo || true
free -g | sed -n '1,2p'
fi
df -h .
cmake --version | head -n 1
echo "ninja $(ninja --version)"
c++ --version | head -n 1
python3 --version
python3 -m pip list --format=freeze | grep -i -E '^(numpy|h5py|pyyaml|matplotlib)=='
echo "OMP_NUM_THREADS=${OMP_NUM_THREADS} CTEST_JOBS=${CTEST_JOBS}"
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:-}"
# build.sh passes PythonRoot to CMake, so the tests use the interpreter
# that has the packages installed above.
- name: Write build-config.json
run: |
printf '{"ChronoDir": "", "PythonRoot": "%s", "HDF5Dir": "%s", "Generator": ""}\n' \
"${pythonLocation}" "${CI_HDF5_DIR:-}" > build-config.json
cat build-config.json
- name: Build
id: build
run: ./scripts/unix/build.sh --no-chrono --external --verbose
- name: Run the chrono-free tests
id: ctest
run: >
ctest --test-dir build -C Release -L chrono-free --no-tests=error
--output-on-failure -j "${CTEST_JOBS}"
--output-junit test-results/chrono-free.xml
# CTest exits with 0 when a test is skipped. Fail unless every test ran.
- name: Check that every test ran and passed
if: ${{ !cancelled() && steps.ctest.conclusion != 'skipped' }}
run: >
python3 scripts/ci/check_ctest_junit.py build/test-results/chrono-free.xml
--summary "${GITHUB_STEP_SUMMARY}"
- name: Downstream-consumer check
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: ./scripts/unix/run_consumer_check.sh --work-dir "${RUNNER_TEMP}/consumer-check"
- name: Record disk use
if: ${{ !cancelled() }}
run: |
df -h .
du -sh build || true
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: chrono-free-${{ matrix.id }}-results
path: |
build/test-results/
build/Testing/Temporary/LastTest.log
build/build-diagnostics.log
if-no-files-found: warn
retention-days: 14
chrono:
name: Chrono build and tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
include:
- name: Linux
id: linux
os: ubuntu-24.04
- name: macOS
id: macos
os: macos-15
# The reports are written as Markdown here; the test-reports job converts
# those of every platform to PDF.
steps:
- name: Check out the source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}
submodules: recursive
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
# Normally under two minutes. The limit stops a hung installation from
# holding the job until the job's own time limit.
- name: Install system packages (Linux)
if: ${{ runner.os == 'Linux' }}
timeout-minutes: 10
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
ninja-build libeigen3-dev libhdf5-dev
# eigen@3 and libomp are keg-only, so CMake needs their prefixes. The
# macOS runner has 7 GB of memory: limit the build to 3 jobs.
- name: Install system packages (macOS)
if: ${{ runner.os == 'macOS' }}
run: |
brew install ninja eigen@3 hdf5 libomp
{
echo "CMAKE_PREFIX_PATH=$(brew --prefix eigen@3):$(brew --prefix hdf5):$(brew --prefix libomp)"
echo "CI_HDF5_DIR=$(brew --prefix hdf5)/lib/cmake/hdf5"
echo "CMAKE_BUILD_PARALLEL_LEVEL=3"
} >> "${GITHUB_ENV}"
# tests/unit/python/test_demo_features.py runs under pytest and tests the
# demo feature tools, which need MHKiT. It reports itself as skipped when
# pytest is missing or when pytest skips any of its tests.
- name: Install Python packages
run: |
python3 -m pip install --requirement tests/regression/run_seastack/requirements.txt
python3 -m pip install pytest
python3 -m pip install --requirement data/demos/run_seastack/features/requirements.txt
- name: Record the environment
run: |
echo "Runner: ${RUNNER_OS} ${RUNNER_ARCH}, image ${ImageOS:-unknown} ${ImageVersion:-unknown}"
echo "CPUs: $(getconf _NPROCESSORS_ONLN)"
if [[ "${RUNNER_OS}" == "macOS" ]]; then
sw_vers
sysctl -n machdep.cpu.brand_string hw.memsize
brew list --versions eigen@3 hdf5 libomp ninja
else
grep -m1 'model name' /proc/cpuinfo || true
free -g | sed -n '1,2p'
fi
df -h .
cmake --version | head -n 1
echo "ninja $(ninja --version)"
c++ --version | head -n 1
python3 --version
python3 -m pip list --format=freeze | grep -i -E '^(numpy|h5py|pyyaml|matplotlib|pytest|mhkit|scipy|pandas|ruamel\.yaml)=='
echo "OMP_NUM_THREADS=${OMP_NUM_THREADS} CTEST_JOBS=${CTEST_JOBS} FULL_SUITES=${FULL_SUITES}"
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:-}"
git log -1 --format='Source: %H %s'
# Chrono is built by scripts/unix/build_chrono.sh and reused until that
# script, the runner image, the compiler or (on macOS) the Homebrew
# libraries it links change.
- name: Locate the Chrono installation
id: chrono
run: |
toolchain="$(
{
c++ --version | head -n 1
if [[ "${RUNNER_OS}" == "macOS" ]]; then
brew list --versions eigen@3 hdf5 libomp
fi
} | git hash-object --stdin | cut -c1-16
)"
echo "prefix=${HOME}/seastack-deps/chrono-10.0.0" >> "${GITHUB_OUTPUT}"
echo "toolchain=${toolchain}" >> "${GITHUB_OUTPUT}"
- name: Restore the Chrono installation
id: chrono-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.chrono.outputs.prefix }}
key: chrono-10.0.0-${{ matrix.os }}-${{ steps.chrono.outputs.toolchain }}-${{ hashFiles('scripts/unix/build_chrono.sh') }}
- name: Build Chrono
if: ${{ steps.chrono-cache.outputs.cache-hit != 'true' }}
env:
CHRONO_PREFIX: ${{ steps.chrono.outputs.prefix }}
run: |
# Bash 3.2 (macOS): empty arrays are expanded with the ${a[@]+...} form.
options=()
if [[ "${RUNNER_OS}" == "macOS" ]]; then
options=(--jobs 3 --
"-DEIGEN3_INCLUDE_DIR=$(brew --prefix eigen@3)/include/eigen3"
"-DHDF5_DIR=$(brew --prefix hdf5)/lib/cmake/hdf5"
"-DOpenMP_ROOT=$(brew --prefix libomp)")
fi
./scripts/unix/build_chrono.sh --prefix "${CHRONO_PREFIX}" \
--work-dir "${RUNNER_TEMP}/chrono-work" ${options[@]+"${options[@]}"}
rm -rf "${RUNNER_TEMP}/chrono-work"
du -sh "${CHRONO_PREFIX}"
# Saved here, not at the end of the job, so that a test failure does not
# discard the Chrono build.
- name: Save the Chrono installation
if: ${{ steps.chrono-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.chrono.outputs.prefix }}
key: ${{ steps.chrono-cache.outputs.cache-primary-key }}
# On Linux the Chrono libraries are outside the system library path, so
# the test executables need LD_LIBRARY_PATH (docs/build/RELEASE_CHECKLIST.md).
- name: Write build-config.json
env:
CHRONO_PREFIX: ${{ steps.chrono.outputs.prefix }}
run: |
config_file="$(find "${CHRONO_PREFIX}" -name ChronoConfig.cmake -print | head -n 1)"
test -n "${config_file}"
printf '{"ChronoDir": "%s", "PythonRoot": "%s", "HDF5Dir": "%s", "Generator": ""}\n' \
"$(dirname "${config_file}")" "${pythonLocation}" "${CI_HDF5_DIR:-}" > build-config.json
cat build-config.json
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "LD_LIBRARY_PATH=${CHRONO_PREFIX}/lib" >> "${GITHUB_ENV}"
fi
- name: Build
id: build
run: ./scripts/unix/build.sh --moordyn --external --demos --verbose
- name: Run the unit tests
run: ./scripts/unix/ctest_suite.sh unit -j "${CTEST_JOBS}" --junit test-results/unit.xml
- name: Run the regression tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: >
./scripts/unix/ctest_suite.sh regression -j "${CTEST_JOBS}" --no-pdf
--junit test-results/regression.xml
- name: Run the external-module tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: >
ctest --test-dir build -C Release -L '^external$' --no-tests=error
--output-on-failure -j "${CTEST_JOBS}"
--output-junit test-results/external.xml
# ---- Full suites (see FULL_SUITES above) ----
- name: Run the verification tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
./scripts/unix/ctest_suite.sh verification -j "${CTEST_JOBS}" --no-pdf
--junit test-results/verification.xml
- name: Run the comparison tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
./scripts/unix/ctest_suite.sh comparison -j "${CTEST_JOBS}" --no-pdf
--junit test-results/comparison.xml
# Runs last of the CTest suites, so the regression report describes the long run.
- name: Run the long regression tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
./scripts/unix/ctest_suite.sh regression --long -j "${CTEST_JOBS}" --no-pdf
--junit test-results/regression-long.xml
- name: Run the demo cases against their baselines
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
python3 tests/regression/run_seastack/run_tests.py --all --quiet
--exe build/bin/Release/run_seastack
# Demo cases outside the packaged check, against the reduced references
# under tests/regression/run_seastack/extended.
- name: Run the extended demo cases against their references
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
python3 tests/regression/run_seastack/run_tests.py --extended --quiet
--exe build/bin/Release/run_seastack
# Wall-clock timings on shared runners are for information only, so this
# step does not fail the job.
- name: Run the benchmarks
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
continue-on-error: true
run: ./scripts/unix/ctest_suite.sh benchmark --junit test-results/benchmark.xml
# CTest exits with 0 when a test is skipped. Fail unless every test ran.
- name: Check that every test ran and passed
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
suites="unit regression external"
if [[ "${FULL_SUITES}" == "true" ]]; then
suites="${suites} verification comparison regression-long"
fi
status=0
for suite in ${suites}; do
python3 scripts/ci/check_ctest_junit.py "build/test-results/${suite}.xml" \
--summary "${GITHUB_STEP_SUMMARY}" || status=1
done
exit "${status}"
# The summary of measured values against their limits, from each report,
# on the page of the workflow run.
- name: Show the checks against limits on the run page
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
reports="regression/report/regression_test_report.md"
if [[ "${FULL_SUITES}" == "true" ]]; then
reports="${reports} verification/report/verification_report.md comparison/report/comparison_test_report.md"
fi
for report in ${reports}; do
python3 scripts/ci/report_section.py "build/bin/Release/results/tests/${report}" \
--title "${report%%/*} checks against limits (${{ matrix.name }})" \
--summary "${GITHUB_STEP_SUMMARY}" || true
done
- name: Record disk use
if: ${{ !cancelled() }}
run: |
df -h .
du -sh build || true
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: chrono-${{ matrix.id }}-results
path: |
build/test-results/
build/Testing/Temporary/LastTest.log
build/build-diagnostics.log
if-no-files-found: warn
retention-days: 14
# Markdown reports with their figures, for the test-reports job, which
# converts them to PDF and deletes this artifact once the Chrono jobs of
# every platform have passed.
- name: Hand over the reports
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-sources-${{ matrix.id }}
path: |
build/bin/Release/results/tests/*/report/
build/bin/Release/results/tests/**/plots/
if-no-files-found: warn
retention-days: 1
# The Windows jobs use the PowerShell entry points under scripts/windows.
# Eigen and HDF5 come from the vcpkg checkout on the runner image.
chrono-free-windows:
name: Chrono-free build and tests (Windows)
runs-on: windows-2022
timeout-minutes: 60
steps:
- name: Check out the source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
# Exports the Visual Studio x64 compiler environment (vcvars64.bat) to the
# following steps, so that CMake can use Ninja with cl.
- name: Set up the MSVC environment
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vcvars = Join-Path $vsPath 'VC\Auxiliary\Build\vcvars64.bat'
if (-not (Test-Path -LiteralPath $vcvars)) { throw "vcvars64.bat not found: $vcvars" }
$before = @{}
Get-ChildItem Env: | ForEach-Object { $before[$_.Name] = $_.Value }
cmd /c "`"$vcvars`" >nul 2>&1 && set" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$' -and $before[$Matches[1]] -ne $Matches[2]) {
"$($Matches[1])=$($Matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
- name: Locate vcpkg
id: vcpkg
run: |
$root = $env:VCPKG_INSTALLATION_ROOT
$commit = git -c safe.directory=* -C $root rev-parse --short=12 HEAD
if ($LASTEXITCODE -ne 0) { throw "cannot read the vcpkg commit in $root" }
$archives = Join-Path $HOME 'seastack-deps\vcpkg-archives'
New-Item -ItemType Directory -Force -Path $archives | Out-Null
"commit=$commit" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"archives=$archives" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"VCPKG_DEFAULT_BINARY_CACHE=$archives" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"VCPKG_INSTALLED=$(($root -replace '\\', '/'))/installed/x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Restore the vcpkg binary cache
id: vcpkg-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.vcpkg.outputs.archives }}
key: vcpkg-windows-2022-${{ steps.vcpkg.outputs.commit }}-eigen3-hdf5
- name: Install Eigen and HDF5
run: |
& "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" install eigen3:x64-windows "hdf5[cpp,hl,szip,zlib]:x64-windows"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" list
- name: Save the vcpkg binary cache
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.vcpkg.outputs.archives }}
key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }}
- name: Install Python packages
run: python -m pip install --requirement tests/regression/run_seastack/requirements.txt
- name: Record the environment
run: |
"Runner: $env:RUNNER_OS $env:RUNNER_ARCH, image $env:ImageOS $env:ImageVersion"
"CPUs: $([Environment]::ProcessorCount)"
(Get-CimInstance Win32_Processor).Name
"Memory: {0:N0} GB" -f ((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB)
Get-PSDrive -PSProvider FileSystem | Format-Table Name, @{n='Used (GB)';e={[int]($_.Used/1GB)}}, @{n='Free (GB)';e={[int]($_.Free/1GB)}}
cmake --version | Select-Object -First 1
"ninja $(ninja --version)"
"MSVC tools $env:VCToolsVersion"
python --version
python -m pip list --format=freeze | Select-String -Pattern '^(numpy|h5py|pyyaml|matplotlib)==' | ForEach-Object { $_.Line }
"OMP_NUM_THREADS=$env:OMP_NUM_THREADS CTEST_JOBS=$env:CTEST_JOBS"
# CMakePrefixPath lets the Chrono-free configure find Eigen in vcpkg. The
# HDF5 DLLs are not copied next to the tests in a Chrono-free build, so
# their folder goes on PATH (docs/build/BUILD_WINDOWS.md, Troubleshooting).
- name: Write build-config.json and add the HDF5 DLLs to PATH
run: |
"$($env:VCPKG_INSTALLED -replace '/', '\')\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
[ordered]@{
ChronoDir = ''
PythonRoot = ($env:pythonLocation -replace '\\', '/')
HDF5Dir = "$env:VCPKG_INSTALLED/share/hdf5"
CMakePrefixPath = $env:VCPKG_INSTALLED
Generator = ''
} | ConvertTo-Json | Set-Content -Encoding ascii build-config.json
Get-Content build-config.json
- name: Build
id: build
run: .\scripts\windows\build.ps1 -NoChrono -External -Verbose
- name: Run the chrono-free tests
id: ctest
run: .\scripts\windows\run_chrono_free_tests.ps1 -j $env:CTEST_JOBS -Junit test-results/chrono-free.xml
# CTest exits with 0 when a test is skipped. Fail unless every test ran.
- name: Check that every test ran and passed
if: ${{ !cancelled() && steps.ctest.conclusion != 'skipped' }}
run: python scripts/ci/check_ctest_junit.py build/test-results/chrono-free.xml --summary $env:GITHUB_STEP_SUMMARY
- name: Downstream-consumer check
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: .\scripts\windows\run_consumer_check.ps1 -WorkDir (Join-Path $env:RUNNER_TEMP 'consumer-check')
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: chrono-free-windows-results
path: |
build/test-results/
build/Testing/Temporary/LastTest.log
build/build-diagnostics.log
if-no-files-found: warn
retention-days: 14
chrono-windows:
name: Chrono build and tests (Windows)
runs-on: windows-2022
timeout-minutes: 240
steps:
- name: Check out the source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}
submodules: recursive
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
# Exports the Visual Studio x64 compiler environment (vcvars64.bat) to the
# following steps, so that CMake can use Ninja with cl.
- name: Set up the MSVC environment
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vcvars = Join-Path $vsPath 'VC\Auxiliary\Build\vcvars64.bat'
if (-not (Test-Path -LiteralPath $vcvars)) { throw "vcvars64.bat not found: $vcvars" }
$before = @{}
Get-ChildItem Env: | ForEach-Object { $before[$_.Name] = $_.Value }
cmd /c "`"$vcvars`" >nul 2>&1 && set" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$' -and $before[$Matches[1]] -ne $Matches[2]) {
"$($Matches[1])=$($Matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
}
- name: Locate vcpkg and the Chrono installation
id: deps
run: |
$root = $env:VCPKG_INSTALLATION_ROOT
$commit = git -c safe.directory=* -C $root rev-parse --short=12 HEAD
if ($LASTEXITCODE -ne 0) { throw "cannot read the vcpkg commit in $root" }
$archives = Join-Path $HOME 'seastack-deps\vcpkg-archives'
New-Item -ItemType Directory -Force -Path $archives | Out-Null
"commit=$commit" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"archives=$archives" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"chrono=$(Join-Path $HOME 'seastack-deps\chrono-10.0.0')" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"msvc=$env:VCToolsVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"VCPKG_DEFAULT_BINARY_CACHE=$archives" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"VCPKG_INSTALLED=$(($root -replace '\\', '/'))/installed/x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Restore the vcpkg binary cache
id: vcpkg-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.deps.outputs.archives }}
key: vcpkg-windows-2022-${{ steps.deps.outputs.commit }}-eigen3-hdf5
- name: Install Eigen and HDF5
run: |
& "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" install eigen3:x64-windows "hdf5[cpp,hl,szip,zlib]:x64-windows"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" list
- name: Save the vcpkg binary cache
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.deps.outputs.archives }}
key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }}
# tests/unit/python/test_demo_features.py runs under pytest and tests the
# demo feature tools, which need MHKiT. It reports itself as skipped when
# pytest is missing or when pytest skips any of its tests.
- name: Install Python packages
run: |
python -m pip install --requirement tests/regression/run_seastack/requirements.txt
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python -m pip install pytest
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python -m pip install --requirement data/demos/run_seastack/features/requirements.txt
- name: Record the environment
run: |
"Runner: $env:RUNNER_OS $env:RUNNER_ARCH, image $env:ImageOS $env:ImageVersion"
"CPUs: $([Environment]::ProcessorCount)"
(Get-CimInstance Win32_Processor).Name
"Memory: {0:N0} GB" -f ((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB)
Get-PSDrive -PSProvider FileSystem | Format-Table Name, @{n='Used (GB)';e={[int]($_.Used/1GB)}}, @{n='Free (GB)';e={[int]($_.Free/1GB)}}
cmake --version | Select-Object -First 1
"ninja $(ninja --version)"
"MSVC tools $env:VCToolsVersion"
python --version
python -m pip list --format=freeze | Select-String -Pattern '^(numpy|h5py|pyyaml|matplotlib|pytest|mhkit|scipy|pandas|ruamel\.yaml)==' | ForEach-Object { $_.Line }
"OMP_NUM_THREADS=$env:OMP_NUM_THREADS CTEST_JOBS=$env:CTEST_JOBS FULL_SUITES=$env:FULL_SUITES"
git log -1 --format='Source: %H %s'
# Chrono is built by scripts/windows/build_chrono.ps1 and reused until that
# script, the HDF5 shim, the compiler or the vcpkg checkout changes.
- name: Restore the Chrono installation
id: chrono-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.deps.outputs.chrono }}
key: chrono-10.0.0-windows-2022-msvc${{ steps.deps.outputs.msvc }}-vcpkg${{ steps.deps.outputs.commit }}-${{ hashFiles('scripts/windows/build_chrono.ps1', 'cmake/ChronoHdf5ToolsShim.cmake') }}
- name: Build Chrono
if: ${{ steps.chrono-cache.outputs.cache-hit != 'true' }}
env:
CHRONO_PREFIX: ${{ steps.deps.outputs.chrono }}
run: |
$work = Join-Path $env:RUNNER_TEMP 'chrono-work'
# The log is uploaded with the test results, so a failed Chrono build can be diagnosed.
$log = Join-Path $env:GITHUB_WORKSPACE 'chrono-build.log'
.\scripts\windows\build_chrono.ps1 -Prefix $env:CHRONO_PREFIX -WorkDir $work -VcpkgRoot $env:VCPKG_INSTALLATION_ROOT *>&1 |
Tee-Object -FilePath $log
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Removing the work folder frees disk space; a locked file there must not fail the job.
Remove-Item -Recurse -Force $work -ErrorAction SilentlyContinue
exit 0
# Saved here, not at the end of the job, so that a test failure does not
# discard the Chrono build.
- name: Save the Chrono installation
if: ${{ steps.chrono-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.deps.outputs.chrono }}
key: ${{ steps.chrono-cache.outputs.cache-primary-key }}
- name: Write build-config.json
env:
CHRONO_PREFIX: ${{ steps.deps.outputs.chrono }}
run: |
$config = Get-ChildItem -LiteralPath $env:CHRONO_PREFIX -Recurse -File |
Where-Object { $_.Name -in 'ChronoConfig.cmake', 'chrono-config.cmake' } | Select-Object -First 1
if (-not $config) { throw "no Chrono package config under $env:CHRONO_PREFIX" }
# CMakePrefixPath lets vcpkg's HDF5 package find its ZLIB dependency
# (docs/build/BUILD_WINDOWS.md, section 2).
[ordered]@{
ChronoDir = ($config.DirectoryName -replace '\\', '/')
PythonRoot = ($env:pythonLocation -replace '\\', '/')
HDF5Dir = "$env:VCPKG_INSTALLED/share/hdf5"
CMakePrefixPath = $env:VCPKG_INSTALLED
Generator = ''
} | ConvertTo-Json | Set-Content -Encoding ascii build-config.json
Get-Content build-config.json
- name: Build
id: build
run: .\scripts\windows\build.ps1 -MoorDyn -External -Demos -Verbose
# The test programs load the vcpkg DLLs from the output folder, where
# build.ps1 copies them. Fail with a clear message if a DLL staged from
# vcpkg imports another vcpkg DLL that was not staged (for example after
# vcpkg renames a library), instead of letting every test stop with
# 0xc0000135. The listing is uploaded with the test results.
- name: Check the staged vcpkg DLLs
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
$bin = 'build\bin\Release'
$vcpkgBin = "$($env:VCPKG_INSTALLED -replace '/', '\')\bin"
New-Item -ItemType Directory -Force -Path 'build\test-results' | Out-Null
$report = 'build\test-results\staged-dlls.txt'
$staged = @(Get-ChildItem $bin -Filter *.dll | ForEach-Object { $_.Name })
$vcpkgDlls = @(Get-ChildItem $vcpkgBin -Filter *.dll | ForEach-Object { $_.Name })
"DLLs in $bin after build.ps1:" | Out-File $report -Encoding utf8
$staged | Sort-Object | Out-File $report -Encoding utf8 -Append
"DLLs in ${vcpkgBin}:" | Out-File $report -Encoding utf8 -Append
$vcpkgDlls | Sort-Object | Out-File $report -Encoding utf8 -Append
$missing = @()
foreach ($dll in ($staged | Where-Object { $_ -in $vcpkgDlls })) {
$imports = @(dumpbin /nologo /dependents (Join-Path $bin $dll) |
Where-Object { $_ -match '^\s+\S+\.dll\s*$' } | ForEach-Object { $_.Trim() })
"Imports of ${dll}: $($imports -join ', ')" | Out-File $report -Encoding utf8 -Append
foreach ($import in $imports) {
if ($import -in $vcpkgDlls -and $import -notin $staged) { $missing += "$dll imports $import" }
}
}
Get-Content $report
if ($missing) {
$missing | ForEach-Object { "::error::vcpkg DLL not staged next to the tests: $_" }
exit 1
}
"[OK] every vcpkg DLL imported by a staged vcpkg DLL is staged"
- name: Run the unit tests
run: .\scripts\windows\run_unit_tests.ps1 -j $env:CTEST_JOBS -Junit test-results/unit.xml
- name: Run the regression tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: .\scripts\windows\run_regression_tests.ps1 -j $env:CTEST_JOBS -NoPdf -Junit test-results/regression.xml
- name: Run the external-module tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: >
ctest --test-dir build -C Release -L '^external$' --no-tests=error
--output-on-failure -j $env:CTEST_JOBS
--output-junit test-results/external.xml
# ---- Full suites (see FULL_SUITES above); Markdown reports only ----
- name: Run the verification tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: .\scripts\windows\run_verification_tests.ps1 -j $env:CTEST_JOBS -NoPdf -Junit test-results/verification.xml
- name: Run the comparison tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: .\scripts\windows\run_comparison_tests.ps1 -j $env:CTEST_JOBS -NoPdf -Junit test-results/comparison.xml
# Runs last of the CTest suites, so the regression report describes the long run.
- name: Run the long regression tests
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: .\scripts\windows\run_regression_tests.ps1 -Long -j $env:CTEST_JOBS -NoPdf -Junit test-results/regression-long.xml
- name: Run the demo cases against their baselines
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
python tests/regression/run_seastack/run_tests.py --all --quiet
--exe build/bin/Release/run_seastack.exe
# Demo cases outside the packaged check, against the reduced references
# under tests/regression/run_seastack/extended.
- name: Run the extended demo cases against their references
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
run: >
python tests/regression/run_seastack/run_tests.py --extended --quiet
--exe build/bin/Release/run_seastack.exe
# Wall-clock timings on shared runners are for information only, so this
# step does not fail the job.
- name: Run the benchmarks
if: ${{ !cancelled() && steps.build.conclusion == 'success' && env.FULL_SUITES == 'true' }}
continue-on-error: true
run: .\scripts\windows\run_benchmarks.ps1
# CTest exits with 0 when a test is skipped. Fail unless every test ran.
- name: Check that every test ran and passed
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
$suites = @('unit', 'regression', 'external')
if ($env:FULL_SUITES -eq 'true') { $suites += 'verification', 'comparison', 'regression-long' }
$status = 0
foreach ($suite in $suites) {
python scripts/ci/check_ctest_junit.py "build/test-results/$suite.xml" --summary $env:GITHUB_STEP_SUMMARY
if ($LASTEXITCODE -ne 0) { $status = 1 }
}
exit $status
# The summary of measured values against their limits, from each report,
# on the page of the workflow run.
- name: Show the checks against limits on the run page
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
$reports = @('regression/report/regression_test_report.md')
if ($env:FULL_SUITES -eq 'true') {
$reports += 'verification/report/verification_report.md', 'comparison/report/comparison_test_report.md'
}
foreach ($report in $reports) {
$suite = ($report -split '/')[0]
python scripts/ci/report_section.py "build/bin/Release/results/tests/$report" --title "$suite checks against limits (Windows)" --summary $env:GITHUB_STEP_SUMMARY
}
exit 0
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: chrono-windows-results
path: |
build/test-results/
build/Testing/Temporary/LastTest.log
build/build-diagnostics.log
chrono-build.log
if-no-files-found: warn
retention-days: 14
# Markdown reports with their figures, for the test-reports job, which
# converts them to PDF and deletes this artifact once the Chrono jobs of
# every platform have passed.
- name: Hand over the reports
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-sources-windows
path: |
build/bin/Release/results/tests/*/report/
build/bin/Release/results/tests/**/plots/
if-no-files-found: warn
retention-days: 1
# Converts the reports of all three platforms to PDF on one Linux runner,
# where pandoc and LaTeX are installed, and uploads them as one artifact,
# test-reports: <platform>/<suite>_test_report.pdf with the figures resampled
# to 150 dpi (lossless) for reading on screen. The regression reports are
# always included; verification and comparison with the full suites.
test-reports:
name: PDF test reports
if: ${{ !cancelled() }}
needs: [chrono, chrono-windows]
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
# To delete the report-sources-* artifacts once they are converted.
actions: write
steps:
- name: Check out the source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}
persist-credentials: false
# Normally under two minutes. The limit stops a hung installation from
# holding the job until the job's own time limit.
- name: Install pandoc, LaTeX and Ghostscript
timeout-minutes: 10
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
pandoc texlive-xetex texlive-latex-recommended texlive-fonts-recommended lmodern ghostscript
- name: Download the reports of each platform
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: report-sources-*
path: report-sources
# The download makes one folder per artifact, report-sources/report-sources-<platform>.
- name: Convert the reports to PDF
run: |
mkdir -p sources
for folder in report-sources/report-sources-*; do
[[ -d "${folder}" ]] && mv "${folder}" "sources/${folder##*/report-sources-}"
done
ls sources
required="regression"
if [[ "${FULL_SUITES}" == "true" ]]; then
required="regression verification comparison"
fi
# A platform whose Chrono job failed has no reports; that job already
# fails the run, so only the platforms present are checked.
python3 scripts/ci/render_reports.py sources full-resolution --require ${required}
- name: Resample the figures for reading on screen
run: |
mkdir -p test-reports
for source_pdf in full-resolution/*/*.pdf; do
platform="$(basename "$(dirname "${source_pdf}")")"
screen_pdf="test-reports/${platform}/$(basename "${source_pdf}")"
mkdir -p "$(dirname "${screen_pdf}")"
if ! gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite \
-dDownsampleColorImages=true -dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=150 -dColorImageDownsampleThreshold=1.0 \
-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode \
-dDownsampleGrayImages=true -dGrayImageDownsampleType=/Bicubic \
-dGrayImageResolution=150 -dGrayImageDownsampleThreshold=1.0 \
-dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode \
-sOutputFile="${screen_pdf}" "${source_pdf}" || [[ ! -s "${screen_pdf}" ]]; then
echo "::warning::could not resample ${source_pdf}; uploading it at full resolution"
cp "${source_pdf}" "${screen_pdf}"
fi
echo "[OK] ${platform}/$(basename "${source_pdf}"): $(du -h "${source_pdf}" | cut -f1) -> $(du -h "${screen_pdf}" | cut -f1)"
done
# When this job runs again in a later attempt of the same run, its reports
# replace those of the earlier attempt, which lack the platforms whose
# jobs had not passed yet.
- name: Upload the PDF reports
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-reports
path: test-reports/
if-no-files-found: error
retention-days: 30
overwrite: true
# The sources are deleted only when the steps above succeeded and both
# Chrono jobs passed. Otherwise a re-run of this job or of a Chrono job
# needs the sources of every platform; they expire after one day.
# Best effort: a pull request from a fork gets a read-only token, and the
# artifacts then expire after one day instead.
- name: Delete the converted report sources
if: ${{ success() && needs.chrono.result == 'success' && needs.chrono-windows.result == 'success' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
ids="$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts" --paginate \
--jq '.artifacts[] | select(.name | startswith("report-sources-")) | .id')" || ids=""
for id in ${ids}; do
gh api -X DELETE "repos/${GITHUB_REPOSITORY}/actions/artifacts/${id}" \
|| echo "::warning::could not delete artifact ${id}"
done
# One status for branch protection: passes only if every job above passed.
# Requiring this job means the list of platforms can change without editing
# the repository settings.
all-checks:
name: All checks
if: ${{ always() }}
needs: [chrono-free, chrono, chrono-free-windows, chrono-windows, test-reports]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Require every job to have passed
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo "Job results: ${RESULTS}"
for result in ${RESULTS}; do
if [[ "${result}" != "success" ]]; then
echo "::error::a job did not pass (${result})"
exit 1
fi
done