Skip to content

Commit a6d92cd

Browse files
authored
Fix static builds and CI reporting (#1680)
* Add perfetto build * Add FindPerfetto * Add perf-specific extension * Install perfetto * Don't use include directories outside of build interface * Refactor cmake options * Slightly rearrange and comment spack build * Remove preset name conflict * Add separate app/unit tests * Reorganize, fix step names, add missing build type * Print versions, fix typo, save output file * Move vecgeom option in config * Add cmake profiling script * Fix ultralite test generation, don't install cmake/ninja * Don't use hidden for spack
1 parent 9e0aef4 commit a6d92cd

18 files changed

+523
-235
lines changed

.github/workflows/build-docker.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,44 @@ jobs:
6363
with:
6464
fetch-depth: 383
6565
fetch-tags: true
66+
67+
### CONFIGURE ###
68+
6669
- name: Configure Celeritas
6770
run: |
6871
git config --global --add safe.directory ${PWD}
6972
ln -fs scripts/cmake-presets/ci-${{matrix.image}}.json CMakeUserPresets.json
7073
cmake --preset=${CMAKE_PRESET}
74+
75+
### BUILD ###
76+
7177
- name: Build Celeritas
7278
working-directory: build
7379
run: |
7480
ninja
81+
82+
### TEST ###
83+
7584
- name: Test Celeritas
7685
id: test
7786
run: |
7887
ctest --preset=base
88+
- name: Upload test results
89+
if: >-
90+
${{
91+
always()
92+
&& (steps.test.outcome == 'success'
93+
|| steps.test.outcome == 'failure')
94+
}}
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: test-results-${{matrix.image}}-${{env.CMAKE_PRESET}}
98+
path: "test-output/**/*.xml"
99+
if-no-files-found: error
100+
retention-days: 1
101+
102+
### INSTALL ###
103+
79104
- name: Install Celeritas
80105
working-directory: build
81106
run: |
@@ -103,18 +128,5 @@ jobs:
103128
| awk '{print $3}'
104129
)
105130
./scripts/ci/test-examples.sh
106-
- name: Upload test results
107-
if: >-
108-
${{
109-
always()
110-
&& (steps.test.outcome == 'success'
111-
|| steps.test.outcome == 'failure')
112-
}}
113-
uses: actions/upload-artifact@v4
114-
with:
115-
name: test-results-${{matrix.image}}-${{env.CMAKE_PRESET}}
116-
path: "test-output/**/*.xml"
117-
if-no-files-found: error
118-
retention-days: 1
119131
120132
# vim: set nowrap tw=100:

.github/workflows/build-fast.yml

