@@ -119,69 +119,71 @@ jobs:
119119 # -----------------------------------------------------------------------
120120 # Main project
121121 # -----------------------------------------------------------------------
122- - name : Build and test
123- id : build_and_test
124- shell : bash
125- run : |
126- compiler_args=()
127- if [ -n "${{ matrix.cc }}" ]; then
128- compiler_args+=(-DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }})
129- fi
130-
131- overall_failed=0
132- for std in ${{ matrix.cxxstds }}; do
133- std_failed=0
134-
135- echo "::group::Configure C++${std}"
136- cmake --preset ${{ matrix.preset }} -B build/${{ matrix.preset }}-cxx${std} \
137- "${compiler_args[@]}" \
138- -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON \
139- -DCMAKE_CXX_STANDARD=${std} || std_failed=1
140- echo "::endgroup::"
141-
142- if [ $std_failed -eq 0 ]; then
143- echo "::group::Build Debug C++${std}"
144- cmake --build build/${{ matrix.preset }}-cxx${std} --config Debug -- -k 0 || std_failed=1
145- echo "::endgroup::"
146- fi
147-
148- if [ $std_failed -eq 0 ]; then
149- echo "::group::Test Debug C++${std}"
150- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Debug \
151- --label-regex header --output-on-failure --no-compress-output \
152- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-debug-header.xml || std_failed=1
153- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Debug \
154- --label-regex unit --output-on-failure --no-compress-output \
155- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-debug-unit.xml || std_failed=1
156- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Debug \
157- --label-regex example --verbose --no-compress-output \
158- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-debug-example.xml || std_failed=1
159- echo "::endgroup::"
160- fi
161-
162- if [ $std_failed -eq 0 ]; then
163- echo "::group::Build Release C++${std}"
164- cmake --build build/${{ matrix.preset }}-cxx${std} --config Release -- -k 0 || std_failed=1
165- echo "::endgroup::"
166- fi
167-
168- if [ $std_failed -eq 0 ]; then
169- echo "::group::Test Release C++${std}"
170- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Release \
171- --label-regex header --output-on-failure --no-compress-output \
172- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-release-header.xml || std_failed=1
173- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Release \
174- --label-regex unit --output-on-failure --no-compress-output \
175- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-release-unit.xml || std_failed=1
176- ctest --test-dir build/${{ matrix.preset }}-cxx${std} --build-config Release \
177- --label-regex example --verbose --no-compress-output \
178- --output-junit test-results-${{ matrix.compiler }}-cxx${std}-release-example.xml || std_failed=1
179- echo "::endgroup::"
180- fi
181-
182- [ $std_failed -ne 0 ] && overall_failed=1
183- done
184- exit $overall_failed
122+ - name : Build and test C++11
123+ id : build_test_cxx11
124+ if : contains(matrix.cxxstds, '11')
125+ uses : ./.github/actions/build-test-std
126+ with :
127+ std : " 11"
128+ preset : ${{ matrix.preset }}
129+ compiler : ${{ matrix.compiler }}
130+ cc : ${{ matrix.cc }}
131+ cxx : ${{ matrix.cxx }}
132+
133+ - name : Build and test C++14
134+ id : build_test_cxx14
135+ if : always() && contains(matrix.cxxstds, '14')
136+ uses : ./.github/actions/build-test-std
137+ with :
138+ std : " 14"
139+ preset : ${{ matrix.preset }}
140+ compiler : ${{ matrix.compiler }}
141+ cc : ${{ matrix.cc }}
142+ cxx : ${{ matrix.cxx }}
143+
144+ - name : Build and test C++17
145+ id : build_test_cxx17
146+ if : always() && contains(matrix.cxxstds, '17')
147+ uses : ./.github/actions/build-test-std
148+ with :
149+ std : " 17"
150+ preset : ${{ matrix.preset }}
151+ compiler : ${{ matrix.compiler }}
152+ cc : ${{ matrix.cc }}
153+ cxx : ${{ matrix.cxx }}
154+
155+ - name : Build and test C++20
156+ id : build_test_cxx20
157+ if : always() && contains(matrix.cxxstds, '20')
158+ uses : ./.github/actions/build-test-std
159+ with :
160+ std : " 20"
161+ preset : ${{ matrix.preset }}
162+ compiler : ${{ matrix.compiler }}
163+ cc : ${{ matrix.cc }}
164+ cxx : ${{ matrix.cxx }}
165+
166+ - name : Build and test C++23
167+ id : build_test_cxx23
168+ if : always() && contains(matrix.cxxstds, '23')
169+ uses : ./.github/actions/build-test-std
170+ with :
171+ std : " 23"
172+ preset : ${{ matrix.preset }}
173+ compiler : ${{ matrix.compiler }}
174+ cc : ${{ matrix.cc }}
175+ cxx : ${{ matrix.cxx }}
176+
177+ - name : Build and test C++26
178+ id : build_test_cxx26
179+ if : always() && contains(matrix.cxxstds, '26')
180+ uses : ./.github/actions/build-test-std
181+ with :
182+ std : " 26"
183+ preset : ${{ matrix.preset }}
184+ compiler : ${{ matrix.compiler }}
185+ cc : ${{ matrix.cc }}
186+ cxx : ${{ matrix.cxx }}
185187
186188 - name : Upload test results
187189 id : upload_test_results
0 commit comments