1515 build :
1616 name : ${{ matrix.os }} / ${{ matrix.compiler }}
1717 runs-on : ${{ matrix.os }}
18+ timeout-minutes : 6
1819
1920 strategy :
2021 fail-fast : false
@@ -25,43 +26,113 @@ jobs:
2526 compiler : gcc-14
2627 preset : dev-gcc
2728
29+ # ── Linux / GCC 16 ──
30+ - os : ubuntu-24.04
31+ compiler : gcc-16
32+ preset : dev-gcc
33+
2834 # ── Linux / Clang 18 ──
35+ - os : ubuntu-24.04
36+ compiler : clang-18
37+ preset : dev-clang
38+
39+ # ── Linux / Clang 18 + libc++ ──
2940 - os : ubuntu-24.04
3041 compiler : clang-18+libc++
3142 preset : dev-clang-libcxx
3243
33- # ── macOS 15 / AppleClang 16 ──
34- - os : macos-15
35- compiler : apple- clang-16
44+ # ── Linux / Clang 22 ──
45+ - os : ubuntu-24.04
46+ compiler : clang-22
3647 preset : dev-clang
3748
38- # ── Windows 2022 / MSVC ──
49+ # ── Linux / Clang 22 + libc++ ──
50+ - os : ubuntu-24.04
51+ compiler : clang-22+libc++
52+ preset : dev-clang-libcxx
53+
54+ # ── Windows 2022 / MSVC 2022 ──
3955 - os : windows-2022
40- compiler : msvc
56+ compiler : msvc-2022
4157 preset : dev-msvc
4258
59+ # ── Windows 2025 / MSVC 2026 ──
60+ - os : windows-2025-vs2026
61+ compiler : msvc-2026
62+ preset : dev-msvc
63+
64+ # ── Windows 2025 / Clang-CL 20 ──
65+ - os : windows-2025-vs2026
66+ compiler : clang-cl-20
67+ preset : dev-clang-cl
68+
4369 steps :
4470 - uses : actions/checkout@v5
4571
4672 - name : Set up MSVC environment
47- if : matrix.compiler == 'msvc'
73+ if : startsWith( matrix.compiler, 'msvc') || startsWith(matrix.compiler, 'clang-cl')
4874 shell : pwsh
4975 run : |
50- $vcvars = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
76+ $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
77+ -latest -property installationPath
78+ $vcvars = "$vsPath\VC\Auxiliary\Build\vcvars64.bat"
5179 cmd /c "`"$vcvars`" && set" | ForEach-Object {
5280 if ($_ -match '^([^=]+)=(.*)$') {
5381 "$($Matches[1])=$($Matches[2])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
5482 }
5583 }
5684
57- - name : Install libc++
85+ - name : Set up APT package cache
86+ if : runner.os == 'Linux'
87+ run : |
88+ mkdir -p ~/.cache/apt/archives/partial
89+ echo "Dir::Cache::archives \"$HOME/.cache/apt/archives\";" \
90+ | sudo tee /etc/apt/apt.conf.d/99user-cache
91+
92+ - name : Cache APT packages
93+ if : runner.os == 'Linux'
94+ uses : actions/cache@v5
95+ with :
96+ path : ~/.cache/apt/archives
97+ key : apt-${{ matrix.os }}-${{ matrix.compiler }}-${{ hashFiles('.github/workflows/test.yml') }}
98+ restore-keys : apt-${{ matrix.os }}-${{ matrix.compiler }}-
99+
100+ - name : Install GCC 16
101+ if : matrix.compiler == 'gcc-16'
102+ run : |
103+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
104+ sudo apt-get update -q
105+ sudo apt-get install -y gcc-16 g++-16
106+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-16 100 \
107+ --slave /usr/bin/g++ g++ /usr/bin/g++-16
108+
109+ - name : Install Clang 18
110+ if : startsWith(matrix.compiler, 'clang-18')
111+ run : |
112+ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 200
113+ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 200
114+
115+ - name : Install libc++-18
58116 if : matrix.compiler == 'clang-18+libc++'
59- run : sudo apt-get install -y libc++-18-dev libc++abi-18-dev
117+ run : |
118+ sudo apt-get install -y libc++-18-dev libc++abi-18-dev
119+
120+ - name : Install Clang 22 + libc++
121+ if : startsWith(matrix.compiler, 'clang-22')
122+ run : |
123+ wget -q https://apt.llvm.org/llvm.sh
124+ sudo bash llvm.sh 22 all
125+ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200
126+ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200
60127
61128 - name : Install Ninja
62129 if : runner.os == 'Linux'
63130 run : sudo apt-get install -y ninja-build
64131
132+ - name : Fix APT cache permissions
133+ if : always() && runner.os == 'Linux'
134+ run : sudo rm -rf ~/.cache/apt/archives/lock ~/.cache/apt/archives/partial
135+
65136 - name : Check CMake Version
66137 run : cmake --version
67138
@@ -104,154 +175,122 @@ jobs:
104175
105176 # -----------------------------------------------------------------------
106177 # FetchContent variant — simulates embedding via FetchContent_MakeAvailable
178+ # (main only)
107179 # -----------------------------------------------------------------------
108180 - name : Copy Preset (FetchContent)
181+ if : github.ref == 'refs/heads/main'
109182 run : |
110183 cp ./CMakePresets.json test/cmake-fetch_content
111184 cp ./example/main.cpp test/cmake-fetch_content
112185
113186 - name : Test Consumer (FetchContent, static) — Configure
187+ if : github.ref == 'refs/heads/main'
114188 working-directory : test/cmake-fetch_content
115189 run : cmake --preset ${{ matrix.preset }} -B build-consumer-fetch_content
116190 -DEGGS_ASSERT_SOURCE_DIR=${{ github.workspace }}
117191
118192 - name : Test Consumer (FetchContent, static) — Build
193+ if : github.ref == 'refs/heads/main'
119194 working-directory : test/cmake-fetch_content
120195 run : cmake --build build-consumer-fetch_content --config Debug
121196
122197 - name : Test Consumer (FetchContent, static) — Test
198+ if : github.ref == 'refs/heads/main'
123199 working-directory : test/cmake-fetch_content
124200 run : ctest --test-dir build-consumer-fetch_content --build-config Debug -V
125201
126202 - name : Test Consumer (FetchContent, shared) — Configure
203+ if : github.ref == 'refs/heads/main'
127204 working-directory : test/cmake-fetch_content
128205 run : cmake --preset ${{ matrix.preset }} -B build-consumer-fetch_content-shared
129206 -DEGGS_ASSERT_SOURCE_DIR=${{ github.workspace }}
130207 -DEGGS_ASSERT_BUILD_SHARED_LIBS=ON
131208
132209 - name : Test Consumer (FetchContent, shared) — Build
210+ if : github.ref == 'refs/heads/main'
133211 working-directory : test/cmake-fetch_content
134212 run : cmake --build build-consumer-fetch_content-shared --config Debug
135213
136214 - name : Test Consumer (FetchContent, shared) — Test
215+ if : github.ref == 'refs/heads/main'
137216 working-directory : test/cmake-fetch_content
138217 run : ctest --test-dir build-consumer-fetch_content-shared --build-config Debug -V
139218
140219 # -----------------------------------------------------------------------
141220 # Install variant — simulates a real end-user find_package workflow
221+ # (main only)
142222 # -----------------------------------------------------------------------
143- - name : Test Install (static, Debug)
223+ - name : Test Install (static)
224+ if : github.ref == 'refs/heads/main'
144225 run : cmake --install build/${{ matrix.preset }}-static
145- --prefix ${{ runner.temp }}/eggs-assert-install-static-debug
226+ --prefix ${{ runner.temp }}/eggs-assert-install-static
146227 --config Debug
147228
148- - name : Upload installed package (static, Debug)
229+ - name : Upload installed package (static)
230+ if : github.ref == 'refs/heads/main'
149231 uses : actions/upload-artifact@v6
150232 with :
151- name : installed-package-${{ matrix.compiler }}-static-debug
152- path : ${{ runner.temp }}/eggs-assert-install-static-debug
233+ name : installed-package-${{ matrix.compiler }}-static
234+ path : ${{ runner.temp }}/eggs-assert-install-static
153235 if-no-files-found : error
154236 retention-days : 7
155237
156- - name : Test Install (static, Release)
157- run : cmake --install build/${{ matrix.preset }}-static
158- --prefix ${{ runner.temp }}/eggs-assert-install-static-release
159- --config Release
160-
161- - name : Upload installed package (static, Release)
162- uses : actions/upload-artifact@v6
163- with :
164- name : installed-package-${{ matrix.compiler }}-static-release
165- path : ${{ runner.temp }}/eggs-assert-install-static-release
166- if-no-files-found : error
167- retention-days : 7
168-
169- - name : Test Install (shared, Debug)
238+ - name : Test Install (shared)
239+ if : github.ref == 'refs/heads/main'
170240 run : cmake --install build/${{ matrix.preset }}-shared
171- --prefix ${{ runner.temp }}/eggs-assert-install-shared-debug
241+ --prefix ${{ runner.temp }}/eggs-assert-install-shared
172242 --config Debug
173243
174- - name : Upload installed package (shared, Debug)
175- uses : actions/upload-artifact@v6
176- with :
177- name : installed-package-${{ matrix.compiler }}-shared-debug
178- path : ${{ runner.temp }}/eggs-assert-install-shared-debug
179- if-no-files-found : error
180- retention-days : 7
181-
182- - name : Test Install (shared, Release)
183- run : cmake --install build/${{ matrix.preset }}-shared
184- --prefix ${{ runner.temp }}/eggs-assert-install-shared-release
185- --config Release
186-
187- - name : Upload installed package (shared, Release)
244+ - name : Upload installed package (shared)
245+ if : github.ref == 'refs/heads/main'
188246 uses : actions/upload-artifact@v6
189247 with :
190- name : installed-package-${{ matrix.compiler }}-shared-release
191- path : ${{ runner.temp }}/eggs-assert-install-shared-release
248+ name : installed-package-${{ matrix.compiler }}-shared
249+ path : ${{ runner.temp }}/eggs-assert-install-shared
192250 if-no-files-found : error
193251 retention-days : 7
194252
195253 - name : Clean Source and Build Tree
254+ if : github.ref == 'refs/heads/main'
196255 run : cmake -E rm -rf ./include ./src ./build
197256
198257 - name : Copy Preset (find_package)
258+ if : github.ref == 'refs/heads/main'
199259 run : |
200260 cp ./CMakePresets.json test/cmake-find_package
201261 cp ./example/main.cpp test/cmake-find_package
202262
203- - name : Test Consumer (find_package, static, Debug) — Configure
263+ - name : Test Consumer (find_package, static) — Configure
264+ if : github.ref == 'refs/heads/main'
204265 working-directory : test/cmake-find_package
205- run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-static-debug
206- -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-static-debug
266+ run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-static
267+ -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-static
207268 --debug-find-pkg=Eggs.Assert
208269
209- - name : Test Consumer (find_package, static, Debug) — Build
270+ - name : Test Consumer (find_package, static) — Build
271+ if : github.ref == 'refs/heads/main'
210272 working-directory : test/cmake-find_package
211- run : cmake --build build-consumer-find_package-static-debug --config Debug
273+ run : cmake --build build-consumer-find_package-static --config Debug
212274
213- - name : Test Consumer (find_package, static, Debug) — Test
275+ - name : Test Consumer (find_package, static) — Test
276+ if : github.ref == 'refs/heads/main'
214277 working-directory : test/cmake-find_package
215- run : ctest --test-dir build-consumer-find_package-static-debug --build-config Debug -V
278+ run : ctest --test-dir build-consumer-find_package-static --build-config Debug -V
216279
217- - name : Test Consumer (find_package, static, Release) — Configure
280+ - name : Test Consumer (find_package, shared) — Configure
281+ if : github.ref == 'refs/heads/main'
218282 working-directory : test/cmake-find_package
219- run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-static-release
220- -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-static-release
283+ run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-shared
284+ -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-shared
221285 --debug-find-pkg=Eggs.Assert
222286
223- - name : Test Consumer (find_package, static, Release) — Build
287+ - name : Test Consumer (find_package, shared) — Build
288+ if : github.ref == 'refs/heads/main'
224289 working-directory : test/cmake-find_package
225- run : cmake --build build-consumer-find_package-static-release --config Release
290+ run : cmake --build build-consumer-find_package-shared --config Debug
226291
227- - name : Test Consumer (find_package, static, Release) — Test
292+ - name : Test Consumer (find_package, shared) — Test
293+ if : github.ref == 'refs/heads/main'
228294 working-directory : test/cmake-find_package
229- run : ctest --test-dir build-consumer-find_package-static-release --build-config Release -V
295+ run : ctest --test-dir build-consumer-find_package-shared --build-config Debug -V
230296
231- - name : Test Consumer (find_package, shared, Debug) — Configure
232- working-directory : test/cmake-find_package
233- run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-shared-debug
234- -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-shared-debug
235- --debug-find-pkg=Eggs.Assert
236-
237- - name : Test Consumer (find_package, shared, Debug) — Build
238- working-directory : test/cmake-find_package
239- run : cmake --build build-consumer-find_package-shared-debug --config Debug
240-
241- - name : Test Consumer (find_package, shared, Debug) — Test
242- working-directory : test/cmake-find_package
243- run : ctest --test-dir build-consumer-find_package-shared-debug --build-config Debug -V
244-
245- - name : Test Consumer (find_package, shared, Release) — Configure
246- working-directory : test/cmake-find_package
247- run : cmake --preset ${{ matrix.preset }} -B build-consumer-find_package-shared-release
248- -DCMAKE_PREFIX_PATH=${{ runner.temp }}/eggs-assert-install-shared-release
249- --debug-find-pkg=Eggs.Assert
250-
251- - name : Test Consumer (find_package, shared, Release) — Build
252- working-directory : test/cmake-find_package
253- run : cmake --build build-consumer-find_package-shared-release --config Release
254-
255- - name : Test Consumer (find_package, shared, Release) — Test
256- working-directory : test/cmake-find_package
257- run : ctest --test-dir build-consumer-find_package-shared-release --build-config Release -V
0 commit comments