Lines changed: 77 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,38 @@ jobs:
5151
|| matrix.runner == 'noble-arm' && 'ubuntu-24.04-arm'
5252
}}
5353
steps:
54+
- name: Check out Celeritas
55+
uses: actions/checkout@v4
56+
57+
### ENVIRONMENT ###
58+
5459
- name: Install dependencies
5560
run: |
5661
sudo apt-get -q -y update
5762
sudo apt-get -q -y install \
58-
ccache cmake ninja-build python3 \
63+
ccache \
5964
nlohmann-json3-dev libgtest-dev libhepmc3-dev libpng-dev \
6065
${{matrix.compiler}}-${{matrix.version}} \
6166
${{matrix.compiler == 'gcc' && format('g++-{0}', matrix.version) || ''}}
6267
echo "Installed toolchain:"
6368
ld --version | head -1
6469
$CC --version | head -1
6570
$CXX --version | head -1
66-
- name: Check out Celeritas
67-
uses: actions/checkout@v4
71+
72+
### CONFIGURE ###
73+
74+
- name: Configure Celeritas
75+
run: |
76+
ln -fs scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json
77+
cmake --version
78+
cmake --preset=${CMAKE_PRESET} \
79+
${{matrix.cxxstd && format('-DCMAKE_CXX_STANDARD={0} ', matrix.cxxstd) || ''}} \
80+
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
81+
&& format(';-pr.{0};', github.event.pull_request.number)
82+
|| format(';-{0};', github.ref_name)}}"
83+
84+
### BUILD ###
85+
6886
- name: Cache ccache
6987
uses: actions/cache@v4
7088
with:
@@ -75,40 +93,27 @@ jobs:
7593
- name: Zero ccache stats
7694
run: |
7795
ccache -z
78-
- name: Configure Celeritas
79-
run: |
80-
ln -fs scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json
81-
cmake --preset=${CMAKE_PRESET} \
82-
${{matrix.cxxstd && format('-DCMAKE_CXX_STANDARD={0} ', matrix.cxxstd) || ''}} \
83-
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
84-
&& format(';-pr.{0};', github.event.pull_request.number)
85-
|| format(';-{0};', github.ref_name)}}"
8696
- name: Build
8797
id: build
8898
working-directory: build
8999
run: |
90100
ninja
101+
- name: Show ccache stats
102+
if: ${{!cancelled()}}
103+
run: |
104+
ccache -s
105+
106+
### TEST ###
107+
91108
- name: Run unit tests
92109
id: unittest
93110
run: |
94-
ctest -LE app --preset=${CMAKE_PRESET}-unit
111+
ctest --preset=${CMAKE_PRESET}-unit
95112
- name: Run app tests
96113
id: apptest
97114
if: ${{!cancelled() && steps.build.outcome == 'success'}}
98115
run: |
99-
ctest -L app --preset=${CMAKE_PRESET}-app
100-
- name: Install
101-
working-directory: build
102-
run: |
103-
ninja install
104-
- name: Check installation
105-
working-directory: install
106-
run: |
107-
./bin/celer-sim --config
108-
- name: Show ccache stats
109-
if: ${{!cancelled()}}
110-
run: |
111-
ccache -s
116+
ctest --preset=${CMAKE_PRESET}-app
112117
- name: Upload test results
113118
uses: actions/upload-artifact@v4
114119
if: >-
@@ -122,6 +127,18 @@ jobs:
122127
path: "test-output/**/*.xml"
123128
if-no-files-found: error
124129
retention-days: 1
130+
131+
### INSTALL ###
132+
133+
- name: Install
134+
working-directory: build
135+
run: |
136+
ninja install
137+
- name: Check installation
138+
working-directory: install
139+
run: |
140+
./bin/celer-sim --config
141+
125142
windows:
126143
defaults:
127144
run:
@@ -132,13 +149,26 @@ jobs:
132149
CMAKE_PRESET: fast
133150
runs-on: windows-latest
134151
steps:
152+
- name: Check out Celeritas
153+
uses: actions/checkout@v4
154+
155+
### ENVIRONMENT ###
156+
135157
- name: Install dependencies
136158
run: |
137159
choco install ninja ccache
138-
- name: Check out Celeritas
139-
uses: actions/checkout@v4
140160
- name: Set up MSVC
141161
uses: ilammy/msvc-dev-cmd@v1
162+
- name: Configure Celeritas
163+
run: |
164+
Copy-Item scripts/cmake-presets/ci-windows-github.json -Destination CMakeUserPresets.json
165+
cmake --preset=$Env:CMAKE_PRESET `
166+
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
167+
&& format(';-pr.{0};', github.event.pull_request.number)
168+
|| format(';-{0};', github.ref_name)}}"
169+
170+
### BUILD ###
171+
142172
- name: Cache ccache
143173
uses: actions/cache@v4
144174
with:
@@ -149,17 +179,18 @@ jobs:
149179
- name: Zero ccache stats
150180
run: |
151181
ccache -z
152-
- name: Configure Celeritas
153-
run: |
154-
Copy-Item scripts/cmake-presets/ci-windows-github.json -Destination CMakeUserPresets.json
155-
cmake --preset=$Env:CMAKE_PRESET `
156-
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
157-
&& format(';-pr.{0};', github.event.pull_request.number)
158-
|| format(';-{0};', github.ref_name)}}"
159182
- name: Build
160183
id: build
161184
run: |
162-
cmake --build --preset=$Env:CMAKE_PRESET
185+
cmake --version
186+
cmake --build --preset=$Env:CMAKE_PRESET
187+
- name: Show ccache stats
188+
if: ${{!cancelled()}}
189+
run: |
190+
ccache -s
191+
192+
### TEST ###
193+
163194
- name: Run unit tests
164195
id: unittest
165196
continue-on-error: true
@@ -170,18 +201,6 @@ jobs:
170201
if: ${{!cancelled() && steps.build.outcome == 'success'}}
171202
run: |
172203
ctest --preset=$Env:CMAKE_PRESET-app
173-
- name: Install
174-
working-directory: build
175-
run: |
176-
cmake --install .
177-
- name: Check installation
178-
working-directory: install
179-
run: |
180-
./bin/celer-sim --config
181-
- name: Show ccache stats
182-
if: ${{!cancelled()}}
183-
run: |
184-
ccache -s
185204
- name: Upload test results
186205
uses: actions/upload-artifact@v4
187206
if: >-
@@ -196,4 +215,15 @@ jobs:
196215
if-no-files-found: error
197216
retention-days: 1
198217

218+
### INSTALL ###
219+
220+
- name: Install
221+
working-directory: build
222+
run: |
223+
cmake --install .
224+
- name: Check installation
225+
working-directory: install
226+
run: |
227+
./bin/celer-sim --config
228+
199229
# vim: set nowrap tw=100:

0 commit comments

Comments
 (0)