2121 fail-fast : false
2222 matrix :
2323 include :
24- # -- Linux / GCC 14 --
24+ # -- Linux / GCC 13 --
2525 - os : ubuntu-24.04
26- compiler : gcc-14
26+ compiler : gcc-13
2727 preset : dev-gcc
2828
2929 # -- Linux / GCC 16 --
9696
9797 - name : Cache APT packages
9898 if : runner.os == 'Linux'
99+ continue-on-error : true
99100 uses : actions/cache@v5
100101 with :
101102 path : ~/.cache/apt/archives
@@ -119,17 +120,20 @@ jobs:
119120
120121 - name : Install libc++-18
121122 if : matrix.compiler == 'clang-18+libc++'
122- run : |
123- sudo apt-get install -y libc++-18-dev libc++abi-18-dev
123+ run : sudo apt-get install -y libc++-18-dev libc++abi-18-dev
124124
125- - name : Install Clang 22 + libc++
125+ - name : Install Clang 22
126126 if : startsWith(matrix.compiler, 'clang-22')
127127 run : |
128128 wget -q https://apt.llvm.org/llvm.sh
129- sudo bash llvm.sh 22 all
129+ sudo bash llvm.sh 22
130130 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200
131131 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200
132132
133+ - name : Install libc++-22
134+ if : matrix.compiler == 'clang-22+libc++'
135+ run : sudo apt-get install -y libc++-22-dev libc++abi-22-dev
136+
133137 - name : Fix APT cache permissions
134138 if : always() && runner.os == 'Linux'
135139 run : sudo rm -rf ~/.cache/apt/archives/lock ~/.cache/apt/archives/partial
@@ -138,77 +142,109 @@ jobs:
138142 # Main project
139143 # -----------------------------------------------------------------------
140144 - name : Configure
145+ id : configure
141146 run : cmake --preset ${{ matrix.preset }} -B build/${{ matrix.preset }}
142147
143148 - name : Build library (Debug)
149+ id : build_lib_debug
150+ if : >-
151+ always()
152+ && steps.configure.outcome == 'success'
144153 run : cmake --build build/${{ matrix.preset }} --config Debug
145154 --target _eggs_test _eggs_test_main
146155
147156 - name : Build tests (Debug)
148157 id : build_debug
149- continue-on-error : true
150- run : cmake --build build/${{ matrix.preset }} --config Debug -- -k 0
158+ if : >-
159+ always()
160+ && steps.configure.outcome == 'success'
161+ run : |
162+ cmake --build build/${{ matrix.preset }} --config Debug -- -k 0
151163
152164 - name : Run header tests (Debug)
153- if : steps.build_debug.outcome == 'success'
165+ id : test_header_debug
166+ if : >-
167+ always()
168+ && steps.build_debug.outcome == 'success'
154169 run : ctest --test-dir build/${{ matrix.preset }} --build-config Debug
155170 --label-regex header
156171 --output-on-failure
157172 --no-compress-output
158173 --output-junit test-results-${{ matrix.compiler }}-debug-header.xml
159174
160175 - name : Run unit tests (Debug)
161- if : steps.build_debug.outcome == 'success'
176+ id : test_unit_debug
177+ if : >-
178+ always()
179+ && steps.build_debug.outcome == 'success'
162180 run : ctest --test-dir build/${{ matrix.preset }} --build-config Debug
163181 --label-regex unit
164182 --output-on-failure
165183 --no-compress-output
166184 --output-junit test-results-${{ matrix.compiler }}-debug-unit.xml
167185
168186 - name : Run examples (Debug)
169- if : steps.build_debug.outcome == 'success'
187+ id : test_example_debug
188+ if : >-
189+ always()
190+ && steps.build_debug.outcome == 'success'
170191 run : ctest --test-dir build/${{ matrix.preset }} --build-config Debug
171192 --label-regex example
172193 --output-on-failure
173194 --no-compress-output
174195 --output-junit test-results-${{ matrix.compiler }}-debug-example.xml
175196
176197 - name : Build library (Release)
177- if : always()
198+ id : build_lib_release
199+ if : >-
200+ always()
201+ && steps.configure.outcome == 'success'
178202 run : cmake --build build/${{ matrix.preset }} --config Release
179203 --target _eggs_test _eggs_test_main
180204
181205 - name : Build tests (Release)
182206 id : build_release
183- if : always()
184- continue-on-error : true
207+ if : >-
208+ always()
209+ && steps.configure.outcome == 'success'
185210 run : cmake --build build/${{ matrix.preset }} --config Release -- -k 0
186211
187212 - name : Run header tests (Release)
188- if : steps.build_release.outcome == 'success'
213+ id : test_header_release
214+ if : >-
215+ always()
216+ && steps.build_release.outcome == 'success'
189217 run : ctest --test-dir build/${{ matrix.preset }} --build-config Release
190218 --label-regex header
191219 --output-on-failure
192220 --no-compress-output
193221 --output-junit test-results-${{ matrix.compiler }}-release-header.xml
194222
195223 - name : Run unit tests (Release)
196- if : steps.build_release.outcome == 'success'
224+ id : test_unit_release
225+ if : >-
226+ always()
227+ && steps.build_release.outcome == 'success'
197228 run : ctest --test-dir build/${{ matrix.preset }} --build-config Release
198229 --label-regex unit
199230 --output-on-failure
200231 --no-compress-output
201232 --output-junit test-results-${{ matrix.compiler }}-release-unit.xml
202233
203234 - name : Run examples (Release)
204- if : steps.build_release.outcome == 'success'
235+ id : test_example_release
236+ if : >-
237+ always()
238+ && steps.build_release.outcome == 'success'
205239 run : ctest --test-dir build/${{ matrix.preset }} --build-config Release
206240 --label-regex example
207241 --output-on-failure
208242 --no-compress-output
209243 --output-junit test-results-${{ matrix.compiler }}-release-example.xml
210244
211245 - name : Upload test results
246+ id : upload_test_results
247+ continue-on-error : true
212248 if : always()
213249 uses : actions/upload-artifact@v6
214250 with :
@@ -221,40 +257,55 @@ jobs:
221257 # (main only)
222258 # -----------------------------------------------------------------------
223259 - name : Copy Preset (FetchContent)
224- if : github.ref == 'refs/heads/main'
260+ id : fc_copy_preset
261+ if : >-
262+ always()
263+ && github.ref == 'refs/heads/main'
264+ && steps.configure.outcome == 'success'
225265 run : cp ./CMakePresets.json test/cmake-fetch_content
226266
227267 - name : Test Consumer (FetchContent) - Configure
228268 id : fc_configure
229- if : github.ref == 'refs/heads/main'
269+ if : >-
270+ always()
271+ && github.ref == 'refs/heads/main'
272+ && steps.configure.outcome == 'success'
230273 working-directory : test/cmake-fetch_content
231274 run : cmake --preset ${{ matrix.preset }} -B build-consumer-fetch_content
232275 -DEGGS_TEST_SOURCE_DIR=${{ github.workspace }}
233276
234277 - name : Test Consumer (FetchContent) - Build (Debug)
278+ id : fc_build_debug
235279 if : >-
236- github.ref == 'refs/heads/main'
280+ always()
281+ && github.ref == 'refs/heads/main'
237282 && steps.fc_configure.outcome == 'success'
238283 working-directory : test/cmake-fetch_content
239284 run : cmake --build build-consumer-fetch_content --config Debug
240285
241286 - name : Test Consumer (FetchContent) - Test (Debug)
287+ id : fc_test_debug
242288 if : >-
243- github.ref == 'refs/heads/main'
289+ always()
290+ && github.ref == 'refs/heads/main'
244291 && steps.fc_configure.outcome == 'success'
245292 working-directory : test/cmake-fetch_content
246293 run : ctest --test-dir build-consumer-fetch_content --build-config Debug -V
247294
248295 - name : Test Consumer (FetchContent) - Build (Release)
296+ id : fc_build_release
249297 if : >-
250- github.ref == 'refs/heads/main'
298+ always()
299+ && github.ref == 'refs/heads/main'
251300 && steps.fc_configure.outcome == 'success'
252301 working-directory : test/cmake-fetch_content
253302 run : cmake --build build-consumer-fetch_content --config Release
254303
255304 - name : Test Consumer (FetchContent) - Test (Release)
305+ id : fc_test_release
256306 if : >-
257- github.ref == 'refs/heads/main'
307+ always()
308+ && github.ref == 'refs/heads/main'
258309 && steps.fc_configure.outcome == 'success'
259310 working-directory : test/cmake-fetch_content
260311 run : ctest --test-dir build-consumer-fetch_content --build-config Release -V
@@ -265,21 +316,30 @@ jobs:
265316 # -----------------------------------------------------------------------
266317 - name : Test Install (Debug)
267318 id : install_debug
268- if : github.ref == 'refs/heads/main'
319+ if : >-
320+ always()
321+ && github.ref == 'refs/heads/main'
322+ && steps.build_lib_debug.outcome == 'success'
269323 run : cmake --install build/${{ matrix.preset }}
270324 --prefix ${{ runner.temp }}/eggs-test-install
271325 --config Debug
272326
273327 - name : Test Install (Release)
274328 id : install_release
275- if : github.ref == 'refs/heads/main'
329+ if : >-
330+ always()
331+ && github.ref == 'refs/heads/main'
332+ && steps.build_lib_release.outcome == 'success'
276333 run : cmake --install build/${{ matrix.preset }}
277334 --prefix ${{ runner.temp }}/eggs-test-install
278335 --config Release
279336
280337 - name : Upload installed package
338+ id : upload_installed_package
339+ continue-on-error : true
281340 if : >-
282- github.ref == 'refs/heads/main'
341+ always()
342+ && github.ref == 'refs/heads/main'
283343 && steps.install_debug.outcome == 'success'
284344 && steps.install_release.outcome == 'success'
285345 uses : actions/upload-artifact@v6
@@ -290,17 +350,26 @@ jobs:
290350 retention-days : 7
291351
292352 - name : Clean Source and Build Tree
293- if : github.ref == 'refs/heads/main'
353+ id : clean_source_build_tree
354+ if : >-
355+ always()
356+ && github.ref == 'refs/heads/main'
357+ && steps.configure.outcome == 'success'
294358 run : cmake -E rm -rf ./include ./src ./build
295359
296360 - name : Copy Preset (find_package)
297- if : github.ref == 'refs/heads/main'
361+ id : fp_copy_preset
362+ if : >-
363+ always()
364+ && github.ref == 'refs/heads/main'
365+ && steps.configure.outcome == 'success'
298366 run : cp ./CMakePresets.json test/cmake-find_package
299367
300368 - name : Test Consumer (find_package) - Configure
301369 id : fp_configure
302370 if : >-
303- github.ref == 'refs/heads/main'
371+ always()
372+ && github.ref == 'refs/heads/main'
304373 && steps.install_debug.outcome == 'success'
305374 && steps.install_release.outcome == 'success'
306375 working-directory : test/cmake-find_package
@@ -309,29 +378,46 @@ jobs:
309378 --debug-find-pkg=Eggs.Test
310379
311380 - name : Test Consumer (find_package) - Build (Debug)
381+ id : fp_build_debug
312382 if : >-
313- github.ref == 'refs/heads/main'
383+ always()
384+ && github.ref == 'refs/heads/main'
314385 && steps.fp_configure.outcome == 'success'
315386 working-directory : test/cmake-find_package
316387 run : cmake --build build-consumer-find_package --config Debug
317388
318389 - name : Test Consumer (find_package) - Test (Debug)
390+ id : fp_test_debug
319391 if : >-
320- github.ref == 'refs/heads/main'
392+ always()
393+ && github.ref == 'refs/heads/main'
321394 && steps.fp_configure.outcome == 'success'
322395 working-directory : test/cmake-find_package
323396 run : ctest --test-dir build-consumer-find_package --build-config Debug -V
324397
325398 - name : Test Consumer (find_package) - Build (Release)
399+ id : fp_build_release
326400 if : >-
327- github.ref == 'refs/heads/main'
401+ always()
402+ && github.ref == 'refs/heads/main'
328403 && steps.fp_configure.outcome == 'success'
329404 working-directory : test/cmake-find_package
330405 run : cmake --build build-consumer-find_package --config Release
331406
332407 - name : Test Consumer (find_package) - Test (Release)
408+ id : fp_test_release
333409 if : >-
334- github.ref == 'refs/heads/main'
410+ always()
411+ && github.ref == 'refs/heads/main'
335412 && steps.fp_configure.outcome == 'success'
336413 working-directory : test/cmake-find_package
337414 run : ctest --test-dir build-consumer-find_package --build-config Release -V
415+
416+ - name : Check all step outcomes
417+ if : always()
418+ shell : bash
419+ run : |
420+ failed=$(echo '${{ toJSON(steps) }}' | jq -r '[to_entries[] | select(.value.outcome == "failure") | .key] | join(", ")')
421+ if [ -n "$failed" ]; then
422+ echo "::error::Failed steps: $failed"
423+ fi
0 commit comments