forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (111 loc) · 3.58 KB
/
build-docker.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
name: build-docker
on:
workflow_dispatch:
workflow_call:
concurrency:
group: build-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}}
cancel-in-progress: true
jobs:
# TODO: since we don't build on GPU systems with cuda/rocm docker,
# none of the tests actually run on device
gpu:
name: >-
${{format('{0}{1}{2}-{3}-{4}',
matrix.special,
matrix.special && '-' || '',
matrix.geometry,
matrix.buildtype,
matrix.image)}}
strategy:
fail-fast: false
matrix:
special: [null]
geometry: ["orange", "vecgeom"]
buildtype: ["debug", "ndebug"]
image: ["rocky-cuda", "ubuntu-rocm"]
exclude:
- geometry: "vecgeom"
image: "ubuntu-rocm" # VecGeom not installed on HIP
- buildtype: "debug"
image: "ubuntu-rocm" # Debug builds don't work with HIP
include:
- geometry: "vecgeom"
buildtype: "reldeb"
image: "rocky-cuda"
env:
CELER_TEST_STRICT: 1
CELER_DISABLE_DEVICE: 1 # REQUIRED for GHA runners
CMAKE_PRESET: >-
${{format('{0}-{1}{2}{3}',
matrix.buildtype,
matrix.geometry,
matrix.special && '-' || '',
matrix.special)}}
runs-on: ubuntu-24.04
container:
image: >-
docker.io/celeritas/${{
matrix.image == 'rocky-cuda' && 'ci-rocky-cuda12:2024-12-29'
|| matrix.image == 'ubuntu-rocm' && 'ci-ubuntu-rocm6:2025-01-02'
}}
steps:
- name: Set up environment
run: |
. /etc/profile
echo "/opt/view/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
# NOTE: checkout must occur *after* setting up environment for git tags to work
# NOTE: depth must be enough to include the previous tag
- name: Check out Celeritas
uses: actions/checkout@v4
with:
fetch-depth: 383
fetch-tags: true
- name: Configure Celeritas
run: |
git config --global --add safe.directory ${PWD}
ln -fs scripts/cmake-presets/ci-${{matrix.image}}.json CMakeUserPresets.json
cmake --preset=${CMAKE_PRESET}
- name: Build Celeritas
working-directory: build
run: |
ninja
- name: Test Celeritas
id: test
run: |
ctest --preset=base
- name: Install Celeritas
working-directory: build
run: |
cmake --install .
- name: Check installation
working-directory: install
run: |
for exe in orange-update celer-export-geant celer-dump-data \
celer-sim celer-g4; do
test -x "bin/${exe}"
done
./bin/celer-sim --version
- name: Build examples
# TODO: rocm+ndebug fails to propagate HIP library link
if: >-
${{
!(matrix.image == 'ubuntu-rocm' && matrix.buildtype == 'ndebug')
}}
run: |
. /etc/profile
./scripts/ci/test-examples.sh
- name: Upload test results
if: >-
${{
always()
&& (steps.test.outcome == 'success'
|| steps.test.outcome == 'failure')
}}
uses: actions/upload-artifact@v4
with:
name: test-results-${{matrix.image}}-${{env.CMAKE_PRESET}}
path: "test-output/**/*.xml"
if-no-files-found: error
retention-days: 1
# vim: set nowrap tw=100: