@@ -139,7 +139,44 @@ jobs:
139139
140140 strategy :
141141 fail-fast : false
142+
143+ # Our basic matrix is compiler-version x build-test-config. The latter is the usual possibilities namely
144+ # Debug, Release, ..., plus a few runtime-sanitizer-oriented variations. Generally we want to run the entire
145+ # cross-product AxB of possibilities; but for various reasons we exclude some specific combinations from the
146+ # matrix. So far, then: specify full matrix, specify certain combos to remove from it.
147+ #
148+ # There is however another variable: the C++ standard to specify. In actual practice -- as explained in
149+ # FlowLikeCodeGenerate.cmake, but we *very* briefly recap -- the min required standard is 17, and it is indeed
150+ # *the* standard we use, never taking advantage (via conditional compilation, etc.) of 20-or-higher. So,
151+ # the main matrix shall built with std=17. In addition, though, we *allow* C++20 or higher. In practice, 99.999%
152+ # C++17 code shall build equivalently with C++20 (as for C++23, we haven't looked into it as of this writing);
153+ # but not 100%, and indeed for business reasons we found it is worthwhile to *test* with C++20 as well, so
154+ # as to ensure code will (at least) build (and thus not mess-over C++20 users; it is now 2025 as of this writing).
155+ # However, loosely speaking, we need only hit a few basic setups likeliest to trigger problems (usually warnings)
156+ # which we'd then fix in the code. Long story short then: in addition to the aforementioned matrix (w/ 17),
157+ # minus exclusions, we would *add* a few specific configs with std=20.
158+ #
159+ # Delightfully that's just how GitHub Actions matrix specs work: The matrix, then remove `exclude`s, then
160+ # add `include`s. ...Unfortunately, nope, the `include`s cannot simply refer to earlier-defined things in
161+ # the matrix, so for example all the properties of a given compiler (e.g. gcc-13: name, version, c-path, cpp-path,
162+ # install) would need to be copy/pasted (stylistically awful/error-prone). (TODO: Perhaps there's some way
163+ # to predefine each compiler's "stuff" in some earlier variable type thing and then just refer to it -- maybe
164+ # something with outputs and fromJSON()... I (ygoldfel) was unable to find clean solid docs/example(s) thereof,
165+ # but a real Actions+YAML badass could probably figure it out. Maybe. OH! And YAML anchors/aliases would be
166+ # *perfect* for this... but Actions guys have somehow not implemented them; it is a long-standing
167+ # request [https://github.com/actions/runner/issues/1182#issuecomment-2317953582].) Hence, for now, we are
168+ # forced to express these post-exclude-includes as simply more excludes. E.g., instead of saying "for C++20
169+ # do just gcc-13" say "do the full matrix but exclude C++20 + gcc-9,10,11."
170+ #
171+ # So now do all that.
142172 matrix :
173+ # First axis in basic 3D matrix is the 2 possible C++ standards.
174+ # For simplicity the Conan-profile-configuring script step simply keys off the `id` instead of our defining
175+ # other properties as for the other 2 more complex axes below (compiler, build config).
176+ cxx-std :
177+ - id : cxx17
178+ - id : cxx20
179+ # Second axis = the many compilers (gcc multiple versions, clang multiple versions).
143180 compiler :
144181 - id : gcc-9
145182 name : gcc
@@ -184,6 +221,7 @@ jobs:
184221 c-path : /usr/bin/clang-17
185222 cpp-path : /usr/bin/clang++-17
186223 install : True
224+ # Last axis are the many build/test configs.
187225 build-test-cfg :
188226 - id : debug
189227 conan-profile-build-type : Debug
@@ -245,43 +283,111 @@ jobs:
245283 sanitizer-name : tsan
246284 no-lto : True
247285
248- # Again, these exclusions are explained in FLow-IPC workflow counterpart.
286+ # Remove certain values from the 3D matrix so far.
287+ # The overall strategy is outlined in a large-ish comment above.
249288 exclude :
250- - compiler : { id: gcc-9 }
289+ # Firstly the exclusions from the C++17 sub-matrix (the other being the C++20 sub-matrix).
290+ # Again, these exclusions are explained in Flow-IPC workflow counterpart.
291+ - cxx-std : { id: cxx17 }
292+ compiler : { id: gcc-9 }
251293 build-test-cfg : { id: relwithdebinfo-asan }
252- - compiler : { id: gcc-10 }
294+ - cxx-std : { id: cxx17 }
295+ compiler : { id: gcc-10 }
253296 build-test-cfg : { id: relwithdebinfo-asan }
254- - compiler : { id: gcc-11 }
297+ - cxx-std : { id: cxx17 }
298+ compiler : { id: gcc-11 }
255299 build-test-cfg : { id: relwithdebinfo-asan }
256- - compiler : { id: gcc-13 }
300+ - cxx-std : { id: cxx17 }
301+ compiler : { id: gcc-13 }
257302 build-test-cfg : { id: relwithdebinfo-asan }
258- - compiler : { id: clang-13 }
303+ - cxx-std : { id: cxx17 }
304+ compiler : { id: clang-13 }
259305 build-test-cfg : { id: relwithdebinfo-asan }
260- - compiler : { id: gcc-9 }
306+ - cxx-std : { id: cxx17 }
307+ compiler : { id: gcc-9 }
261308 build-test-cfg : { id: relwithdebinfo-ubsan }
262- - compiler : { id: gcc-10 }
309+ - cxx-std : { id: cxx17 }
310+ compiler : { id: gcc-10 }
263311 build-test-cfg : { id: relwithdebinfo-ubsan }
264- - compiler : { id: gcc-11 }
312+ - cxx-std : { id: cxx17 }
313+ compiler : { id: gcc-11 }
265314 build-test-cfg : { id: relwithdebinfo-ubsan }
266- - compiler : { id: gcc-13 }
315+ - cxx-std : { id: cxx17 }
316+ compiler : { id: gcc-13 }
267317 build-test-cfg : { id: relwithdebinfo-ubsan }
268- - compiler : { id: clang-13 }
318+ - cxx-std : { id: cxx17 }
319+ compiler : { id: clang-13 }
269320 build-test-cfg : { id: relwithdebinfo-ubsan }
270- - compiler : { id: gcc-9 }
321+ - cxx-std : { id: cxx17 }
322+ compiler : { id: gcc-9 }
323+ build-test-cfg : { id: relwithdebinfo-tsan }
324+ - cxx-std : { id: cxx17 }
325+ compiler : { id: gcc-10 }
271326 build-test-cfg : { id: relwithdebinfo-tsan }
272- - compiler : { id: gcc-10 }
327+ - cxx-std : { id: cxx17 }
328+ compiler : { id: gcc-11 }
273329 build-test-cfg : { id: relwithdebinfo-tsan }
274- - compiler : { id: gcc-11 }
330+ - cxx-std : { id: cxx17 }
331+ compiler : { id: gcc-13 }
275332 build-test-cfg : { id: relwithdebinfo-tsan }
276- - compiler : { id: gcc-13 }
333+ - cxx-std : { id: cxx17 }
334+ compiler : { id: clang-13 }
277335 build-test-cfg : { id: relwithdebinfo-tsan }
278- - compiler : { id: clang-13 }
336+ # Now the exclusions from the C++20 sub-matrix.
337+ # The basic strategy is noted above; but specifically release-oriented builds tend to go down different
338+ # paths/produce different warnings vs debug-oriented builds -- so we want to try both; and as for which
339+ # compilers to use, on one hand we'll definitely want at least 1 of gcc and clang each, but beyond that
340+ # just the highest version of each is sufficient. TODO: Revisit, especially if users report C++20 problems
341+ # in other environments, and therefore we will have had to fix them; hence test coverage should increase.
342+ #
343+ # So, we essentially want something like:
344+ # include:
345+ # # gcc-<highest> x (2 build-configs).
346+ # - cxx-std: { id: cxx20 }
347+ # compiler: { id: gcc-13 }
348+ # build-test-cfg: { id: debug }
349+ # - cxx-std: { id: cxx20 }
350+ # compiler: { id: gcc-13 }
351+ # build-test-cfg: { id: relwithdebinfo }
352+ # # clang-<highest> x (2 build-configs).
353+ # - cxx-std: { id: cxx20 }
354+ # compiler: { id: clang-17 }
355+ # build-test-cfg: { id: debug }
356+ # - cxx-std: { id: cxx20 }
357+ # compiler: { id: clang-17 }
358+ # build-test-cfg: { id: relwithdebinfo }
359+ # Sadly, as mentioned in the large-ish comment nearer the top, `include` does not let us refer to
360+ # earlier-defined things simply by their `id`s. So we choose to express the inclusions as exclusions
361+ # instead:
362+ # - First, simply exclude all gccs but gcc-13 and all clangs but clang-17.
363+ - cxx-std : { id: cxx20 }
364+ compiler : { id: gcc-9 }
365+ - cxx-std : { id: cxx20 }
366+ compiler : { id: gcc-10 }
367+ - cxx-std : { id: cxx20 }
368+ compiler : { id: gcc-11 }
369+ - cxx-std : { id: cxx20 }
370+ compiler : { id: clang-13 }
371+ - cxx-std : { id: cxx20 }
372+ compiler : { id: clang-15 }
373+ - cxx-std : { id: cxx20 }
374+ compiler : { id: clang-16 }
375+ # - Second, among the remaining C++20 configs eliminate all but debug and relwithdebinfo ones.
376+ - cxx-std : { id: cxx20 }
377+ build-test-cfg : { id: release }
378+ - cxx-std : { id: cxx20 }
379+ build-test-cfg : { id: minsizerel }
380+ - cxx-std : { id: cxx20 }
381+ build-test-cfg : { id: relwithdebinfo-asan }
382+ - cxx-std : { id: cxx20 }
383+ build-test-cfg : { id: relwithdebinfo-ubsan }
384+ - cxx-std : { id: cxx20 }
279385 build-test-cfg : { id: relwithdebinfo-tsan }
280386
281387 # Not using ubuntu-latest, so as to avoid surprises with OS upgrades and such.
282388 runs-on : ubuntu-22.04
283389
284- name : ${{ matrix.compiler.id }}-${{ matrix.build-test-cfg.id }}
390+ name : ${{ matrix.compiler.id }}-${{ matrix.build-test-cfg.id }}-${{ matrix.cxx-std.id }}
285391
286392 env :
287393 build-dir : ${{ github.workspace }}/build/${{ matrix.build-test-cfg.conan-profile-build-type }}
@@ -383,7 +489,7 @@ jobs:
383489 [settings]
384490 compiler = ${{ matrix.compiler.name }}
385491 compiler.version = ${{ matrix.compiler.version }}
386- compiler.cppstd = 17
492+ compiler.cppstd = ${{ ((matrix.cxx-std.id == 'cxx20') && '20') || '17' }}
387493 # TODO: Consider testing with LLVM-libc++ also (with clang anyway).
388494 compiler.libcxx = libstdc++11
389495 arch = x86_64
@@ -403,6 +509,10 @@ jobs:
403509 [options]
404510 flow:build = True
405511 flow:doc = False
512+ # `0` here as of this writing would effectively mean `17` too. Specifying `17` explicitly has the same
513+ # effect in the end but goes down a slightly different code-path in FlowLikeCodeGenerate.cmake. It's not
514+ # a huge deal... but it's a little nice to cover more paths, so let's do the `0` path when applicable.
515+ flow:build_cxx_std = ${{ ((matrix.cxx-std.id == 'cxx20') && '20') || '0' }}
406516 EOF
407517
408518 - name : Install Flow dependencies with Conan using the profile
@@ -517,7 +627,7 @@ jobs:
517627 always()
518628 uses : actions/upload-artifact@v4
519629 with :
520- name : flow-test-logs-${{ matrix.compiler.id }}-${{ matrix.build-test-cfg.id }}
630+ name : flow-test-logs-${{ matrix.compiler.id }}-${{ matrix.build-test-cfg.id }}-${{ matrix.cxx-std.id }}
521631 path : ${{ env.install-dir }}/bin/logs.tgz
522632
523633 doc-and-release :
0 commit comments