From f4b4393c2b3523658f28d2bfb219b841531521cf Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 08:56:50 +0200 Subject: [PATCH 01/86] removed on merge group trigger - no longer relevant --- .github/workflows/clang_tidy.yaml | 1 - .github/workflows/linux_build_test.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 0a54f98b..fc1c8a07 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -4,7 +4,6 @@ on: workflow_dispatch: pull_request: branches: [ main ] - merge_group: concurrency: group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index e6578fdc..c7ec118c 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -4,7 +4,6 @@ on: workflow_dispatch: pull_request: branches: [ main ] - merge_group: permissions: contents: read From 36d08817b9e6928dce34486b7251cc83b96eb898 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:06:15 +0200 Subject: [PATCH 02/86] First test for macos runners --- .github/workflows/macos_build.yaml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/macos_build.yaml diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml new file mode 100644 index 00000000..7cb10a75 --- /dev/null +++ b/.github/workflows/macos_build.yaml @@ -0,0 +1,41 @@ +name: MacOS ARM Build Test + +on: + workflow_dispatch: + pull_request: + types: [labeled, synchronize] + +jobs: + macos-arm-build: + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + runs-on: macos-26 + name: ${{ matrix.test_preset }} + + concurrency: + group: pr-${{ github.event.pull_request.number }}-macos-arm-build + cancel-in-progress: true + + strategy: + matrix: + include: + - name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug + test_preset: quick-validation-clang-debug + # - name: clang_release + # configure_preset: clang_release + # build_preset: clang_release + # test_preset: quick-validation-clang-release + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + brew --version + brew list + clang++ --version + clang-tidy --version + clang-format --version + cmake --version + ninja --version From 93401daef52599e64551e5a81ee02649b3ac6d1e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:08:28 +0200 Subject: [PATCH 03/86] updated triggers to run only the action that is wip --- .github/workflows/clang_tidy.yaml | 4 ++-- .github/workflows/linux_build_test.yaml | 4 ++-- .github/workflows/macos_build.yaml | 5 +++-- .github/workflows/windows_build_test.yaml | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index fc1c8a07..56b87828 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -2,8 +2,8 @@ name: Clang Tidy Linting on: workflow_dispatch: - pull_request: - branches: [ main ] + # pull_request: + # branches: [ main ] concurrency: group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index c7ec118c..9d3957ad 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -2,8 +2,8 @@ name: Linux Build Test on: workflow_dispatch: - pull_request: - branches: [ main ] + # pull_request: + # branches: [ main ] permissions: contents: read diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 7cb10a75..c6a64487 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -2,8 +2,9 @@ name: MacOS ARM Build Test on: workflow_dispatch: - pull_request: - types: [labeled, synchronize] + push: + # pull_request: + # types: [labeled, synchronize] jobs: macos-arm-build: diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 5b02aa4f..1abbbe47 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -2,8 +2,8 @@ name: Windows Build Test on: workflow_dispatch: - pull_request: - types: [labeled, synchronize] + # pull_request: + # types: [labeled, synchronize] jobs: windows-build: From 50555a4480f18e35b80c70aecc596c6d6858af39 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:10:54 +0200 Subject: [PATCH 04/86] trigger the workflow --- .github/workflows/macos_build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index c6a64487..2029db18 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -40,3 +40,4 @@ jobs: clang-format --version cmake --version ninja --version + vcpkg --version From 3afdb1a111c498d701e9a1a924bc682ccfeec49e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:11:59 +0200 Subject: [PATCH 05/86] oups, removed condition that was canceling the job --- .github/workflows/macos_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 2029db18..069ff073 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -8,7 +8,7 @@ on: jobs: macos-arm-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: macos-26 name: ${{ matrix.test_preset }} From b9a4ba0ae89a13f97c23b47a794777eadcfc6b6f Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:16:18 +0200 Subject: [PATCH 06/86] added vcpkg installation --- .github/workflows/macos_build.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 069ff073..eb5607c3 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -35,9 +35,16 @@ jobs: run: | brew --version brew list + clang++ --version - clang-tidy --version - clang-format --version - cmake --version - ninja --version - vcpkg --version + + cmake --version || true + ninja --version || true + vcpkg --version || true + + - name: Setup vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg + /tmp/vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV + echo "/tmp/vcpkg" >> $GITHUB_PATH From c52ec8a533afde763e1746fb5a412f1400b7c74a Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:19:09 +0200 Subject: [PATCH 07/86] testing configure step --- .github/workflows/macos_build.yaml | 37 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index eb5607c3..fd0fcee1 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -31,20 +31,25 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install dependencies + - name: Configure (${{ matrix.configure_preset }}) + shell: bash run: | - brew --version - brew list - - clang++ --version - - cmake --version || true - ninja --version || true - vcpkg --version || true - - - name: Setup vcpkg - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH + set +e + cmake --preset ${{ matrix.configure_preset }} 2>&1 | tee configure_output.txt + CONFIGURE_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then + echo "
🟢 Configure Results (click to expand)" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 Configure Results" >> $GITHUB_STEP_SUMMARY + fi + echo '' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat configure_output.txt >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $CONFIGURE_EXIT_CODE From 9b5beea88fa1ac1152f0dac42945d2e99991a257 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:26:08 +0200 Subject: [PATCH 08/86] trying to find the location of the vcpkg binary + toolchain --- .github/workflows/macos_build.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index fd0fcee1..5ae0b5c8 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -31,6 +31,17 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Setup vcpkg + run: | + brew install tree + tree -d + where vcpkg || true + whereis vcpkg || true + which vcpkg || true + echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV + echo "/tmp/vcpkg" >> $GITHUB_PATH + exit 0 + - name: Configure (${{ matrix.configure_preset }}) shell: bash run: | From 858781d5b6d6b81c65c8fac16a2788b66b712f39 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:29:59 +0200 Subject: [PATCH 09/86] test --- .github/workflows/macos_build.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 5ae0b5c8..99005349 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -34,13 +34,10 @@ jobs: - name: Setup vcpkg run: | brew install tree - tree -d - where vcpkg || true - whereis vcpkg || true - which vcpkg || true - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH - exit 0 + tree /usr/local/bin/vcpkg -d + VCPKG_PATH=$(which vcpkg) + echo "VCPKG_ROOT=$VCPKG_PATH" >> $GITHUB_ENV + echo "$VCPKG_PATH" >> $GITHUB_PATH - name: Configure (${{ matrix.configure_preset }}) shell: bash From 80c0cbc172cb6f293537c3e3c7f16cb9d4431de9 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:39:01 +0200 Subject: [PATCH 10/86] using pre installed vcpkg --- .github/workflows/macos_build.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 99005349..e7cc1be5 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -31,13 +31,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup vcpkg + - name: Use Pre-installed vcpkg run: | - brew install tree - tree /usr/local/bin/vcpkg -d - VCPKG_PATH=$(which vcpkg) - echo "VCPKG_ROOT=$VCPKG_PATH" >> $GITHUB_ENV - echo "$VCPKG_PATH" >> $GITHUB_PATH + echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV + which vcpkg - name: Configure (${{ matrix.configure_preset }}) shell: bash From 83d22395b1886019623d8dddc1a030cf096badd4 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 09:58:56 +0200 Subject: [PATCH 11/86] made coverage targets optional instead of mandatory, since it blocks the build --- cmake/coverage/define_coverage_targets.cmake | 300 ++++++++++--------- 1 file changed, 162 insertions(+), 138 deletions(-) diff --git a/cmake/coverage/define_coverage_targets.cmake b/cmake/coverage/define_coverage_targets.cmake index fef95881..4af9643d 100644 --- a/cmake/coverage/define_coverage_targets.cmake +++ b/cmake/coverage/define_coverage_targets.cmake @@ -11,141 +11,165 @@ # - https://clang.llvm.org/docs/SourceBasedCodeCoverage.html # - https://llvm.org/docs/CommandGuide/llvm-cov.html -if (ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") - message(STATUS "Enabling LLVM coverage tools") - - message(STATUS "Coverage Build: Downgrading CX macros to runtime for tests instrumentation.") - add_compile_definitions(COVERAGE_BUILD) # see include/bitbishop/config.hpp - - find_program(LLVM_PROFDATA llvm-profdata REQUIRED) - find_program(LLVM_COV llvm-cov REQUIRED) - - add_compile_options( - -fprofile-instr-generate - -fcoverage-mapping - ) - add_link_options( - -fprofile-instr-generate - ) - - # Coverage tier selection - # Must match the tier used by the CTest preset - set(CTEST_PRESET "quick-validation-clang-debug" - CACHE STRING "Coverage tier (quick-validation-clang-debug, intermediate-validation-clang-debug, deep-validation-clang-debug, full-suite-clang-debug)") - - set(COVERAGE_BASE_DIR "${CMAKE_BINARY_DIR}/coverage") - set(COVERAGE_DIR "${COVERAGE_BASE_DIR}/${CTEST_PRESET}") - set(PROFDATA_FILE "${COVERAGE_DIR}/coverage.profdata") - set(TESTS_BIN_DIR "${CMAKE_BINARY_DIR}/tests") - - # Internal target to run tests for the specified ctest preset - # This target is then used as a dependency for subsequent custom targets - add_custom_target(_coverage-run-tests - COMMAND ${CMAKE_CTEST_COMMAND} --preset ${CTEST_PRESET} --output-on-failure - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMENT "Running tests for preset ${CTEST_PRESET}" - USES_TERMINAL - ) - - # Internal target to merge raw coverage profiles - # Triggers automatically the tests before running - # Creates the coverage directory if non-existing (indempotent) - add_custom_target(_coverage-merge - COMMAND ${CMAKE_COMMAND} -E make_directory "${COVERAGE_DIR}" - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DLLVM_PROFDATA=${LLVM_PROFDATA}" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_merge.cmake" - BYPRODUCTS "${PROFDATA_FILE}" - COMMENT "Merging LLVM coverage profiles for ${CTEST_PRESET}" - VERBATIM - ) - add_dependencies(_coverage-merge _coverage-run-tests) - - # Public target allowing to generate html (css, js) coverage report - # Triggers automatically the tests and coverage merge before running - add_custom_target(coverage-html - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" - "-DCTEST_PRESET=${CTEST_PRESET}" - "-DLLVM_COV=${LLVM_COV}" - "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" - "-DREPORT_MODE=html" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" - COMMENT "Generating LLVM HTML coverage report (${CTEST_PRESET})" - VERBATIM - ) - add_dependencies(coverage-html _coverage-merge) - - # Public target allowing to generate stdout console coverage report - # Triggers automatically the tests and coverage merge before running - add_custom_target(coverage-summary - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" - "-DCTEST_PRESET=${CTEST_PRESET}" - "-DLLVM_COV=${LLVM_COV}" - "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" - "-DREPORT_MODE=console" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" - COMMENT "Generating LLVM coverage summary (${CTEST_PRESET})" - VERBATIM - ) - add_dependencies(coverage-summary _coverage-merge) - - # Public target allowing to generate json coverage report - # Triggers automatically the tests and coverage merge before running - add_custom_target(coverage-json - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" - "-DCTEST_PRESET=${CTEST_PRESET}" - "-DLLVM_COV=${LLVM_COV}" - "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" - "-DREPORT_MODE=json" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" - COMMENT "Exporting LLVM coverage as JSON (${CTEST_PRESET})" - VERBATIM - ) - add_dependencies(coverage-json _coverage-merge) - - # Public target allowing to generate markdown coverage report - # Triggers automatically the tests and coverage merge before running - add_custom_target(coverage-markdown - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" - "-DCTEST_PRESET=${CTEST_PRESET}" - "-DLLVM_COV=${LLVM_COV}" - "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" - "-DREPORT_MODE=markdown" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" - COMMENT "Generating GitHub Actions coverage summary (${CTEST_PRESET})" - VERBATIM - ) - add_dependencies(coverage-markdown _coverage-merge) - - # Public target allowing to generate a shields.io coverage badge - # Triggers automatically the tests and coverage merge before running - add_custom_target(coverage-shieldsio - COMMAND ${CMAKE_COMMAND} - "-DCOVERAGE_DIR=${COVERAGE_DIR}" - "-DPROFDATA_FILE=${PROFDATA_FILE}" - "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" - "-DCTEST_PRESET=${CTEST_PRESET}" - "-DLLVM_COV=${LLVM_COV}" - "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" - "-DREPORT_MODE=shieldsio" - -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" - COMMENT "Generating Shields.io coverage badge (${CTEST_PRESET})" - VERBATIM - ) - add_dependencies(coverage-shieldsio _coverage-merge) - -endif() +if (ENABLE_COVERAGE) + set(_CAN_ENABLE_COVERAGE TRUE) + + if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + message(WARNING "Coverage requested, but compiler is ${CMAKE_CXX_COMPILER_ID}. LLVM coverage requires Clang.") + set(_CAN_ENABLE_COVERAGE FALSE) + endif() + + if (_CAN_ENABLE_COVERAGE) + find_program(LLVM_PROFDATA llvm-profdata) + find_program(LLVM_COV llvm-cov) + + if (NOT LLVM_PROFDATA) + message(WARNING "Required tool 'llvm-profdata' not found in PATH.") + set(_CAN_ENABLE_COVERAGE FALSE) + endif() + + if (NOT LLVM_COV) + message(WARNING "Required tool 'llvm-cov' not found in PATH.") + set(_CAN_ENABLE_COVERAGE FALSE) + endif() + endif() + + if (NOT _CAN_ENABLE_COVERAGE) + # Force the option to OFF in the cache so subsequent runs/scripts know it failed + set(ENABLE_COVERAGE OFF CACHE BOOL "Enable LLVM coverage tools" FORCE) + message(STATUS "LLVM coverage setup failed. Coverage targets will not be created.") + else() + message(STATUS "Enabling LLVM coverage tools") + + message(STATUS "Coverage Build: Downgrading CX macros to runtime for tests instrumentation.") + add_compile_definitions(COVERAGE_BUILD) # see include/bitbishop/config.hpp + + add_compile_options( + -fprofile-instr-generate + -fcoverage-mapping + ) + add_link_options( + -fprofile-instr-generate + ) + + # Coverage tier selection + # Must match the tier used by the CTest preset + set(CTEST_PRESET "quick-validation-clang-debug" + CACHE STRING "Coverage tier (quick-validation-clang-debug, intermediate-validation-clang-debug, deep-validation-clang-debug, full-suite-clang-debug)") + + set(COVERAGE_BASE_DIR "${CMAKE_BINARY_DIR}/coverage") + set(COVERAGE_DIR "${COVERAGE_BASE_DIR}/${CTEST_PRESET}") + set(PROFDATA_FILE "${COVERAGE_DIR}/coverage.profdata") + set(TESTS_BIN_DIR "${CMAKE_BINARY_DIR}/tests") + + # Internal target to run tests for the specified ctest preset + # This target is then used as a dependency for subsequent custom targets + add_custom_target(_coverage-run-tests + COMMAND ${CMAKE_CTEST_COMMAND} --preset ${CTEST_PRESET} --output-on-failure + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMENT "Running tests for preset ${CTEST_PRESET}" + USES_TERMINAL + ) + + # Internal target to merge raw coverage profiles + # Triggers automatically the tests before running + # Creates the coverage directory if non-existing (indempotent) + add_custom_target(_coverage-merge + COMMAND ${CMAKE_COMMAND} -E make_directory "${COVERAGE_DIR}" + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DLLVM_PROFDATA=${LLVM_PROFDATA}" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_merge.cmake" + BYPRODUCTS "${PROFDATA_FILE}" + COMMENT "Merging LLVM coverage profiles for ${CTEST_PRESET}" + VERBATIM + ) + add_dependencies(_coverage-merge _coverage-run-tests) + + # Public target allowing to generate html (css, js) coverage report + # Triggers automatically the tests and coverage merge before running + add_custom_target(coverage-html + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" + "-DCTEST_PRESET=${CTEST_PRESET}" + "-DLLVM_COV=${LLVM_COV}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DREPORT_MODE=html" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" + COMMENT "Generating LLVM HTML coverage report (${CTEST_PRESET})" + VERBATIM + ) + add_dependencies(coverage-html _coverage-merge) + + # Public target allowing to generate stdout console coverage report + # Triggers automatically the tests and coverage merge before running + add_custom_target(coverage-summary + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" + "-DCTEST_PRESET=${CTEST_PRESET}" + "-DLLVM_COV=${LLVM_COV}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DREPORT_MODE=console" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" + COMMENT "Generating LLVM coverage summary (${CTEST_PRESET})" + VERBATIM + ) + add_dependencies(coverage-summary _coverage-merge) + + # Public target allowing to generate json coverage report + # Triggers automatically the tests and coverage merge before running + add_custom_target(coverage-json + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" + "-DCTEST_PRESET=${CTEST_PRESET}" + "-DLLVM_COV=${LLVM_COV}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DREPORT_MODE=json" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" + COMMENT "Exporting LLVM coverage as JSON (${CTEST_PRESET})" + VERBATIM + ) + add_dependencies(coverage-json _coverage-merge) + + # Public target allowing to generate markdown coverage report + # Triggers automatically the tests and coverage merge before running + add_custom_target(coverage-markdown + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" + "-DCTEST_PRESET=${CTEST_PRESET}" + "-DLLVM_COV=${LLVM_COV}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DREPORT_MODE=markdown" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" + COMMENT "Generating GitHub Actions coverage summary (${CTEST_PRESET})" + VERBATIM + ) + add_dependencies(coverage-markdown _coverage-merge) + + # Public target allowing to generate a shields.io coverage badge + # Triggers automatically the tests and coverage merge before running + add_custom_target(coverage-shieldsio + COMMAND ${CMAKE_COMMAND} + "-DCOVERAGE_DIR=${COVERAGE_DIR}" + "-DPROFDATA_FILE=${PROFDATA_FILE}" + "-DTESTS_BIN_DIR=${TESTS_BIN_DIR}" + "-DCTEST_PRESET=${CTEST_PRESET}" + "-DLLVM_COV=${LLVM_COV}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DREPORT_MODE=shieldsio" + -P "${CMAKE_SOURCE_DIR}/cmake/coverage/target_coverage_report.cmake" + COMMENT "Generating Shields.io coverage badge (${CTEST_PRESET})" + VERBATIM + ) + add_dependencies(coverage-shieldsio _coverage-merge) + endif () +endif () From efcfab8c603a884fb2a6526740c383931c732cdd Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:00:12 +0200 Subject: [PATCH 12/86] added build and test phases --- .github/workflows/macos_build.yaml | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index e7cc1be5..60cfdf85 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -58,3 +58,49 @@ jobs: fi exit $CONFIGURE_EXIT_CODE + + - name: Build (${{ matrix.build_preset }}) + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} 2>&1 | tee build_output.txt + BUILD_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + if [ $BUILD_EXIT_CODE -eq 0 ]; then + echo "
🟢 Build Results (click to expand)" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 Build Results" >> $GITHUB_STEP_SUMMARY + fi + echo '' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat build_output.txt >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + if [ $BUILD_EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $BUILD_EXIT_CODE + + - name: Test (${{ matrix.test_preset }}) + shell: bash + run: | + set +e + ctest --preset ${{ matrix.test_preset }} --output-on-failure 2>&1 | tee test_output.txt + TEST_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + if [ $TEST_EXIT_CODE -eq 0 ]; then + echo "
🟢 Test Results (click to expand)" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 Test Results" >> $GITHUB_STEP_SUMMARY + fi + echo '' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + cat test_output.txt >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + if [ $TEST_EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $TEST_EXIT_CODE From 78b10673416b528f31f97eb862761fe7af5e4cf7 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:06:59 +0200 Subject: [PATCH 13/86] added msvc debug to matrix since now it runs less often --- .github/workflows/windows_build_test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 1abbbe47..2b17ebed 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -18,6 +18,10 @@ jobs: strategy: matrix: include: + - name: msvc_debug + configure_preset: msvc_debug + build_preset: msvc_debug + test_preset: quick-validation-msvc-debug - name: msvc_release configure_preset: msvc_release build_preset: msvc_release From 211cef617eb19172300b6bf13a212293f152169d Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:07:20 +0200 Subject: [PATCH 14/86] added vcpkg caching --- .github/workflows/macos_build.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 60cfdf85..77865d63 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -23,18 +23,26 @@ jobs: configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - # - name: clang_release - # configure_preset: clang_release - # build_preset: clang_release - # test_preset: quick-validation-clang-release + - name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release steps: - uses: actions/checkout@v4 - - name: Use Pre-installed vcpkg + - name: Setup pre-installed VCPKG run: | echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - which vcpkg + + - name: Cache VCPKG + run: | + # Use the GitHub Actions cache as a binary source + echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV + env: + # These variables are required for the 'x-gha' provider to talk to GitHub's cache API + ACTIONS_CACHE_URL: ${{ secrets.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} - name: Configure (${{ matrix.configure_preset }}) shell: bash From 62d987df96cd7bce3594c1ee09b77a23c1961ab0 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:24:29 +0200 Subject: [PATCH 15/86] testing macos workflow with composite action to reduce code duplication --- .../actions/_log_to_gh_summary/action.yaml | 45 +++++++++++ .github/workflows/macos_build.yaml | 75 +++---------------- 2 files changed, 57 insertions(+), 63 deletions(-) create mode 100644 .github/actions/_log_to_gh_summary/action.yaml diff --git a/.github/actions/_log_to_gh_summary/action.yaml b/.github/actions/_log_to_gh_summary/action.yaml new file mode 100644 index 00000000..ea35738a --- /dev/null +++ b/.github/actions/_log_to_gh_summary/action.yaml @@ -0,0 +1,45 @@ +name: CMake Bash Step With Summary +description: Runs a CMake command and logs output to GitHub Step Summary (Linux, MacOS) + +inputs: + step-name: + description: Display name (e.g. Build, Configure) + required: true + command: + description: The full cmake command to run + required: true + output-file: + description: Temporary text file to store command output + default: tmp_step_output.txt + +runs: + using: composite + steps: + - shell: bash + run: | + set +e + eval "${{ inputs.command }} 2>&1 | tee ${{ inputs.tmp_step_output.txt }}" + EXIT_CODE=${PIPESTATUS[0]} + set -e + + LOG_SIZE=$(wc -c < ${{ inputs.tmp_step_output.txt }}) + + if [ $EXIT_CODE -eq 0 ]; then + echo "
🟢 ${{ inputs.step-name }} Successful" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 ${{ inputs.step-name }} Failed" >> $GITHUB_STEP_SUMMARY + fi + + echo '' >> $GITHUB_STEP_SUMMARY + echo '```text' >> $GITHUB_STEP_SUMMARY + + # Guard against 1MB GitHub Step Summary limit: only show the last 500 lines if it's huge + tail -n 500 ${{ inputs.tmp_step_output }} >> $GITHUB_STEP_SUMMARY + + echo '```' >> $GITHUB_STEP_SUMMARY + + if [ $EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $EXIT_CODE diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 77865d63..ff196962 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -45,70 +45,19 @@ jobs: ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} - name: Configure (${{ matrix.configure_preset }}) - shell: bash - run: | - set +e - cmake --preset ${{ matrix.configure_preset }} 2>&1 | tee configure_output.txt - CONFIGURE_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then - echo "
🟢 Configure Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Configure Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat configure_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $CONFIGURE_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Configure (${{ matrix.configure_preset }}) + command: "cmake --preset ${{ matrix.configure_preset }}" - name: Build (${{ matrix.build_preset }}) - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} 2>&1 | tee build_output.txt - BUILD_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $BUILD_EXIT_CODE -eq 0 ]; then - echo "
🟢 Build Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Build Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat build_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $BUILD_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $BUILD_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Build (${{ matrix.build_preset }}) + command: "cmake --build --preset ${{ matrix.build_preset }}" - name: Test (${{ matrix.test_preset }}) - shell: bash - run: | - set +e - ctest --preset ${{ matrix.test_preset }} --output-on-failure 2>&1 | tee test_output.txt - TEST_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $TEST_EXIT_CODE -eq 0 ]; then - echo "
🟢 Test Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Test Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat test_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $TEST_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $TEST_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" From 71ff50fecdbabea0ec76d1b47c43d22ba0bce5d8 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:26:01 +0200 Subject: [PATCH 16/86] moved concurrency to global scope so that matrix works correctly --- .github/workflows/linux_build_test.yaml | 8 ++++---- .github/workflows/macos_build.yaml | 8 ++++---- .github/workflows/windows_build_test.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 9d3957ad..bf08e5c3 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -5,14 +5,14 @@ on: # pull_request: # branches: [ main ] -permissions: - contents: read - packages: read - concurrency: group: pr-${{ github.event.pull_request.number }}-linux-build cancel-in-progress: true +permissions: + contents: read + packages: read + jobs: linux-build: runs-on: ubuntu-latest diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index ff196962..31ed09da 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -6,16 +6,16 @@ on: # pull_request: # types: [labeled, synchronize] +concurrency: + group: pr-${{ github.event.pull_request.number }}-macos-arm-build + cancel-in-progress: true + jobs: macos-arm-build: # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: macos-26 name: ${{ matrix.test_preset }} - concurrency: - group: pr-${{ github.event.pull_request.number }}-macos-arm-build - cancel-in-progress: true - strategy: matrix: include: diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 2b17ebed..f3989ee1 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -5,16 +5,16 @@ on: # pull_request: # types: [labeled, synchronize] +concurrency: + group: pr-${{ github.event.pull_request.number }}-windows-build + cancel-in-progress: true + jobs: windows-build: if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: windows-2022 name: ${{ matrix.test_preset }} - concurrency: - group: pr-${{ github.event.pull_request.number }}-windows-build - cancel-in-progress: true - strategy: matrix: include: From 345015ffe77e3c4456bd2350694a3d167513fc11 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:31:09 +0200 Subject: [PATCH 17/86] fixed typos --- .github/actions/_log_to_gh_summary/action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/_log_to_gh_summary/action.yaml b/.github/actions/_log_to_gh_summary/action.yaml index ea35738a..9d13d1d8 100644 --- a/.github/actions/_log_to_gh_summary/action.yaml +++ b/.github/actions/_log_to_gh_summary/action.yaml @@ -10,6 +10,7 @@ inputs: required: true output-file: description: Temporary text file to store command output + required: false default: tmp_step_output.txt runs: @@ -34,7 +35,7 @@ runs: echo '```text' >> $GITHUB_STEP_SUMMARY # Guard against 1MB GitHub Step Summary limit: only show the last 500 lines if it's huge - tail -n 500 ${{ inputs.tmp_step_output }} >> $GITHUB_STEP_SUMMARY + tail -n 500 ${{ inputs.tmp_step_output.txt }} >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY From ce3f14d9f67202827fc9d5d03da5358e0ad5b81b Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:32:33 +0200 Subject: [PATCH 18/86] do not run clang release --- .github/workflows/macos_build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 31ed09da..54c236e9 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -23,10 +23,10 @@ jobs: configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release + # - name: clang_release + # configure_preset: clang_release + # build_preset: clang_release + # test_preset: quick-validation-clang-release steps: - uses: actions/checkout@v4 From d64cea8d5f67d81bd73ae03d9513edb7efb7d799 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:35:51 +0200 Subject: [PATCH 19/86] oupsi, this was a dumb mistake --- .github/actions/_log_to_gh_summary/action.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/_log_to_gh_summary/action.yaml b/.github/actions/_log_to_gh_summary/action.yaml index 9d13d1d8..0ed6a42b 100644 --- a/.github/actions/_log_to_gh_summary/action.yaml +++ b/.github/actions/_log_to_gh_summary/action.yaml @@ -19,11 +19,11 @@ runs: - shell: bash run: | set +e - eval "${{ inputs.command }} 2>&1 | tee ${{ inputs.tmp_step_output.txt }}" + eval "${{ inputs.command }} 2>&1 | tee ${{ inputs.output-file }}" EXIT_CODE=${PIPESTATUS[0]} set -e - LOG_SIZE=$(wc -c < ${{ inputs.tmp_step_output.txt }}) + LOG_SIZE=$(wc -c < ${{ inputs.output-file }}) if [ $EXIT_CODE -eq 0 ]; then echo "
🟢 ${{ inputs.step-name }} Successful" >> $GITHUB_STEP_SUMMARY @@ -35,7 +35,7 @@ runs: echo '```text' >> $GITHUB_STEP_SUMMARY # Guard against 1MB GitHub Step Summary limit: only show the last 500 lines if it's huge - tail -n 500 ${{ inputs.tmp_step_output.txt }} >> $GITHUB_STEP_SUMMARY + tail -n 500 ${{ inputs.output-file }} >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY From a18dd4d35eac32340942908df1879f4846f1efd4 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:49:42 +0200 Subject: [PATCH 20/86] testing the composite action on linux as well --- .../actions/_log_to_gh_summary/action.yaml | 8 ++ .github/workflows/linux_build_test.yaml | 87 ++++--------------- 2 files changed, 26 insertions(+), 69 deletions(-) diff --git a/.github/actions/_log_to_gh_summary/action.yaml b/.github/actions/_log_to_gh_summary/action.yaml index 0ed6a42b..a62a0562 100644 --- a/.github/actions/_log_to_gh_summary/action.yaml +++ b/.github/actions/_log_to_gh_summary/action.yaml @@ -12,6 +12,14 @@ inputs: description: Temporary text file to store command output required: false default: tmp_step_output.txt + summary-mode: + description: log (wraps output in code block) or file (cats a file found in output) + required: false + default: log + summary-extract-regexp: + description: Regex to find a file path in the logs to append to the summary + required: false + default: '' runs: using: composite diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index bf08e5c3..d9014c12 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -2,8 +2,8 @@ name: Linux Build Test on: workflow_dispatch: - # pull_request: - # branches: [ main ] + pull_request: + branches: [ main ] concurrency: group: pr-${{ github.event.pull_request.number }}-linux-build @@ -30,10 +30,10 @@ jobs: configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release + # - name: clang_release + # configure_preset: clang_release + # build_preset: clang_release + # test_preset: quick-validation-clang-release steps: - uses: actions/checkout@v4 @@ -81,73 +81,22 @@ jobs: restore-keys: ${{ runner.os }}-cmake- - name: Configure (${{ matrix.configure_preset }}) - shell: bash - run: | - set +e - cmake --preset ${{ matrix.configure_preset }} 2>&1 | tee configure_output.txt - CONFIGURE_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then - echo "
🟢 Configure Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Configure Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat configure_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $CONFIGURE_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $CONFIGURE_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Configure (${{ matrix.configure_preset }}) + command: "cmake --preset ${{ matrix.configure_preset }}" - name: Build (${{ matrix.build_preset }}) - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} 2>&1 | tee build_output.txt - BUILD_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $BUILD_EXIT_CODE -eq 0 ]; then - echo "
🟢 Build Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Build Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat build_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $BUILD_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $BUILD_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Build (${{ matrix.build_preset }}) + command: "cmake --build --preset ${{ matrix.build_preset }}" - name: Test (${{ matrix.test_preset }}) - shell: bash - run: | - set +e - ctest --preset ${{ matrix.test_preset }} --output-on-failure 2>&1 | tee test_output.txt - TEST_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $TEST_EXIT_CODE -eq 0 ]; then - echo "
🟢 Test Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Test Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat test_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $TEST_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $TEST_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - name: Generate markdown coverage report (${{ matrix.test_preset }}) if: matrix.name == 'clang_debug' From 28a2ace4affcb39cc304f5a36e513f9cca287e6d Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:54:33 +0200 Subject: [PATCH 21/86] testing with multiple runners --- .github/workflows/macos_build.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 54c236e9..e813d210 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -13,11 +13,12 @@ concurrency: jobs: macos-arm-build: # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - runs-on: macos-26 - name: ${{ matrix.test_preset }} + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.name }} strategy: matrix: + runner: [macos-13, macos-26] include: - name: clang_debug configure_preset: clang_debug @@ -44,6 +45,13 @@ jobs: ACTIONS_CACHE_URL: ${{ secrets.ACTIONS_CACHE_URL }} ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-cmake- + - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary with: From 4abe6ed88b495e315bb5777d277ba7adc3733732 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 10:56:49 +0200 Subject: [PATCH 22/86] trying with a different structure --- .github/workflows/macos_build.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index e813d210..afc9bc50 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -18,12 +18,21 @@ jobs: strategy: matrix: - runner: [macos-13, macos-26] include: - - name: clang_debug + - runner: macos-13 + arch: intel + name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug + + - runner: macos-26 + arch: arm + name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug + test_preset: quick-validation-clang-debug + # - name: clang_release # configure_preset: clang_release # build_preset: clang_release @@ -49,7 +58,7 @@ jobs: uses: actions/cache@v4 with: path: build - key: ${{ runner.os }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} restore-keys: ${{ runner.os }}-cmake- - name: Configure (${{ matrix.configure_preset }}) From 9626e79964817059912166d0adc20bfe23afffd2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:00:47 +0200 Subject: [PATCH 23/86] this image was no longer supported by github --- .github/workflows/macos_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index afc9bc50..696c75f8 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -19,7 +19,7 @@ jobs: strategy: matrix: include: - - runner: macos-13 + - runner: macos-26-intel arch: intel name: clang_debug configure_preset: clang_debug From b489dc12432347ae7864a11f2107859646bd2d01 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:02:07 +0200 Subject: [PATCH 24/86] renamed workflow correctly --- .github/workflows/macos_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 696c75f8..d219912b 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -1,4 +1,4 @@ -name: MacOS ARM Build Test +name: MacOS Build Test on: workflow_dispatch: From 328dca159e7957c7e7377ba1f86e662adec7e419 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:15:51 +0200 Subject: [PATCH 25/86] refactored clang tidy action --- .github/workflows/clang_tidy.yaml | 41 ++++++++++--------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 56b87828..32023c07 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -2,8 +2,8 @@ name: Clang Tidy Linting on: workflow_dispatch: - # pull_request: - # branches: [ main ] + pull_request: + branches: [ main ] concurrency: group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting @@ -15,15 +15,17 @@ permissions: jobs: clang-tidy-linting: - runs-on: ubuntu-latest - name: ${{ matrix.name }} + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.name }} strategy: matrix: include: - - name: linting-clang-release - configure_preset: clang_release - build_preset: clang_release + - runner: ubuntu-latest + arch: x64 + name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug steps: - uses: actions/checkout@v4 @@ -73,24 +75,7 @@ jobs: run: cmake --preset ${{ matrix.configure_preset }} - name: Run clang-tidy - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target clang-tidy 2>&1 | tee clang_tidy_output.txt - CLANG_TIDY_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then - echo "
🟢 Clang Tidy Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Clang Tidy Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - cat clang_tidy_output.txt >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $CLANG_TIDY_EXIT_CODE + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Run clang-tidy (${{ matrix.configure_preset }}) + command: "cmake --build --preset ${{ matrix.build_preset }} --target clang-tidy" From 7c7cb0002785b7237a7600f7d472005851ede75c Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:16:19 +0200 Subject: [PATCH 26/86] updated linux action with new matrix system --- .github/workflows/linux_build_test.yaml | 32 +++++++++++++++---------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index d9014c12..dd69a529 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -2,8 +2,9 @@ name: Linux Build Test on: workflow_dispatch: - pull_request: - branches: [ main ] + push: + # pull_request: + # branches: [ main ] concurrency: group: pr-${{ github.event.pull_request.number }}-linux-build @@ -15,8 +16,8 @@ permissions: jobs: linux-build: - runs-on: ubuntu-latest - name: ${{ matrix.test_preset }} + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} permissions: # coverage artefacts export requires write priviledges @@ -26,14 +27,19 @@ jobs: strategy: matrix: include: - - name: clang_debug + - runner: ubuntu-latest + arch: x64 + name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - # - name: clang_release - # configure_preset: clang_release - # build_preset: clang_release - # test_preset: quick-validation-clang-release + + - runner: ubuntu-latest + arch: x64 + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang_release steps: - uses: actions/checkout@v4 @@ -70,15 +76,15 @@ jobs: /tmp/vcpkg/downloads /tmp/vcpkg/installed ~/.cache/vcpkg - key: ${{ runner.os }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-vcpkg- + key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - name: Cache build uses: actions/cache@v4 with: path: build - key: ${{ runner.os }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-cmake- + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary From 4493f787bd64c606e9ac20d1dc0a5a4a7860400a Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:16:50 +0200 Subject: [PATCH 27/86] updated macos action to also run on macos intel --- .github/workflows/macos_build.yaml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index d219912b..a67c0ae0 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -11,10 +11,10 @@ concurrency: cancel-in-progress: true jobs: - macos-arm-build: + macos-build: # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.name }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: matrix: @@ -27,16 +27,25 @@ jobs: test_preset: quick-validation-clang-debug - runner: macos-26 - arch: arm + arch: arm64 name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - # - name: clang_release - # configure_preset: clang_release - # build_preset: clang_release - # test_preset: quick-validation-clang-release + - runner: macos-26-intel + arch: intel + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang_release + + - runner: macos-26 + arch: arm64 + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang_release steps: - uses: actions/checkout@v4 @@ -59,7 +68,7 @@ jobs: with: path: build key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-cmake- + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary From c529670653ac2a0eee06ace90bd05c9bb15437c2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:18:43 +0200 Subject: [PATCH 28/86] added more runner configurations for speed test --- .github/workflows/linux_build_test.yaml | 18 ++++++++++-- .github/workflows/windows_build_test.yaml | 36 ++++++++++++++++++----- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index dd69a529..b9aa1369 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -27,20 +27,34 @@ jobs: strategy: matrix: include: - - runner: ubuntu-latest + - runner: ubuntu-24.04 arch: x64 name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - - runner: ubuntu-latest + - runner: ubuntu-24.04 arch: x64 name: clang_release configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang_release + - runner: ubuntu-24.04-arm + arch: arm64 + name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug + test_preset: quick-validation-clang-debug + + - runner: ubuntu-24.04-arm + arch: arm64 + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang_release + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index f3989ee1..45b99b3b 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -2,6 +2,7 @@ name: Windows Build Test on: workflow_dispatch: + push: # pull_request: # types: [labeled, synchronize] @@ -12,17 +13,36 @@ concurrency: jobs: windows-build: if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - runs-on: windows-2022 - name: ${{ matrix.test_preset }} + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: matrix: include: - - name: msvc_debug + - runner: windows-2022 + arch: x64 + name: msvc_debug configure_preset: msvc_debug build_preset: msvc_debug test_preset: quick-validation-msvc-debug - - name: msvc_release + + - runner: windows-2022 + arch: x64 + name: msvc_release + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + + - runner: windows-2025 + arch: x64 + name: msvc_debug + configure_preset: msvc_debug + build_preset: msvc_debug + test_preset: quick-validation-msvc-debug + + - runner: windows-2025 + arch: x64 + name: msvc_release configure_preset: msvc_release build_preset: msvc_release test_preset: quick-validation-msvc-release @@ -38,15 +58,15 @@ jobs: C:\vcpkg\packages C:\vcpkg\buildtrees ~\AppData\Local\vcpkg\archives - key: ${{ runner.os }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-vcpkg- + key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - name: Cache build uses: actions/cache@v4 with: path: build - key: ${{ runner.os }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-cmake- + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - name: Configure (${{ matrix.configure_preset }}) env: From 36376333b8edf142c4e33d847acf94dd1dde216a Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:21:12 +0200 Subject: [PATCH 29/86] fixed typo --- .github/workflows/macos_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index a67c0ae0..2b4e2db5 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -7,7 +7,7 @@ on: # types: [labeled, synchronize] concurrency: - group: pr-${{ github.event.pull_request.number }}-macos-arm-build + group: pr-${{ github.event.pull_request.number }}-macos-build cancel-in-progress: true jobs: From c311024aae8577c472640e99092f28a5c1cd1997 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:21:47 +0200 Subject: [PATCH 30/86] this job could indeed never run --- .github/workflows/windows_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 45b99b3b..fbce574b 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -12,7 +12,7 @@ concurrency: jobs: windows-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} From 65474b55413785df047c6e99289a3103ae042ae2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:23:16 +0200 Subject: [PATCH 31/86] added windows 11 arm configuration --- .github/workflows/windows_build_test.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index fbce574b..e03797d6 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -47,6 +47,20 @@ jobs: build_preset: msvc_release test_preset: quick-validation-msvc-release + - runner: windows-11-arm + arch: arm64 + name: msvc_debug + configure_preset: msvc_debug + build_preset: msvc_debug + test_preset: quick-validation-msvc-debug + + - runner: windows-11-arm + arch: arm64 + name: msvc_release + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + steps: - uses: actions/checkout@v4 From ec978403cdb34641f1f13cffb7029d6c2c96cd11 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:26:37 +0200 Subject: [PATCH 32/86] fixed typos --- .github/workflows/linux_build_test.yaml | 4 ++-- .github/workflows/macos_build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index b9aa1369..f87517dc 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -39,7 +39,7 @@ jobs: name: clang_release configure_preset: clang_release build_preset: clang_release - test_preset: quick-validation-clang_release + test_preset: quick-validation-clang-release - runner: ubuntu-24.04-arm arch: arm64 @@ -53,7 +53,7 @@ jobs: name: clang_release configure_preset: clang_release build_preset: clang_release - test_preset: quick-validation-clang_release + test_preset: quick-validation-clang-release steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 2b4e2db5..f57815e7 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -38,14 +38,14 @@ jobs: name: clang_release configure_preset: clang_release build_preset: clang_release - test_preset: quick-validation-clang_release + test_preset: quick-validation-clang-release - runner: macos-26 arch: arm64 name: clang_release configure_preset: clang_release build_preset: clang_release - test_preset: quick-validation-clang_release + test_preset: quick-validation-clang-release steps: - uses: actions/checkout@v4 From c66fbc776ba3144598da9a7b122a95d8b30f7260 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:45:15 +0200 Subject: [PATCH 33/86] now it should work as expected --- .github/workflows/clang_tidy.yaml | 1 + .github/workflows/linux_build_test.yaml | 16 ++++++++--- .github/workflows/macos_build.yaml | 26 ++++++------------ .github/workflows/windows_build_test.yaml | 33 ++++++----------------- 4 files changed, 30 insertions(+), 46 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 32023c07..29c99fc9 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -4,6 +4,7 @@ on: workflow_dispatch: pull_request: branches: [ main ] + types: [ synchronize ] concurrency: group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index f87517dc..c58c85d1 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -2,9 +2,9 @@ name: Linux Build Test on: workflow_dispatch: - push: - # pull_request: - # branches: [ main ] + pull_request: + branches: [ main ] + types: [labeled, synchronize] concurrency: group: pr-${{ github.event.pull_request.number }}-linux-build @@ -16,6 +16,12 @@ permissions: jobs: linux-build: + if: | + matrix.run_condition == 'always' || + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} @@ -33,6 +39,7 @@ jobs: configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug + run_condition: always - runner: ubuntu-24.04 arch: x64 @@ -40,6 +47,7 @@ jobs: configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release + run_condition: final_only - runner: ubuntu-24.04-arm arch: arm64 @@ -47,6 +55,7 @@ jobs: configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug + run_condition: always - runner: ubuntu-24.04-arm arch: arm64 @@ -54,6 +63,7 @@ jobs: configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release + run_condition: final_only steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index f57815e7..71d86fbf 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -2,9 +2,9 @@ name: MacOS Build Test on: workflow_dispatch: - push: - # pull_request: - # types: [labeled, synchronize] + pull_request: + branches: [ main ] + types: [labeled, synchronize] concurrency: group: pr-${{ github.event.pull_request.number }}-macos-build @@ -12,27 +12,17 @@ concurrency: jobs: macos-build: - # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + if: | + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: matrix: include: - - runner: macos-26-intel - arch: intel - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - - runner: macos-26 - arch: arm64 - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - runner: macos-26-intel arch: intel name: clang_release diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index e03797d6..a905da98 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -2,9 +2,9 @@ name: Windows Build Test on: workflow_dispatch: - push: - # pull_request: - # types: [labeled, synchronize] + pull_request: + branches: [ main ] + types: [labeled, synchronize] concurrency: group: pr-${{ github.event.pull_request.number }}-windows-build @@ -12,20 +12,17 @@ concurrency: jobs: windows-build: - # if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + if: | + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: matrix: include: - - runner: windows-2022 - arch: x64 - name: msvc_debug - configure_preset: msvc_debug - build_preset: msvc_debug - test_preset: quick-validation-msvc-debug - - runner: windows-2022 arch: x64 name: msvc_release @@ -33,13 +30,6 @@ jobs: build_preset: msvc_release test_preset: quick-validation-msvc-release - - runner: windows-2025 - arch: x64 - name: msvc_debug - configure_preset: msvc_debug - build_preset: msvc_debug - test_preset: quick-validation-msvc-debug - - runner: windows-2025 arch: x64 name: msvc_release @@ -47,13 +37,6 @@ jobs: build_preset: msvc_release test_preset: quick-validation-msvc-release - - runner: windows-11-arm - arch: arm64 - name: msvc_debug - configure_preset: msvc_debug - build_preset: msvc_debug - test_preset: quick-validation-msvc-debug - - runner: windows-11-arm arch: arm64 name: msvc_release From e8e9ce88459ad7d278a81a86da01e45fedd31956 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 11:46:50 +0200 Subject: [PATCH 34/86] fixed typo? --- .github/workflows/linux_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index c58c85d1..7c5fa8c5 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -17,7 +17,7 @@ permissions: jobs: linux-build: if: | - matrix.run_condition == 'always' || + ${{matrix.run_condition}} == 'always' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') From c80bb80c71644b730dace92eeec3e546c690346e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:01:05 +0200 Subject: [PATCH 35/86] using a gate to run clang debug on push and clang release only on tag --- .github/workflows/linux_build_test.yaml | 42 +++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 7c5fa8c5..0408b443 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -17,7 +17,6 @@ permissions: jobs: linux-build: if: | - ${{matrix.run_condition}} == 'always' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') @@ -35,40 +34,57 @@ jobs: include: - runner: ubuntu-24.04 arch: x64 + build_type: debug name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - run_condition: always - runner: ubuntu-24.04 arch: x64 + build_type: release name: clang_release configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release - run_condition: final_only - runner: ubuntu-24.04-arm arch: arm64 + build_type: debug name: clang_debug configure_preset: clang_debug build_preset: clang_debug test_preset: quick-validation-clang-debug - run_condition: always - runner: ubuntu-24.04-arm arch: arm64 + build_type: release name: clang_release configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release - run_condition: final_only steps: + - name: Gate + id: gate + run: | + SHOULD_RUN=false + + if [[ "${{ matrix.build_type }}" == "debug" ]]; then + SHOULD_RUN=true + elif [[ "${{ matrix.build_type }}" == "release" ]] && + [[ "${{ github.event_name }}" == "pull_request" ]] && + [[ "${{ join(github.event.pull_request.labels.*.name, ' ') }}" == *"run-pre-merge-checks"* ]]; then + SHOULD_RUN=true + fi + + echo "run=$SHOULD_RUN" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + if: steps.gate.outputs.run == 'true' - name: Install dependencies + if: steps.gate.outputs.run == 'true' run: | sudo apt-get update sudo apt-get install -y \ @@ -87,6 +103,7 @@ jobs: cmake - name: Setup vcpkg + if: steps.gate.outputs.run == 'true' run: | git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg /tmp/vcpkg/bootstrap-vcpkg.sh @@ -94,6 +111,7 @@ jobs: echo "/tmp/vcpkg" >> $GITHUB_PATH - name: Cache VCPKG + if: steps.gate.outputs.run == 'true' uses: actions/cache@v4 with: path: | @@ -104,6 +122,7 @@ jobs: restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - name: Cache build + if: steps.gate.outputs.run == 'true' uses: actions/cache@v4 with: path: build @@ -111,25 +130,28 @@ jobs: restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - name: Configure (${{ matrix.configure_preset }}) + if: steps.gate.outputs.run == 'true' uses: ./.github/actions/_log_to_gh_summary with: step-name: Configure (${{ matrix.configure_preset }}) command: "cmake --preset ${{ matrix.configure_preset }}" - name: Build (${{ matrix.build_preset }}) + if: steps.gate.outputs.run == 'true' uses: ./.github/actions/_log_to_gh_summary with: step-name: Build (${{ matrix.build_preset }}) command: "cmake --build --preset ${{ matrix.build_preset }}" - name: Test (${{ matrix.test_preset }}) + if: steps.gate.outputs.run == 'true' uses: ./.github/actions/_log_to_gh_summary with: step-name: Test (${{ matrix.test_preset }}) command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - name: Generate markdown coverage report (${{ matrix.test_preset }}) - if: matrix.name == 'clang_debug' + if: matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' shell: bash run: | set +e @@ -157,7 +179,7 @@ jobs: exit $COV_EXIT_CODE - name: Generate html coverage report (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' id: htmlcov shell: bash run: | @@ -172,7 +194,7 @@ jobs: exit $COV_EXIT_CODE - name: Generate shields.io badge (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' id: shieldsio shell: bash run: | @@ -194,7 +216,7 @@ jobs: exit $COV_EXIT_CODE - name: Prepare files - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' shell: bash run: | mkdir -p out/coverage/badges @@ -205,7 +227,7 @@ jobs: cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges - name: Publish coverage badge and report to gh-pages - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} From d83c8171e321d187426e553a0e902740b1ae32d1 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:01:49 +0200 Subject: [PATCH 36/86] removed old condition --- .github/workflows/linux_build_test.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 0408b443..873f20b4 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -16,11 +16,6 @@ permissions: jobs: linux-build: - if: | - ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} From d02ee3d3f635dd20433a6d3f339ef10ae3e4efc5 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:11:11 +0200 Subject: [PATCH 37/86] and with a reusable workflow? --- .github/workflows/_rwf_linux_build_test.yaml | 194 ++++++++++++++++ .github/workflows/linux_build_test.yaml | 228 ++----------------- 2 files changed, 208 insertions(+), 214 deletions(-) create mode 100644 .github/workflows/_rwf_linux_build_test.yaml diff --git a/.github/workflows/_rwf_linux_build_test.yaml b/.github/workflows/_rwf_linux_build_test.yaml new file mode 100644 index 00000000..be4802ae --- /dev/null +++ b/.github/workflows/_rwf_linux_build_test.yaml @@ -0,0 +1,194 @@ +name: Linux Build (Reusable) + +on: + workflow_call: + inputs: + build_type: + required: true + type: string + +jobs: + linux-build: + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + + permissions: + # coverage artefacts export requires write priviledges + # (html report and shields.io badge) + contents: write + + strategy: + matrix: + include: + - runner: ubuntu-24.04 + arch: x64 + build_type: debug + name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug + test_preset: quick-validation-clang-debug + + - runner: ubuntu-24.04 + arch: x64 + build_type: release + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + + - runner: ubuntu-24.04-arm + arch: arm64 + build_type: debug + name: clang_debug + configure_preset: clang_debug + build_preset: clang_debug + test_preset: quick-validation-clang-debug + + - runner: ubuntu-24.04-arm + arch: arm64 + build_type: release + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + + steps: + - name: Filter matrix + if: matrix.build_type != inputs.build_type + run: exit 0 + + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential clang clang-tidy llvm gcc g++ \ + git curl zip unzip pkg-config ninja-build cmake + + - name: Setup vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg + /tmp/vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV + echo "/tmp/vcpkg" >> $GITHUB_PATH + + - name: Cache VCPKG + uses: actions/cache@v4 + with: + path: | + /tmp/vcpkg/downloads + /tmp/vcpkg/installed + ~/.cache/vcpkg + key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- + + - name: Configure + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Configure (${{ matrix.configure_preset }}) + command: "cmake --preset ${{ matrix.configure_preset }}" + + - name: Build + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Build (${{ matrix.build_preset }}) + command: "cmake --build --preset ${{ matrix.build_preset }}" + + - name: Test + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" + + - name: Generate markdown coverage report (${{ matrix.test_preset }}) + if: matrix.name == 'clang_debug' + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) + # -P: Uses Perl-style regex. + # -o: Only outputs the matched part (not the whole line). + # \K: Tells the engine to match the string but ignore it in the final output. + # .*: Matches the rest of the line (the path) + + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 Coverage Results" >> $GITHUB_STEP_SUMMARY + fi + echo '' >> $GITHUB_STEP_SUMMARY + cat $COVERAGE_FILE >> $GITHUB_STEP_SUMMARY + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $COV_EXIT_CODE + + - name: Generate html coverage report (${{ matrix.test_preset }}) + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + id: htmlcov + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) + echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Generate shields.io badge (${{ matrix.test_preset }}) + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + id: shieldsio + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + + echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Prepare files + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + shell: bash + run: | + mkdir -p out/coverage/badges + cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" out/coverage/ + cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges + + - name: Publish coverage badge and report to gh-pages + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: out + keep_files: true diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 873f20b4..6c717c93 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -15,217 +15,17 @@ permissions: packages: read jobs: - linux-build: - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - - permissions: - # coverage artefacts export requires write priviledges - # (html report and shields.io badge) - contents: write - - strategy: - matrix: - include: - - runner: ubuntu-24.04 - arch: x64 - build_type: debug - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - - runner: ubuntu-24.04 - arch: x64 - build_type: release - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - - runner: ubuntu-24.04-arm - arch: arm64 - build_type: debug - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - - runner: ubuntu-24.04-arm - arch: arm64 - build_type: release - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - steps: - - name: Gate - id: gate - run: | - SHOULD_RUN=false - - if [[ "${{ matrix.build_type }}" == "debug" ]]; then - SHOULD_RUN=true - elif [[ "${{ matrix.build_type }}" == "release" ]] && - [[ "${{ github.event_name }}" == "pull_request" ]] && - [[ "${{ join(github.event.pull_request.labels.*.name, ' ') }}" == *"run-pre-merge-checks"* ]]; then - SHOULD_RUN=true - fi - - echo "run=$SHOULD_RUN" >> $GITHUB_OUTPUT - - - uses: actions/checkout@v4 - if: steps.gate.outputs.run == 'true' - - - name: Install dependencies - if: steps.gate.outputs.run == 'true' - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - clang \ - clang-tidy \ - llvm \ - gcc \ - g++ \ - git \ - curl \ - zip \ - unzip \ - pkg-config \ - ninja-build \ - cmake - - - name: Setup vcpkg - if: steps.gate.outputs.run == 'true' - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH - - - name: Cache VCPKG - if: steps.gate.outputs.run == 'true' - uses: actions/cache@v4 - with: - path: | - /tmp/vcpkg/downloads - /tmp/vcpkg/installed - ~/.cache/vcpkg - key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - - - name: Cache build - if: steps.gate.outputs.run == 'true' - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - - - name: Configure (${{ matrix.configure_preset }}) - if: steps.gate.outputs.run == 'true' - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Configure (${{ matrix.configure_preset }}) - command: "cmake --preset ${{ matrix.configure_preset }}" - - - name: Build (${{ matrix.build_preset }}) - if: steps.gate.outputs.run == 'true' - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Build (${{ matrix.build_preset }}) - command: "cmake --build --preset ${{ matrix.build_preset }}" - - - name: Test (${{ matrix.test_preset }}) - if: steps.gate.outputs.run == 'true' - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Test (${{ matrix.test_preset }}) - command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - - - name: Generate markdown coverage report (${{ matrix.test_preset }}) - if: matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) - # -P: Uses Perl-style regex. - # -o: Only outputs the matched part (not the whole line). - # \K: Tells the engine to match the string but ignore it in the final output. - # .*: Matches the rest of the line (the path) - - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Coverage Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - cat $COVERAGE_FILE >> $GITHUB_STEP_SUMMARY - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $COV_EXIT_CODE - - - name: Generate html coverage report (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' - id: htmlcov - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) - echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Generate shields.io badge (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' - id: shieldsio - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - - echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Prepare files - if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' - shell: bash - run: | - mkdir -p out/coverage/badges - cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" out/coverage/ - cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges - - - name: Publish coverage badge and report to gh-pages - if: github.ref_name == 'main' && matrix.name == 'clang_debug' && steps.gate.outputs.run == 'true' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: out - keep_files: true + debug: + uses: ./.github/workflows/_rwf_linux_build_test.yaml + with: + build_type: debug + + release: + if: | + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) + uses: ./.github/workflows/_rwf_linux_build_test.yaml + with: + build_type: release From ba49dade2ac5bdee0ca4d04e67add289f65e89a0 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:12:07 +0200 Subject: [PATCH 38/86] fixed permissions --- .github/workflows/linux_build_test.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 6c717c93..5cb719fb 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -11,7 +11,10 @@ concurrency: cancel-in-progress: true permissions: - contents: read + # coverage artefacts export requires write priviledges + # (html report and shields.io badge) + contents: write + packages: read jobs: From f3b295192ee5dca1401a7dce819c760757ca2691 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:35:41 +0200 Subject: [PATCH 39/86] trying dynamic matrices --- .github/workflows/_rwf_linux_build_test.yaml | 194 ------------------ .github/workflows/linux_build_test.yaml | 198 +++++++++++++++++-- 2 files changed, 186 insertions(+), 206 deletions(-) delete mode 100644 .github/workflows/_rwf_linux_build_test.yaml diff --git a/.github/workflows/_rwf_linux_build_test.yaml b/.github/workflows/_rwf_linux_build_test.yaml deleted file mode 100644 index be4802ae..00000000 --- a/.github/workflows/_rwf_linux_build_test.yaml +++ /dev/null @@ -1,194 +0,0 @@ -name: Linux Build (Reusable) - -on: - workflow_call: - inputs: - build_type: - required: true - type: string - -jobs: - linux-build: - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - - permissions: - # coverage artefacts export requires write priviledges - # (html report and shields.io badge) - contents: write - - strategy: - matrix: - include: - - runner: ubuntu-24.04 - arch: x64 - build_type: debug - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - - runner: ubuntu-24.04 - arch: x64 - build_type: release - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - - runner: ubuntu-24.04-arm - arch: arm64 - build_type: debug - name: clang_debug - configure_preset: clang_debug - build_preset: clang_debug - test_preset: quick-validation-clang-debug - - - runner: ubuntu-24.04-arm - arch: arm64 - build_type: release - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - steps: - - name: Filter matrix - if: matrix.build_type != inputs.build_type - run: exit 0 - - - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential clang clang-tidy llvm gcc g++ \ - git curl zip unzip pkg-config ninja-build cmake - - - name: Setup vcpkg - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH - - - name: Cache VCPKG - uses: actions/cache@v4 - with: - path: | - /tmp/vcpkg/downloads - /tmp/vcpkg/installed - ~/.cache/vcpkg - key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - - - name: Configure - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Configure (${{ matrix.configure_preset }}) - command: "cmake --preset ${{ matrix.configure_preset }}" - - - name: Build - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Build (${{ matrix.build_preset }}) - command: "cmake --build --preset ${{ matrix.build_preset }}" - - - name: Test - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Test (${{ matrix.test_preset }}) - command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - - - name: Generate markdown coverage report (${{ matrix.test_preset }}) - if: matrix.name == 'clang_debug' - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) - # -P: Uses Perl-style regex. - # -o: Only outputs the matched part (not the whole line). - # \K: Tells the engine to match the string but ignore it in the final output. - # .*: Matches the rest of the line (the path) - - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Coverage Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - cat $COVERAGE_FILE >> $GITHUB_STEP_SUMMARY - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $COV_EXIT_CODE - - - name: Generate html coverage report (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' - id: htmlcov - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) - echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Generate shields.io badge (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' - id: shieldsio - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee - set -e - - SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - - echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Prepare files - if: github.ref_name == 'main' && matrix.name == 'clang_debug' - shell: bash - run: | - mkdir -p out/coverage/badges - cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" out/coverage/ - cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges - - - name: Publish coverage badge and report to gh-pages - if: github.ref_name == 'main' && matrix.name == 'clang_debug' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: out - keep_files: true diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 5cb719fb..25fd73b0 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -11,24 +11,198 @@ concurrency: cancel-in-progress: true permissions: - # coverage artefacts export requires write priviledges - # (html report and shields.io badge) - contents: write - + contents: read packages: read jobs: - debug: - uses: ./.github/workflows/_rwf_linux_build_test.yaml - with: - build_type: debug + setup-matrix: + runs-on: ubuntu-small + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + env: + PR_FLAG_TRIGGER: run-pre-merge-checks + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]] && \ + [[ "${{ contains(github.event.pull_request.labels.*.name, '${{ env.PR_FLAG_TRIGGER }}') }}" == "true" ]]; then + + echo 'matrix={"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} + ]}' >> $GITHUB_OUTPUT + else + echo 'matrix={"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + ]}' >> $GITHUB_OUTPUT + fi - release: + linux-build: + needs: setup if: | + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') ) - uses: ./.github/workflows/_rwf_linux_build_test.yaml - with: - build_type: release + strategy: + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + + permissions: + # coverage artefacts export requires write priviledges + # (html report and shields.io badge) + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + clang \ + clang-tidy \ + llvm \ + gcc \ + g++ \ + git \ + curl \ + zip \ + unzip \ + pkg-config \ + ninja-build \ + cmake + + - name: Setup vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg + /tmp/vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV + echo "/tmp/vcpkg" >> $GITHUB_PATH + + - name: Cache VCPKG + uses: actions/cache@v4 + with: + path: | + /tmp/vcpkg/downloads + /tmp/vcpkg/installed + ~/.cache/vcpkg + key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- + + - name: Configure (${{ matrix.configure_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Configure (${{ matrix.configure_preset }}) + command: "cmake --preset ${{ matrix.configure_preset }}" + + - name: Build (${{ matrix.build_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Build (${{ matrix.build_preset }}) + command: "cmake --build --preset ${{ matrix.build_preset }}" + + - name: Test (${{ matrix.test_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" + + - name: Generate markdown coverage report (${{ matrix.test_preset }}) + if: matrix.name == 'clang_debug' + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) + # -P: Uses Perl-style regex. + # -o: Only outputs the matched part (not the whole line). + # \K: Tells the engine to match the string but ignore it in the final output. + # .*: Matches the rest of the line (the path) + + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY + else + echo "## 🔴 Coverage Results" >> $GITHUB_STEP_SUMMARY + fi + echo '' >> $GITHUB_STEP_SUMMARY + cat $COVERAGE_FILE >> $GITHUB_STEP_SUMMARY + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
" >> $GITHUB_STEP_SUMMARY + fi + + exit $COV_EXIT_CODE + + - name: Generate html coverage report (${{ matrix.test_preset }}) + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + id: htmlcov + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) + echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Generate shields.io badge (${{ matrix.test_preset }}) + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + id: shieldsio + shell: bash + run: | + set +e + cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + set -e + + SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + + echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Prepare files + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + shell: bash + run: | + mkdir -p out/coverage/badges + cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" out/coverage/ + cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" out/coverage/badges + cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges + + - name: Publish coverage badge and report to gh-pages + if: github.ref_name == 'main' && matrix.name == 'clang_debug' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: out + keep_files: true From ac638b1b562dd3cf13fbb393e5b7e251b8b368d6 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:36:09 +0200 Subject: [PATCH 40/86] fixed typo --- .github/workflows/linux_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 25fd73b0..c3e1be07 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -41,7 +41,7 @@ jobs: fi linux-build: - needs: setup + needs: setup-matrix if: | github.event_name == 'workflow_dispatch' || ( From c04660a95e8b1435f207f893d90f919a4f38978e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:38:04 +0200 Subject: [PATCH 41/86] another typo, yessss --- .github/workflows/linux_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index c3e1be07..81a33615 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -16,7 +16,7 @@ permissions: jobs: setup-matrix: - runs-on: ubuntu-small + runs-on: ubuntu-slim outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: From d38d2c2a0872d5956a79a464f29514a7a6c0f7b7 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:42:12 +0200 Subject: [PATCH 42/86] fixed heredoc? --- .github/workflows/linux_build_test.yaml | 39 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 81a33615..15dcd565 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -15,7 +15,7 @@ permissions: packages: read jobs: - setup-matrix: +setup-matrix: runs-on: ubuntu-slim outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -25,19 +25,32 @@ jobs: PR_FLAG_TRIGGER: run-pre-merge-checks run: | if [[ "${{ github.event_name }}" == "pull_request" ]] && \ - [[ "${{ contains(github.event.pull_request.labels.*.name, '${{ env.PR_FLAG_TRIGGER }}') }}" == "true" ]]; then - - echo 'matrix={"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} - ]}' >> $GITHUB_OUTPUT + [[ "${{ contains(github.event.pull_request.labels.*.name, env.PR_FLAG_TRIGGER) }}" == "true" ]]; then + EOF_MARKER=$(openssl rand -hex 8) + { + echo "matrix<<$EOF_MARKER" + cat <<'JSON' + {"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} + ]} + JSON + echo "$EOF_MARKER" + } >> $GITHUB_OUTPUT else - echo 'matrix={"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} - ]}' >> $GITHUB_OUTPUT + EOF_MARKER=$(openssl rand -hex 8) + { + echo "matrix<<$EOF_MARKER" + cat <<'JSON' + {"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + ]} + JSON + echo "$EOF_MARKER" + } >> $GITHUB_OUTPUT fi linux-build: From 8eb6fbc4dd13b686087d47da5e058f596bc48c5c Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:47:17 +0200 Subject: [PATCH 43/86] is it working now? --- .github/workflows/linux_build_test.yaml | 45 ++++++++++--------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 15dcd565..0865f788 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -15,44 +15,33 @@ permissions: packages: read jobs: -setup-matrix: + setup-matrix: runs-on: ubuntu-slim outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - id: set-matrix - env: - PR_FLAG_TRIGGER: run-pre-merge-checks run: | if [[ "${{ github.event_name }}" == "pull_request" ]] && \ - [[ "${{ contains(github.event.pull_request.labels.*.name, env.PR_FLAG_TRIGGER) }}" == "true" ]]; then - EOF_MARKER=$(openssl rand -hex 8) - { - echo "matrix<<$EOF_MARKER" - cat <<'JSON' - {"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} - ]} - JSON - echo "$EOF_MARKER" - } >> $GITHUB_OUTPUT + [[ "${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }}" == "true" ]]; then + MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} + ]}' + else - EOF_MARKER=$(openssl rand -hex 8) - { - echo "matrix<<$EOF_MARKER" - cat <<'JSON' - {"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} - ]} - JSON - echo "$EOF_MARKER" - } >> $GITHUB_OUTPUT + MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + ]}' fi + echo "matrix<> $GITHUB_OUTPUT + echo "$MATRIX" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + linux-build: needs: setup-matrix if: | From 5b61bd2eb911825b6674c24c85212939dfa4f328 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:55:53 +0200 Subject: [PATCH 44/86] refactoring --- .github/workflows/linux_build_test.yaml | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 0865f788..93c489fc 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -21,20 +21,27 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - id: set-matrix + env: + IS_PR: ${{ github.event_name == 'pull_request' }} + IS_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} + HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} run: | - if [[ "${{ github.event_name }}" == "pull_request" ]] && \ - [[ "${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }}" == "true" ]]; then + if [[ "$IS_DISPATCH" == "true" ]] || \ + [[ "$IS_PR" == "true" && "$HAS_LABEL" == "true" ]]; then + MATRIX_NAME="release" + else + MATRIX_NAME="debug" + fi + + if [[ "$MATRIX_NAME" == "release" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} + {"runner":"ubuntu-24.04", "arch":"x64", "name":"clang_release", "configure_preset":"clang_release", "build_preset":"clang_release", "test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm", "arch":"arm64", "name":"clang_release", "configure_preset":"clang_release", "build_preset":"clang_release", "test_preset":"quick-validation-clang-release"} ]}' - else MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + {"runner":"ubuntu-24.04", "arch":"x64", "name":"clang_debug", "configure_preset":"clang_debug", "build_preset":"clang_debug", "test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm", "arch":"arm64", "name":"clang_debug", "configure_preset":"clang_debug", "build_preset":"clang_debug", "test_preset":"quick-validation-clang-debug"} ]}' fi @@ -44,12 +51,6 @@ jobs: linux-build: needs: setup-matrix - if: | - github.event_name == 'workflow_dispatch' || - ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) strategy: matrix: ${{ fromJson(needs.setup.outputs.matrix) }} From 3a05af5442fcc5801a91511ba9f786963eb3afcd Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 12:58:00 +0200 Subject: [PATCH 45/86] fixed invalid dependency between workflows --- .github/workflows/linux_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 93c489fc..c95c7eec 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -52,7 +52,7 @@ jobs: linux-build: needs: setup-matrix strategy: - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} From 2e8aa7abbec4af684434eaa93c05e01d046351f2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 13:08:56 +0200 Subject: [PATCH 46/86] trying to make macos runners use dynamic matrices also --- .github/workflows/macos_build.yaml | 51 +++++++++++++++++------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 71d86fbf..6b3c3c40 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -11,32 +11,39 @@ concurrency: cancel-in-progress: true jobs: +jobs: + setup-matrix: + runs-on: ubuntu-slim + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + env: + IS_PR: ${{ github.event_name == 'pull_request' }} + IS_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} + HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} + run: | + if [[ "$IS_DISPATCH" == "true" ]] || \ + [[ "$IS_PR" == "true" && "$HAS_LABEL" == "true" ]]; then + MATRIX='{"include":[ + {"runner":"macos-26", "arch":"arm64", "name":"clang_release", "configure_preset": "clang_release", "build_preset": "clang_release", "test_preset": "quick-validation-clang-release"} + {"runner":"macos-26-intel", "arch":"intel", "name":"clang_release", "configure_preset": "clang_release", "build_preset": "clang_release", "test_preset": "quick-validation-clang-release"}, + ]}' + else + MATRIX='{"include":[]}' + fi + + EOF_MARKER=$(openssl rand -hex 8) + { echo "matrix<<$EOF_MARKER"; echo "$MATRIX"; echo "$EOF_MARKER"; } >> $GITHUB_OUTPUT + macos-build: - if: | - ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) + needs: setup-matrix + if: ${{ needs.setup-matrix.outputs.matrix != '{"include":[]}' }} + strategy: + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - strategy: - matrix: - include: - - runner: macos-26-intel - arch: intel - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - - runner: macos-26 - arch: arm64 - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - steps: - uses: actions/checkout@v4 From ae3442904af19af688750e48445518bf9b0c0402 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 13:09:20 +0200 Subject: [PATCH 47/86] fixed typo --- .github/workflows/macos_build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 6b3c3c40..00ed3f03 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -10,7 +10,6 @@ concurrency: group: pr-${{ github.event.pull_request.number }}-macos-build cancel-in-progress: true -jobs: jobs: setup-matrix: runs-on: ubuntu-slim From c2777104b524f93cab4475b5539a6cd4d430bcd2 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 13:17:17 +0200 Subject: [PATCH 48/86] reverted on macos ci --- .github/workflows/linux_build_test.yaml | 5 +-- .github/workflows/macos_build.yaml | 50 +++++++++++-------------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index c95c7eec..90aff585 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -45,9 +45,8 @@ jobs: ]}' fi - echo "matrix<> $GITHUB_OUTPUT - echo "$MATRIX" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + EOF_MARKER=$(openssl rand -hex 8) + { echo "matrix<<$EOF_MARKER"; echo "$MATRIX"; echo "$EOF_MARKER"; } >> $GITHUB_OUTPUT linux-build: needs: setup-matrix diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 00ed3f03..71d86fbf 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -11,38 +11,32 @@ concurrency: cancel-in-progress: true jobs: - setup-matrix: - runs-on: ubuntu-slim - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - id: set-matrix - env: - IS_PR: ${{ github.event_name == 'pull_request' }} - IS_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} - HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} - run: | - if [[ "$IS_DISPATCH" == "true" ]] || \ - [[ "$IS_PR" == "true" && "$HAS_LABEL" == "true" ]]; then - MATRIX='{"include":[ - {"runner":"macos-26", "arch":"arm64", "name":"clang_release", "configure_preset": "clang_release", "build_preset": "clang_release", "test_preset": "quick-validation-clang-release"} - {"runner":"macos-26-intel", "arch":"intel", "name":"clang_release", "configure_preset": "clang_release", "build_preset": "clang_release", "test_preset": "quick-validation-clang-release"}, - ]}' - else - MATRIX='{"include":[]}' - fi - - EOF_MARKER=$(openssl rand -hex 8) - { echo "matrix<<$EOF_MARKER"; echo "$MATRIX"; echo "$EOF_MARKER"; } >> $GITHUB_OUTPUT - macos-build: - needs: setup-matrix - if: ${{ needs.setup-matrix.outputs.matrix != '{"include":[]}' }} - strategy: - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + if: | + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + strategy: + matrix: + include: + - runner: macos-26-intel + arch: intel + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + + - runner: macos-26 + arch: arm64 + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + steps: - uses: actions/checkout@v4 From 90fd7108b65de43f3ca85c0f51e6d7615d1cf998 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 14:12:13 +0200 Subject: [PATCH 49/86] added triggers for coverage badges update after pr merge --- .github/workflows/linux_build_test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 90aff585..1c79c8db 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -2,8 +2,10 @@ name: Linux Build Test on: workflow_dispatch: + push: + branches: [ main ] # triggers coverage badges generation after merge on main pull_request: - branches: [ main ] + branches: [ main ] # triggers debug builds on push and release builds on pr labelling types: [labeled, synchronize] concurrency: From af4551025ae3d42182c41b28942d3330e691ba9a Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 14:25:24 +0200 Subject: [PATCH 50/86] tried preflight system to bring more info --- .github/workflows/windows_build_test.yaml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index a905da98..07cbf8c3 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -11,12 +11,22 @@ concurrency: cancel-in-progress: true jobs: + preflight-skipped: + if: "!( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') )" + runs-on: ubuntu-slim + name: Preflight + steps: + - run: echo "Workflow not triggered — add label `run-pre-merge-checks` to this PR to run it." >> $GITHUB_STEP_SUMMARY + + preflight: + if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + runs-on: ubuntu-slim + name: Preflight checks + steps: + - run: echo "::notice::Label 'run-pre-merge-checks' has been detected, triggering complementary checks." + windows-build: - if: | - ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) + needs: preflight runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} From 236336b3222ac3bdfa1bbc2c1cc1aa4917924d65 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 14:30:38 +0200 Subject: [PATCH 51/86] updated workflow names --- .github/workflows/windows_build_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 07cbf8c3..cd53c82b 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -14,14 +14,14 @@ jobs: preflight-skipped: if: "!( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') )" runs-on: ubuntu-slim - name: Preflight + name: Inform steps: - run: echo "Workflow not triggered — add label `run-pre-merge-checks` to this PR to run it." >> $GITHUB_STEP_SUMMARY preflight: if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') runs-on: ubuntu-slim - name: Preflight checks + name: Preflight check steps: - run: echo "::notice::Label 'run-pre-merge-checks' has been detected, triggering complementary checks." From 813d284b2236890f27164f91431b16efdb52e1e3 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 14:30:57 +0200 Subject: [PATCH 52/86] commented back clang tidy triggers --- .github/workflows/clang_tidy.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 29c99fc9..877919d6 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -2,9 +2,9 @@ name: Clang Tidy Linting on: workflow_dispatch: - pull_request: - branches: [ main ] - types: [ synchronize ] + # pull_request: + # branches: [ main ] + # types: [ synchronize ] concurrency: group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting From 8ba7bb1c10b9d8b9c58417e44ce982dfd9887cd0 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 14:37:27 +0200 Subject: [PATCH 53/86] Reverted windows build test --- .github/workflows/windows_build_test.yaml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index cd53c82b..a905da98 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -11,22 +11,12 @@ concurrency: cancel-in-progress: true jobs: - preflight-skipped: - if: "!( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') )" - runs-on: ubuntu-slim - name: Inform - steps: - - run: echo "Workflow not triggered — add label `run-pre-merge-checks` to this PR to run it." >> $GITHUB_STEP_SUMMARY - - preflight: - if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - runs-on: ubuntu-slim - name: Preflight check - steps: - - run: echo "::notice::Label 'run-pre-merge-checks' has been detected, triggering complementary checks." - windows-build: - needs: preflight + if: | + ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} From 82dc332477c42345e7abf3633c93c5e8995c2959 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:25:40 +0200 Subject: [PATCH 54/86] updated windows and macos configs --- .github/workflows/macos_build.yaml | 20 +++++++++++++++----- .github/workflows/windows_build_test.yaml | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 71d86fbf..1b51ff18 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -1,26 +1,36 @@ name: MacOS Build Test on: - workflow_dispatch: pull_request: branches: [ main ] - types: [labeled, synchronize] + types: [labeled, synchronize, reopened] concurrency: - group: pr-${{ github.event.pull_request.number }}-macos-build + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: macos-build: if: | + github.event_name == 'pull_request' && ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ( + github.event.action == 'labeled' && + github.event.label.name == 'run-pre-merge-checks' + ) || + ( + github.event.action != 'labeled' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: + fail-fast: false matrix: include: - runner: macos-26-intel diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index a905da98..df337811 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -1,26 +1,36 @@ name: Windows Build Test on: - workflow_dispatch: pull_request: branches: [ main ] - types: [labeled, synchronize] + types: [labeled, synchronize, reopened] concurrency: - group: pr-${{ github.event.pull_request.number }}-windows-build + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: windows-build: if: | + github.event_name == 'pull_request' && ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ( + github.event.action == 'labeled' && + github.event.label.name == 'run-pre-merge-checks' + ) || + ( + github.event.action != 'labeled' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) ) runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} strategy: + fail-fast: false matrix: include: - runner: windows-2022 From c8e0d8cda317fa6f14a78e0b571bdac07d5e9410 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:26:02 +0200 Subject: [PATCH 55/86] reworked linux build and test --- .github/workflows/linux_build_test.yaml | 96 ++++++++++++++----------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 1c79c8db..99334a19 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -1,15 +1,14 @@ name: Linux Build Test on: - workflow_dispatch: push: - branches: [ main ] # triggers coverage badges generation after merge on main + branches: [ main ] pull_request: - branches: [ main ] # triggers debug builds on push and release builds on pr labelling - types: [labeled, synchronize] + branches: [ main ] + types: [opened, reopened, synchronize, labeled] concurrency: - group: pr-${{ github.event.pull_request.number }}-linux-build + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: @@ -17,50 +16,69 @@ permissions: packages: read jobs: - setup-matrix: - runs-on: ubuntu-slim + plan-linux-build: + runs-on: ubuntu-24.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} + should_run: ${{ steps.set-matrix.outputs.should_run }} + steps: - id: set-matrix env: - IS_PR: ${{ github.event_name == 'pull_request' }} - IS_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} - HAS_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} + EVENT_NAME: ${{ github.event_name }} + EVENT_ACTION: ${{ github.event.action }} + REF: ${{ github.ref }} + HAS_PREMERGE_LABEL: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') || false }} + ADDED_LABEL: ${{ github.event.action == 'labeled' && github.event.label.name || '' }} run: | - if [[ "$IS_DISPATCH" == "true" ]] || \ - [[ "$IS_PR" == "true" && "$HAS_LABEL" == "true" ]]; then - MATRIX_NAME="release" - else - MATRIX_NAME="debug" - fi - - if [[ "$MATRIX_NAME" == "release" ]]; then + if [[ "$EVENT_NAME" == "push" && "$REF" == "refs/heads/main" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04", "arch":"x64", "name":"clang_release", "configure_preset":"clang_release", "build_preset":"clang_release", "test_preset":"quick-validation-clang-release"}, - {"runner":"ubuntu-24.04-arm", "arch":"arm64", "name":"clang_release", "configure_preset":"clang_release", "build_preset":"clang_release", "test_preset":"quick-validation-clang-release"} + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":true} ]}' - else + elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]]; then + MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false} + ]}' + elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04", "arch":"x64", "name":"clang_debug", "configure_preset":"clang_debug", "build_preset":"clang_debug", "test_preset":"quick-validation-clang-debug"}, - {"runner":"ubuntu-24.04-arm", "arch":"arm64", "name":"clang_debug", "configure_preset":"clang_debug", "build_preset":"clang_debug", "test_preset":"quick-validation-clang-debug"} + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":false}, + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false} ]}' + elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" != "labeled" ]]; then + MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":false} + ]}' + else + MATRIX='{"include":[]}' + fi + + if [[ "$MATRIX" == '{"include":[]}' ]]; then + SHOULD_RUN=false + else + SHOULD_RUN=true fi EOF_MARKER=$(openssl rand -hex 8) - { echo "matrix<<$EOF_MARKER"; echo "$MATRIX"; echo "$EOF_MARKER"; } >> $GITHUB_OUTPUT + { + echo "matrix<<$EOF_MARKER" + echo "$MATRIX" + echo "$EOF_MARKER" + echo "should_run=$SHOULD_RUN" + } >> "$GITHUB_OUTPUT" linux-build: - needs: setup-matrix + needs: plan-linux-build + if: needs.plan-linux-build.outputs.should_run == 'true' strategy: - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} - + fail-fast: false + matrix: ${{ fromJson(needs.plan-linux-build.outputs.matrix) }} runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} permissions: - # coverage artefacts export requires write priviledges - # (html report and shields.io badge) + # The main-branch coverage lane publishes to gh-pages. contents: write steps: @@ -127,19 +145,15 @@ jobs: command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - name: Generate markdown coverage report (${{ matrix.test_preset }}) - if: matrix.name == 'clang_debug' + if: matrix.publish_coverage shell: bash run: | set +e cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + COV_EXIT_CODE=${PIPESTATUS[0]} set -e COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) - # -P: Uses Perl-style regex. - # -o: Only outputs the matched part (not the whole line). - # \K: Tells the engine to match the string but ignore it in the final output. - # .*: Matches the rest of the line (the path) if [ $COV_EXIT_CODE -eq 0 ]; then echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY @@ -155,13 +169,13 @@ jobs: exit $COV_EXIT_CODE - name: Generate html coverage report (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: matrix.publish_coverage id: htmlcov shell: bash run: | set +e cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + COV_EXIT_CODE=${PIPESTATUS[0]} set -e HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) @@ -170,13 +184,13 @@ jobs: exit $COV_EXIT_CODE - name: Generate shields.io badge (${{ matrix.test_preset }}) - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: matrix.publish_coverage id: shieldsio shell: bash run: | set +e cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee + COV_EXIT_CODE=${PIPESTATUS[0]} set -e SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) @@ -192,7 +206,7 @@ jobs: exit $COV_EXIT_CODE - name: Prepare files - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: matrix.publish_coverage shell: bash run: | mkdir -p out/coverage/badges @@ -203,7 +217,7 @@ jobs: cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges - name: Publish coverage badge and report to gh-pages - if: github.ref_name == 'main' && matrix.name == 'clang_debug' + if: matrix.publish_coverage uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} From e8477777777d778ced054fe34560d2e48a466942 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:30:24 +0200 Subject: [PATCH 56/86] Running plan linux build using a smaller machine --- .github/workflows/linux_build_test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 99334a19..1d030b43 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -17,7 +17,8 @@ permissions: jobs: plan-linux-build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-slim + name: Plan Linux Build outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} should_run: ${{ steps.set-matrix.outputs.should_run }} From dcfb92b4a2528f16b4b65c9abe0f3d5d80fc7f1b Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:42:01 +0200 Subject: [PATCH 57/86] testing --- .github/workflows/_rwf_macos_build_test.yaml | 70 ++++++++++++++ .github/workflows/macos_build.yaml | 97 +++++++------------- 2 files changed, 105 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/_rwf_macos_build_test.yaml diff --git a/.github/workflows/_rwf_macos_build_test.yaml b/.github/workflows/_rwf_macos_build_test.yaml new file mode 100644 index 00000000..0e1221a3 --- /dev/null +++ b/.github/workflows/_rwf_macos_build_test.yaml @@ -0,0 +1,70 @@ +name: Reusable macOS Build Test + +on: + workflow_call: + inputs: + runner: + required: true + type: string + arch: + required: true + type: string + name: + required: true + type: string + configure_preset: + required: true + type: string + build_preset: + required: true + type: string + test_preset: + required: true + type: string + +permissions: + contents: read + +jobs: + macos-build: + runs-on: ${{ inputs.runner }} + + steps: + - uses: actions/checkout@v4 + + - name: Setup pre-installed VCPKG + run: | + echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV + + - name: Cache VCPKG + run: | + # Use the GitHub Actions cache as a binary source. + echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV + env: + ACTIONS_CACHE_URL: ${{ secrets.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + + - name: Configure (${{ inputs.configure_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Configure (${{ inputs.configure_preset }}) + command: "cmake --preset ${{ inputs.configure_preset }}" + + - name: Build (${{ inputs.build_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Build (${{ inputs.build_preset }}) + command: "cmake --build --preset ${{ inputs.build_preset }}" + + - name: Test (${{ inputs.test_preset }}) + uses: ./.github/actions/_log_to_gh_summary + with: + step-name: Test (${{ inputs.test_preset }}) + command: "ctest --preset ${{ inputs.test_preset }} --output-on-failure" diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build.yaml index 1b51ff18..9355b1f8 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build.yaml @@ -13,7 +13,7 @@ permissions: contents: read jobs: - macos-build: + macos-intel-build: if: | github.event_name == 'pull_request' && ( @@ -26,64 +26,37 @@ jobs: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') ) ) - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - - strategy: - fail-fast: false - matrix: - include: - - runner: macos-26-intel - arch: intel - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - - runner: macos-26 - arch: arm64 - name: clang_release - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - - steps: - - uses: actions/checkout@v4 - - - name: Setup pre-installed VCPKG - run: | - echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - - - name: Cache VCPKG - run: | - # Use the GitHub Actions cache as a binary source - echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV - env: - # These variables are required for the 'x-gha' provider to talk to GitHub's cache API - ACTIONS_CACHE_URL: ${{ secrets.ACTIONS_CACHE_URL }} - ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - - - name: Configure (${{ matrix.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Configure (${{ matrix.configure_preset }}) - command: "cmake --preset ${{ matrix.configure_preset }}" - - - name: Build (${{ matrix.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Build (${{ matrix.build_preset }}) - command: "cmake --build --preset ${{ matrix.build_preset }}" - - - name: Test (${{ matrix.test_preset }}) - uses: ./.github/actions/_log_to_gh_summary - with: - step-name: Test (${{ matrix.test_preset }}) - command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" + name: macos-26-intel - quick-validation-clang-release + uses: ./.github/workflows/_rwf_macos_build_test.yaml + with: + runner: macos-26-intel + arch: intel + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + secrets: inherit + + macos-arm-build: + if: | + github.event_name == 'pull_request' && + ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'run-pre-merge-checks' + ) || + ( + github.event.action != 'labeled' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) + ) + name: macos-26 - quick-validation-clang-release + uses: ./.github/workflows/_rwf_macos_build_test.yaml + with: + runner: macos-26 + arch: arm64 + name: clang_release + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + secrets: inherit From 77e0be73c7f02064e4a867c67c9e4e0fbaffcc53 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:45:18 +0200 Subject: [PATCH 58/86] renamed reusable workflow --- .github/workflows/_rwf_macos_build_test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_rwf_macos_build_test.yaml b/.github/workflows/_rwf_macos_build_test.yaml index 0e1221a3..4d9136c3 100644 --- a/.github/workflows/_rwf_macos_build_test.yaml +++ b/.github/workflows/_rwf_macos_build_test.yaml @@ -28,6 +28,7 @@ permissions: jobs: macos-build: runs-on: ${{ inputs.runner }} + name: macOS Build & Test steps: - uses: actions/checkout@v4 From 107c2a982a5ee425896caa46a6ed57d51a2c6646 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:52:41 +0200 Subject: [PATCH 59/86] refactored windows ci --- .../_log_to_gh_summary_pwsh/action.yaml | 43 ++++ .../workflows/_rwf_windows_build_test.yaml | 72 +++++++ .github/workflows/windows_build_test.yaml | 185 ++++++------------ 3 files changed, 174 insertions(+), 126 deletions(-) create mode 100644 .github/actions/_log_to_gh_summary_pwsh/action.yaml create mode 100644 .github/workflows/_rwf_windows_build_test.yaml diff --git a/.github/actions/_log_to_gh_summary_pwsh/action.yaml b/.github/actions/_log_to_gh_summary_pwsh/action.yaml new file mode 100644 index 00000000..c35ef0fc --- /dev/null +++ b/.github/actions/_log_to_gh_summary_pwsh/action.yaml @@ -0,0 +1,43 @@ +name: CMake PowerShell Step With Summary +description: Runs a command and logs output to GitHub Step Summary on Windows runners + +inputs: + step-name: + description: Display name (e.g. Build, Configure) + required: true + command: + description: The full command to run + required: true + output-file: + description: Temporary text file to store command output + required: false + default: tmp_step_output.txt + +runs: + using: composite + steps: + - shell: pwsh + run: | + $command = "${{ inputs.command }}" + $outputFile = "${{ inputs.output-file }}" + + $global:LASTEXITCODE = 0 + Invoke-Expression "$command 2>&1" | Tee-Object -FilePath $outputFile + $exitCode = if ($null -ne $LASTEXITCODE) { $LASTEXITCODE } else { 0 } + + if ($exitCode -eq 0) { + Add-Content $env:GITHUB_STEP_SUMMARY "
🟢 ${{ inputs.step-name }} Successful" + } else { + Add-Content $env:GITHUB_STEP_SUMMARY "## 🔴 ${{ inputs.step-name }} Failed" + } + + Add-Content $env:GITHUB_STEP_SUMMARY "" + Add-Content $env:GITHUB_STEP_SUMMARY '```text' + Get-Content $outputFile -Tail 500 | Add-Content $env:GITHUB_STEP_SUMMARY + Add-Content $env:GITHUB_STEP_SUMMARY '```' + + if ($exitCode -eq 0) { + Add-Content $env:GITHUB_STEP_SUMMARY "
" + } + + exit $exitCode diff --git a/.github/workflows/_rwf_windows_build_test.yaml b/.github/workflows/_rwf_windows_build_test.yaml new file mode 100644 index 00000000..1282aaf0 --- /dev/null +++ b/.github/workflows/_rwf_windows_build_test.yaml @@ -0,0 +1,72 @@ +name: Reusable Windows Build Test + +on: + workflow_call: + inputs: + runner: + required: true + type: string + arch: + required: true + type: string + name: + required: true + type: string + configure_preset: + required: true + type: string + build_preset: + required: true + type: string + test_preset: + required: true + type: string + +permissions: + contents: read + +jobs: + windows-build: + runs-on: ${{ inputs.runner }} + name: Windows Build & Test + + steps: + - uses: actions/checkout@v4 + + - name: Cache VCPKG + uses: actions/cache@v4 + with: + path: | + C:\vcpkg\installed + C:\vcpkg\packages + C:\vcpkg\buildtrees + ~\AppData\Local\vcpkg\archives + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + + - name: Configure (${{ inputs.configure_preset }}) + uses: ./.github/actions/_log_to_gh_summary_pwsh + env: + VCPKG_ROOT: C:\vcpkg + with: + step-name: Configure (${{ inputs.configure_preset }}) + command: "cmake --preset ${{ inputs.configure_preset }}" + + - name: Build (${{ inputs.build_preset }}) + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: Build (${{ inputs.build_preset }}) + command: "cmake --build --preset ${{ inputs.build_preset }}" + + - name: Test (${{ inputs.test_preset }}) + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: Test (${{ inputs.test_preset }}) + command: "ctest --preset ${{ inputs.test_preset }} --output-on-failure" diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index df337811..1f8afd5f 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -13,7 +13,7 @@ permissions: contents: read jobs: - windows-build: + windows-2022-build: if: | github.event_name == 'pull_request' && ( @@ -26,128 +26,61 @@ jobs: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') ) ) - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - - strategy: - fail-fast: false - matrix: - include: - - runner: windows-2022 - arch: x64 - name: msvc_release - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release - - - runner: windows-2025 - arch: x64 - name: msvc_release - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release - - - runner: windows-11-arm - arch: arm64 - name: msvc_release - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release - - steps: - - uses: actions/checkout@v4 - - - name: Cache VCPKG - uses: actions/cache@v4 - with: - path: | - C:\vcpkg\installed - C:\vcpkg\packages - C:\vcpkg\buildtrees - ~\AppData\Local\vcpkg\archives - key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - - - name: Configure (${{ matrix.configure_preset }}) - env: - VCPKG_ROOT: C:\vcpkg - shell: pwsh - run: | - $outputFile = "configure_output.txt" - - cmake --preset ${{ matrix.configure_preset }} 2>&1 | Tee-Object -FilePath $outputFile - $exitCode = $LASTEXITCODE - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
🟢 Configure Results (click to expand)" - } else { - Add-Content $env:GITHUB_STEP_SUMMARY "## 🔴 Configure Results" - } - - Add-Content $env:GITHUB_STEP_SUMMARY "" - Add-Content $env:GITHUB_STEP_SUMMARY '```' - Get-Content $outputFile | Add-Content $env:GITHUB_STEP_SUMMARY - Add-Content $env:GITHUB_STEP_SUMMARY '```' - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
" - } - - exit $exitCode - - - name: Build (${{ matrix.build_preset }}) - shell: pwsh - run: | - $outputFile = "build_output.txt" - - cmake --build --preset ${{ matrix.build_preset }} 2>&1 | Tee-Object -FilePath $outputFile - $exitCode = $LASTEXITCODE - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
🟢 Build Results (click to expand)" - } else { - Add-Content $env:GITHUB_STEP_SUMMARY "## 🔴 Build Results" - } - - Add-Content $env:GITHUB_STEP_SUMMARY "" - Add-Content $env:GITHUB_STEP_SUMMARY '```' - Get-Content $outputFile | Add-Content $env:GITHUB_STEP_SUMMARY - Add-Content $env:GITHUB_STEP_SUMMARY '```' - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
" - } - - exit $exitCode - - - name: Test (${{ matrix.test_preset }}) - shell: pwsh - run: | - $outputFile = "test_output.txt" - - ctest --preset ${{ matrix.test_preset }} --output-on-failure 2>&1 | Tee-Object -FilePath $outputFile - $exitCode = $LASTEXITCODE - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
🟢 Test Results (click to expand)" - } else { - Add-Content $env:GITHUB_STEP_SUMMARY "## 🔴 Test Results" - } - - Add-Content $env:GITHUB_STEP_SUMMARY "" - Add-Content $env:GITHUB_STEP_SUMMARY '```' - Get-Content $outputFile | Add-Content $env:GITHUB_STEP_SUMMARY - Add-Content $env:GITHUB_STEP_SUMMARY '```' - - if ($exitCode -eq 0) { - Add-Content $env:GITHUB_STEP_SUMMARY "
" - } - - exit $exitCode + name: windows-2022 - quick-validation-msvc-release + uses: ./.github/workflows/_rwf_windows_build_test.yaml + with: + runner: windows-2022 + arch: x64 + name: msvc_release + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + secrets: inherit + + windows-2025-build: + if: | + github.event_name == 'pull_request' && + ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'run-pre-merge-checks' + ) || + ( + github.event.action != 'labeled' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) + ) + name: windows-2025 - quick-validation-msvc-release + uses: ./.github/workflows/_rwf_windows_build_test.yaml + with: + runner: windows-2025 + arch: x64 + name: msvc_release + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + secrets: inherit + + windows-11-arm-build: + if: | + github.event_name == 'pull_request' && + ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'run-pre-merge-checks' + ) || + ( + github.event.action != 'labeled' && + contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + ) + ) + name: windows-11-arm - quick-validation-msvc-release + uses: ./.github/workflows/_rwf_windows_build_test.yaml + with: + runner: windows-11-arm + arch: arm64 + name: msvc_release + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + secrets: inherit From 9475041ab0b40937f1d156542a2d3fdd4e4def6e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 15:54:10 +0200 Subject: [PATCH 60/86] renamed composite action --- .../action.yaml | 0 .github/workflows/_rwf_macos_build_test.yaml | 6 +++--- .github/workflows/clang_tidy.yaml | 2 +- .github/workflows/linux_build_test.yaml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename .github/actions/{_log_to_gh_summary => _log_to_gh_summary_bash}/action.yaml (100%) diff --git a/.github/actions/_log_to_gh_summary/action.yaml b/.github/actions/_log_to_gh_summary_bash/action.yaml similarity index 100% rename from .github/actions/_log_to_gh_summary/action.yaml rename to .github/actions/_log_to_gh_summary_bash/action.yaml diff --git a/.github/workflows/_rwf_macos_build_test.yaml b/.github/workflows/_rwf_macos_build_test.yaml index 4d9136c3..4e06bcac 100644 --- a/.github/workflows/_rwf_macos_build_test.yaml +++ b/.github/workflows/_rwf_macos_build_test.yaml @@ -53,19 +53,19 @@ jobs: restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- - name: Configure (${{ inputs.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Configure (${{ inputs.configure_preset }}) command: "cmake --preset ${{ inputs.configure_preset }}" - name: Build (${{ inputs.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Build (${{ inputs.build_preset }}) command: "cmake --build --preset ${{ inputs.build_preset }}" - name: Test (${{ inputs.test_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Test (${{ inputs.test_preset }}) command: "ctest --preset ${{ inputs.test_preset }} --output-on-failure" diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 877919d6..552c1301 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -76,7 +76,7 @@ jobs: run: cmake --preset ${{ matrix.configure_preset }} - name: Run clang-tidy - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Run clang-tidy (${{ matrix.configure_preset }}) command: "cmake --build --preset ${{ matrix.build_preset }} --target clang-tidy" diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 1d030b43..c3553ae6 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -128,19 +128,19 @@ jobs: restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- - name: Configure (${{ matrix.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Configure (${{ matrix.configure_preset }}) command: "cmake --preset ${{ matrix.configure_preset }}" - name: Build (${{ matrix.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Build (${{ matrix.build_preset }}) command: "cmake --build --preset ${{ matrix.build_preset }}" - name: Test (${{ matrix.test_preset }}) - uses: ./.github/actions/_log_to_gh_summary + uses: ./.github/actions/_log_to_gh_summary_bash with: step-name: Test (${{ matrix.test_preset }}) command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" From 47ca33a32c947fc9288732e0f4ca315f6c40cf06 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 16:07:05 +0200 Subject: [PATCH 61/86] linux ci - dry --- .../_publish_linux_coverage/action.yaml | 97 ++++++++++++++ .github/actions/_setup_linux_ci/action.yaml | 57 ++++++++ .github/workflows/clang_tidy.yaml | 59 ++------ .github/workflows/linux_build_test.yaml | 126 ++---------------- 4 files changed, 176 insertions(+), 163 deletions(-) create mode 100644 .github/actions/_publish_linux_coverage/action.yaml create mode 100644 .github/actions/_setup_linux_ci/action.yaml diff --git a/.github/actions/_publish_linux_coverage/action.yaml b/.github/actions/_publish_linux_coverage/action.yaml new file mode 100644 index 00000000..c9fc40a2 --- /dev/null +++ b/.github/actions/_publish_linux_coverage/action.yaml @@ -0,0 +1,97 @@ +name: Publish Linux Coverage +description: Generates coverage summaries and publishes the HTML report and badges to GitHub Pages + +inputs: + build-preset: + description: CMake build preset used to generate coverage artifacts + required: true + github-token: + description: GitHub token used to publish the generated site + required: true + publish-branch: + description: Git branch used by GitHub Pages + required: false + default: gh-pages + publish-dir: + description: Directory prepared locally before publication + required: false + default: out + +runs: + using: composite + steps: + - name: Generate markdown coverage report + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) + + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
🟢 Coverage Results (click to expand)" >> "$GITHUB_STEP_SUMMARY" + else + echo "## 🔴 Coverage Results" >> "$GITHUB_STEP_SUMMARY" + fi + echo '' >> "$GITHUB_STEP_SUMMARY" + cat "$COVERAGE_FILE" >> "$GITHUB_STEP_SUMMARY" + if [ $COV_EXIT_CODE -eq 0 ]; then + echo "
" >> "$GITHUB_STEP_SUMMARY" + fi + + exit $COV_EXIT_CODE + + - name: Generate html coverage report + id: htmlcov + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-html 2>&1 | tee coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) + echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Generate shields.io badge + id: shieldsio + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + + echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Prepare files + shell: bash + run: | + mkdir -p "${{ inputs.publish-dir }}/coverage/badges" + cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" "${{ inputs.publish-dir }}/coverage/" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + + - name: Publish coverage badge and report to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ inputs.github-token }} + publish_branch: ${{ inputs.publish-branch }} + publish_dir: ${{ inputs.publish-dir }} + keep_files: true diff --git a/.github/actions/_setup_linux_ci/action.yaml b/.github/actions/_setup_linux_ci/action.yaml new file mode 100644 index 00000000..32cfcc4a --- /dev/null +++ b/.github/actions/_setup_linux_ci/action.yaml @@ -0,0 +1,57 @@ +name: Setup Linux CMake CI +description: Installs the Linux toolchain, bootstraps vcpkg, and restores common CMake caches + +inputs: + arch: + description: Architecture label used in cache keys + required: true + cache-name: + description: Build flavor label used in cache keys + required: true + +runs: + using: composite + steps: + - name: Install dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + clang \ + clang-tidy \ + llvm \ + gcc \ + g++ \ + git \ + curl \ + zip \ + unzip \ + pkg-config \ + ninja-build \ + cmake + + - name: Setup vcpkg + shell: bash + run: | + git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg + /tmp/vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_ROOT=/tmp/vcpkg" >> "$GITHUB_ENV" + echo "/tmp/vcpkg" >> "$GITHUB_PATH" + + - name: Cache VCPKG + uses: actions/cache@v4 + with: + path: | + /tmp/vcpkg/downloads + /tmp/vcpkg/installed + ~/.cache/vcpkg + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.cache-name }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.cache-name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 552c1301..4bcc8eed 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -2,12 +2,12 @@ name: Clang Tidy Linting on: workflow_dispatch: - # pull_request: - # branches: [ main ] - # types: [ synchronize ] + pull_request: + branches: [ main ] + types: [ synchronize ] concurrency: - group: pr-${{ github.event.pull_request.number }}-clang-tidy-linting + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: @@ -20,9 +20,10 @@ jobs: name: ${{ matrix.runner }} - ${{ matrix.name }} strategy: + fail-fast: false matrix: include: - - runner: ubuntu-latest + - runner: ubuntu-24.04 arch: x64 name: clang_debug configure_preset: clang_debug @@ -31,49 +32,17 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - clang \ - clang-tidy \ - gcc \ - g++ \ - git \ - curl \ - zip \ - unzip \ - pkg-config \ - ninja-build \ - cmake - - - name: Setup vcpkg - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH - - - name: Cache VCPKG - uses: actions/cache@v4 - with: - path: | - /tmp/vcpkg/downloads - /tmp/vcpkg/installed - ~/.cache/vcpkg - key: ${{ runner.os }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 + - name: Setup Linux CI + uses: ./.github/actions/_setup_linux_ci with: - path: build - key: ${{ runner.os }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-cmake- + arch: ${{ matrix.arch }} + cache-name: ${{ matrix.name }} - name: Configure (${{ matrix.configure_preset }}) - run: cmake --preset ${{ matrix.configure_preset }} + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Configure (${{ matrix.configure_preset }}) + command: "cmake --preset ${{ matrix.configure_preset }}" - name: Run clang-tidy uses: ./.github/actions/_log_to_gh_summary_bash diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index c3553ae6..a0714552 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -85,47 +85,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - clang \ - clang-tidy \ - llvm \ - gcc \ - g++ \ - git \ - curl \ - zip \ - unzip \ - pkg-config \ - ninja-build \ - cmake - - - name: Setup vcpkg - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> $GITHUB_ENV - echo "/tmp/vcpkg" >> $GITHUB_PATH - - - name: Cache VCPKG - uses: actions/cache@v4 + - name: Setup Linux CI + uses: ./.github/actions/_setup_linux_ci with: - path: | - /tmp/vcpkg/downloads - /tmp/vcpkg/installed - ~/.cache/vcpkg - key: ${{ runner.os }}-${{ matrix.arch }}-vcpkg-${{ matrix.name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ matrix.arch }}-cmake-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ matrix.arch }}-cmake- + arch: ${{ matrix.arch }} + cache-name: ${{ matrix.name }} - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary_bash @@ -145,83 +109,9 @@ jobs: step-name: Test (${{ matrix.test_preset }}) command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - - name: Generate markdown coverage report (${{ matrix.test_preset }}) - if: matrix.publish_coverage - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) - - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
🟢 Coverage Results (click to expand)" >> $GITHUB_STEP_SUMMARY - else - echo "## 🔴 Coverage Results" >> $GITHUB_STEP_SUMMARY - fi - echo '' >> $GITHUB_STEP_SUMMARY - cat $COVERAGE_FILE >> $GITHUB_STEP_SUMMARY - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
" >> $GITHUB_STEP_SUMMARY - fi - - exit $COV_EXIT_CODE - - - name: Generate html coverage report (${{ matrix.test_preset }}) - if: matrix.publish_coverage - id: htmlcov - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) - echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Generate shields.io badge (${{ matrix.test_preset }}) - if: matrix.publish_coverage - id: shieldsio - shell: bash - run: | - set +e - cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - - echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Prepare files - if: matrix.publish_coverage - shell: bash - run: | - mkdir -p out/coverage/badges - cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" out/coverage/ - cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" out/coverage/badges - cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" out/coverage/badges - - - name: Publish coverage badge and report to gh-pages + - name: Publish coverage (${{ matrix.build_preset }}) if: matrix.publish_coverage - uses: peaceiris/actions-gh-pages@v4 + uses: ./.github/actions/_publish_linux_coverage with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: out - keep_files: true + build-preset: ${{ matrix.build_preset }} + github-token: ${{ secrets.GITHUB_TOKEN }} From 1bae7c39583b27c6833046b57812a2b37bbfbbf5 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 16:47:18 +0200 Subject: [PATCH 62/86] lots of tuning --- .../_generate_llvm_html_coverage/action.yaml | 28 ++++++ .../_publish_linux_coverage/action.yaml | 97 ------------------- .github/workflows/_rwf_macos_build_test.yaml | 5 +- .../workflows/_rwf_windows_build_test.yaml | 7 +- .github/workflows/linux_build_test.yaml | 50 ++++------ ...macos_build.yaml => macos_build_test.yaml} | 2 - .github/workflows/publish_llvm_coverage.yaml | 90 +++++++++++++++++ .github/workflows/windows_build_test.yaml | 3 - 8 files changed, 142 insertions(+), 140 deletions(-) create mode 100644 .github/actions/_generate_llvm_html_coverage/action.yaml delete mode 100644 .github/actions/_publish_linux_coverage/action.yaml rename .github/workflows/{macos_build.yaml => macos_build_test.yaml} (96%) create mode 100644 .github/workflows/publish_llvm_coverage.yaml diff --git a/.github/actions/_generate_llvm_html_coverage/action.yaml b/.github/actions/_generate_llvm_html_coverage/action.yaml new file mode 100644 index 00000000..51462794 --- /dev/null +++ b/.github/actions/_generate_llvm_html_coverage/action.yaml @@ -0,0 +1,28 @@ +name: Generate LLVM HTML Coverage +description: Builds the HTML coverage report for a coverage-enabled LLVM preset + +inputs: + build-preset: + description: CMake build preset used to generate HTML coverage artifacts + required: true + +outputs: + html-cov-dir: + description: Directory containing the generated HTML coverage report + value: ${{ steps.htmlcov.outputs.html_cov_dir }} + +runs: + using: composite + steps: + - id: htmlcov + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-html 2>&1 | tee coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) + echo "html_cov_dir=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE diff --git a/.github/actions/_publish_linux_coverage/action.yaml b/.github/actions/_publish_linux_coverage/action.yaml deleted file mode 100644 index c9fc40a2..00000000 --- a/.github/actions/_publish_linux_coverage/action.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: Publish Linux Coverage -description: Generates coverage summaries and publishes the HTML report and badges to GitHub Pages - -inputs: - build-preset: - description: CMake build preset used to generate coverage artifacts - required: true - github-token: - description: GitHub token used to publish the generated site - required: true - publish-branch: - description: Git branch used by GitHub Pages - required: false - default: gh-pages - publish-dir: - description: Directory prepared locally before publication - required: false - default: out - -runs: - using: composite - steps: - - name: Generate markdown coverage report - shell: bash - run: | - set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-markdown 2>&1 | tee coverage_gh_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - COVERAGE_FILE=$(grep -Po "GitHub Markdown summary written to: \K.*" coverage_gh_summary.txt) - - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
🟢 Coverage Results (click to expand)" >> "$GITHUB_STEP_SUMMARY" - else - echo "## 🔴 Coverage Results" >> "$GITHUB_STEP_SUMMARY" - fi - echo '' >> "$GITHUB_STEP_SUMMARY" - cat "$COVERAGE_FILE" >> "$GITHUB_STEP_SUMMARY" - if [ $COV_EXIT_CODE -eq 0 ]; then - echo "
" >> "$GITHUB_STEP_SUMMARY" - fi - - exit $COV_EXIT_CODE - - - name: Generate html coverage report - id: htmlcov - shell: bash - run: | - set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-html 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) - echo "HTML_COV_DIR=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Generate shields.io badge - id: shieldsio - shell: bash - run: | - set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - - echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Prepare files - shell: bash - run: | - mkdir -p "${{ inputs.publish-dir }}/coverage/badges" - cp -r "${{ steps.htmlcov.outputs.HTML_COV_DIR }}" "${{ inputs.publish-dir }}/coverage/" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - - - name: Publish coverage badge and report to gh-pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ inputs.github-token }} - publish_branch: ${{ inputs.publish-branch }} - publish_dir: ${{ inputs.publish-dir }} - keep_files: true diff --git a/.github/workflows/_rwf_macos_build_test.yaml b/.github/workflows/_rwf_macos_build_test.yaml index 4e06bcac..364480d5 100644 --- a/.github/workflows/_rwf_macos_build_test.yaml +++ b/.github/workflows/_rwf_macos_build_test.yaml @@ -9,9 +9,6 @@ on: arch: required: true type: string - name: - required: true - type: string configure_preset: required: true type: string @@ -49,7 +46,7 @@ jobs: uses: actions/cache@v4 with: path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build_preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- - name: Configure (${{ inputs.configure_preset }}) diff --git a/.github/workflows/_rwf_windows_build_test.yaml b/.github/workflows/_rwf_windows_build_test.yaml index 1282aaf0..9d254bcf 100644 --- a/.github/workflows/_rwf_windows_build_test.yaml +++ b/.github/workflows/_rwf_windows_build_test.yaml @@ -9,9 +9,6 @@ on: arch: required: true type: string - name: - required: true - type: string configure_preset: required: true type: string @@ -41,14 +38,14 @@ jobs: C:\vcpkg\packages C:\vcpkg\buildtrees ~\AppData\Local\vcpkg\archives - key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.name }}-${{ hashFiles('vcpkg.json') }} + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build_preset }}-${{ hashFiles('vcpkg.json') }} restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- - name: Cache build uses: actions/cache@v4 with: path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build_preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- - name: Configure (${{ inputs.configure_preset }}) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index a0714552..b83936ff 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -1,8 +1,6 @@ name: Linux Build Test on: - push: - branches: [ main ] pull_request: branches: [ main ] types: [opened, reopened, synchronize, labeled] @@ -26,30 +24,20 @@ jobs: steps: - id: set-matrix env: - EVENT_NAME: ${{ github.event_name }} EVENT_ACTION: ${{ github.event.action }} - REF: ${{ github.ref }} - HAS_PREMERGE_LABEL: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') || false }} + HAS_PREMERGE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} ADDED_LABEL: ${{ github.event.action == 'labeled' && github.event.label.name || '' }} run: | - if [[ "$EVENT_NAME" == "push" && "$REF" == "refs/heads/main" ]]; then - MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":true} - ]}' - elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]]; then - MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false} - ]}' - elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then + if [[ "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]] || \ + [[ "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":false}, - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false}, - {"runner":"ubuntu-24.04-arm","arch":"arm64","name":"clang_release","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release","publish_coverage":false} + {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' - elif [[ "$EVENT_NAME" == "pull_request" && "$EVENT_ACTION" != "labeled" ]]; then + elif [[ "$EVENT_ACTION" != "labeled" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","name":"clang_debug","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug","publish_coverage":false} + {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} ]}' else MATRIX='{"include":[]}' @@ -78,10 +66,6 @@ jobs: runs-on: ${{ matrix.runner }} name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - permissions: - # The main-branch coverage lane publishes to gh-pages. - contents: write - steps: - uses: actions/checkout@v4 @@ -89,7 +73,7 @@ jobs: uses: ./.github/actions/_setup_linux_ci with: arch: ${{ matrix.arch }} - cache-name: ${{ matrix.name }} + cache-name: ${{ matrix.build_preset }} - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary_bash @@ -109,9 +93,17 @@ jobs: step-name: Test (${{ matrix.test_preset }}) command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" - - name: Publish coverage (${{ matrix.build_preset }}) - if: matrix.publish_coverage - uses: ./.github/actions/_publish_linux_coverage + - name: Generate coverage HTML (${{ matrix.build_preset }}) + if: matrix.build_preset == 'clang_debug' + id: htmlcov + uses: ./.github/actions/_generate_llvm_html_coverage with: build-preset: ${{ matrix.build_preset }} - github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload coverage artifact (${{ matrix.build_preset }}) + if: matrix.build_preset == 'clang_debug' + uses: actions/upload-artifact@v4 + with: + name: llvm-html-coverage-${{ matrix.runner }}-${{ matrix.build_preset }} + path: ${{ steps.htmlcov.outputs.html-cov-dir }} + if-no-files-found: error diff --git a/.github/workflows/macos_build.yaml b/.github/workflows/macos_build_test.yaml similarity index 96% rename from .github/workflows/macos_build.yaml rename to .github/workflows/macos_build_test.yaml index 9355b1f8..72630794 100644 --- a/.github/workflows/macos_build.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -31,7 +31,6 @@ jobs: with: runner: macos-26-intel arch: intel - name: clang_release configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release @@ -55,7 +54,6 @@ jobs: with: runner: macos-26 arch: arm64 - name: clang_release configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml new file mode 100644 index 00000000..29d65e65 --- /dev/null +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -0,0 +1,90 @@ +name: Publish LLVM Coverage + +on: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + packages: read + +jobs: + linux-coverage-publish: + runs-on: ubuntu-24.04 + name: ubuntu-24.04 - quick-validation-clang-debug + + steps: + - uses: actions/checkout@v4 + + - name: Setup Linux CI + uses: ./.github/actions/_setup_linux_ci + with: + arch: x64 + cache-name: clang_debug + + - name: Configure (clang_debug) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Configure (clang_debug) + command: "cmake --preset clang_debug" + + - name: Build (clang_debug) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Build (clang_debug) + command: "cmake --build --preset clang_debug" + + - name: Test (quick-validation-clang-debug) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Test (quick-validation-clang-debug) + command: "ctest --preset quick-validation-clang-debug --output-on-failure" + + - name: Generate html coverage report + id: htmlcov + uses: ./.github/actions/_generate_llvm_html_coverage + with: + build-preset: ${{ inputs.build-preset }} + + - name: Generate shields.io badge + id: shieldsio + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + + echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Prepare files + shell: bash + run: | + mkdir -p "${{ inputs.publish-dir }}/coverage/badges" + cp -r "${{ steps.htmlcov.outputs.html-cov-dir }}" "${{ inputs.publish-dir }}/coverage/" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + + - name: Publish coverage badge and report to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ inputs.github-token }} + publish_branch: ${{ inputs.publish-branch }} + publish_dir: ${{ inputs.publish-dir }} + keep_files: true diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 1f8afd5f..b06c6a42 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -31,7 +31,6 @@ jobs: with: runner: windows-2022 arch: x64 - name: msvc_release configure_preset: msvc_release build_preset: msvc_release test_preset: quick-validation-msvc-release @@ -55,7 +54,6 @@ jobs: with: runner: windows-2025 arch: x64 - name: msvc_release configure_preset: msvc_release build_preset: msvc_release test_preset: quick-validation-msvc-release @@ -79,7 +77,6 @@ jobs: with: runner: windows-11-arm arch: arm64 - name: msvc_release configure_preset: msvc_release build_preset: msvc_release test_preset: quick-validation-msvc-release From 54d198615dcd77d8a9f11a6b39e33d9e1812d45f Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 16:57:04 +0200 Subject: [PATCH 63/86] removed clang debug configuration when using pre merge label --- .github/workflows/linux_build_test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index b83936ff..8e5b2577 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -31,7 +31,6 @@ jobs: if [[ "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]] || \ [[ "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' From 20247be192df8d4cae9808574bbfbd2a81d96aad Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:00:08 +0200 Subject: [PATCH 64/86] here it is --- .../_publish_llvm_coverage/action.yaml | 66 +++++++++++++++++++ .github/workflows/linux_build_test.yaml | 1 + .github/workflows/publish_llvm_coverage.yaml | 47 ++----------- 3 files changed, 71 insertions(+), 43 deletions(-) create mode 100644 .github/actions/_publish_llvm_coverage/action.yaml diff --git a/.github/actions/_publish_llvm_coverage/action.yaml b/.github/actions/_publish_llvm_coverage/action.yaml new file mode 100644 index 00000000..119b151b --- /dev/null +++ b/.github/actions/_publish_llvm_coverage/action.yaml @@ -0,0 +1,66 @@ +name: Publish LLVM Coverage +description: Publishes the HTML coverage report and shields badges to GitHub Pages + +inputs: + build-preset: + description: CMake build preset used to generate coverage artifacts + required: true + github-token: + description: GitHub token used to publish the generated site + required: true + publish-branch: + description: Git branch used by GitHub Pages + required: false + default: gh-pages + publish-dir: + description: Directory prepared locally before publication + required: false + default: out + +runs: + using: composite + steps: + - name: Generate html coverage report + id: htmlcov + uses: ./.github/actions/_generate_llvm_html_coverage + with: + build-preset: ${{ inputs.build-preset }} + + - name: Generate shields.io badge + id: shieldsio + shell: bash + run: | + set +e + cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + set -e + + SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) + + echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" + + exit $COV_EXIT_CODE + + - name: Prepare files + shell: bash + run: | + mkdir -p "${{ inputs.publish-dir }}/coverage/badges" + cp -r "${{ steps.htmlcov.outputs.html-cov-dir }}" "${{ inputs.publish-dir }}/coverage/" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" + + - name: Publish coverage badge and report to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ inputs.github-token }} + publish_branch: ${{ inputs.publish-branch }} + publish_dir: ${{ inputs.publish-dir }} + keep_files: true diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 8e5b2577..b83936ff 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -31,6 +31,7 @@ jobs: if [[ "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]] || \ [[ "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index 29d65e65..fe8c7b84 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -44,47 +44,8 @@ jobs: step-name: Test (quick-validation-clang-debug) command: "ctest --preset quick-validation-clang-debug --output-on-failure" - - name: Generate html coverage report - id: htmlcov - uses: ./.github/actions/_generate_llvm_html_coverage + - name: Publish coverage (clang_debug) + uses: ./.github/actions/_publish_llvm_coverage with: - build-preset: ${{ inputs.build-preset }} - - - name: Generate shields.io badge - id: shieldsio - shell: bash - run: | - set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - set -e - - SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_FUNCTION_COV_BADGE_FILE=$(grep -Po "Shields.io Function Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_LINE_COV_BADGE_FILE=$(grep -Po "Shields.io Line Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - SHIELDSIO_BRANCH_COV_BADGE_FILE=$(grep -Po "Shields.io Branch Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) - - echo "SHIELDSIO_REGION_COV_BADGE_FILE=$SHIELDSIO_REGION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_FUNCTION_COV_BADGE_FILE=$SHIELDSIO_FUNCTION_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_LINE_COV_BADGE_FILE=$SHIELDSIO_LINE_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - echo "SHIELDSIO_BRANCH_COV_BADGE_FILE=$SHIELDSIO_BRANCH_COV_BADGE_FILE" >> "$GITHUB_OUTPUT" - - exit $COV_EXIT_CODE - - - name: Prepare files - shell: bash - run: | - mkdir -p "${{ inputs.publish-dir }}/coverage/badges" - cp -r "${{ steps.htmlcov.outputs.html-cov-dir }}" "${{ inputs.publish-dir }}/coverage/" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_REGION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_FUNCTION_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_LINE_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - cp "${{ steps.shieldsio.outputs.SHIELDSIO_BRANCH_COV_BADGE_FILE }}" "${{ inputs.publish-dir }}/coverage/badges" - - - name: Publish coverage badge and report to gh-pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ inputs.github-token }} - publish_branch: ${{ inputs.publish-branch }} - publish_dir: ${{ inputs.publish-dir }} - keep_files: true + build-preset: clang_debug + github-token: ${{ secrets.GITHUB_TOKEN }} From cdcbfed21a6a7bfaa0adf3feba807f8c8704f283 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:18:57 +0200 Subject: [PATCH 65/86] simplified gating --- .github/workflows/linux_build_test.yaml | 4 +-- .github/workflows/macos_build_test.yaml | 26 ++------------- .github/workflows/windows_build_test.yaml | 39 ++--------------------- 3 files changed, 6 insertions(+), 63 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index b83936ff..ef16aa61 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -26,10 +26,8 @@ jobs: env: EVENT_ACTION: ${{ github.event.action }} HAS_PREMERGE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} - ADDED_LABEL: ${{ github.event.action == 'labeled' && github.event.label.name || '' }} run: | - if [[ "$EVENT_ACTION" == "labeled" && "$ADDED_LABEL" == "run-pre-merge-checks" ]] || \ - [[ "$EVENT_ACTION" != "labeled" && "$HAS_PREMERGE_LABEL" == "true" ]]; then + if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, diff --git a/.github/workflows/macos_build_test.yaml b/.github/workflows/macos_build_test.yaml index 72630794..74c8b447 100644 --- a/.github/workflows/macos_build_test.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -14,18 +14,7 @@ permissions: jobs: macos-intel-build: - if: | - github.event_name == 'pull_request' && - ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'run-pre-merge-checks' - ) || - ( - github.event.action != 'labeled' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) - ) + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') name: macos-26-intel - quick-validation-clang-release uses: ./.github/workflows/_rwf_macos_build_test.yaml with: @@ -37,18 +26,7 @@ jobs: secrets: inherit macos-arm-build: - if: | - github.event_name == 'pull_request' && - ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'run-pre-merge-checks' - ) || - ( - github.event.action != 'labeled' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) - ) + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') name: macos-26 - quick-validation-clang-release uses: ./.github/workflows/_rwf_macos_build_test.yaml with: diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index b06c6a42..7c4f2998 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -14,18 +14,7 @@ permissions: jobs: windows-2022-build: - if: | - github.event_name == 'pull_request' && - ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'run-pre-merge-checks' - ) || - ( - github.event.action != 'labeled' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) - ) + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') name: windows-2022 - quick-validation-msvc-release uses: ./.github/workflows/_rwf_windows_build_test.yaml with: @@ -37,18 +26,7 @@ jobs: secrets: inherit windows-2025-build: - if: | - github.event_name == 'pull_request' && - ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'run-pre-merge-checks' - ) || - ( - github.event.action != 'labeled' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) - ) + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') name: windows-2025 - quick-validation-msvc-release uses: ./.github/workflows/_rwf_windows_build_test.yaml with: @@ -60,18 +38,7 @@ jobs: secrets: inherit windows-11-arm-build: - if: | - github.event_name == 'pull_request' && - ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'run-pre-merge-checks' - ) || - ( - github.event.action != 'labeled' && - contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - ) - ) + if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') name: windows-11-arm - quick-validation-msvc-release uses: ./.github/workflows/_rwf_windows_build_test.yaml with: From 270562bf352ee5ef8dd68df7c16856b7da79f3a0 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:21:22 +0200 Subject: [PATCH 66/86] formatting --- .github/workflows/macos_build_test.yaml | 2 +- .github/workflows/windows_build_test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos_build_test.yaml b/.github/workflows/macos_build_test.yaml index 74c8b447..4c5fb8d0 100644 --- a/.github/workflows/macos_build_test.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -3,7 +3,7 @@ name: MacOS Build Test on: pull_request: branches: [ main ] - types: [labeled, synchronize, reopened] + types: [ labeled, synchronize, reopened ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 7c4f2998..c01100ef 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -3,7 +3,7 @@ name: Windows Build Test on: pull_request: branches: [ main ] - types: [labeled, synchronize, reopened] + types: [ labeled, synchronize, reopened ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 335dac75d8c92599f21da47aa32fbee69e7d228c Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:52:39 +0200 Subject: [PATCH 67/86] created a new preset for windows x64 arm --- .github/workflows/windows_build_test.yaml | 8 ++-- CMakePresets.json | 58 ++++++++++++++++++++++- docs/cmake.md | 7 +++ 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index c01100ef..8250d2a5 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -39,12 +39,12 @@ jobs: windows-11-arm-build: if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: windows-11-arm - quick-validation-msvc-release + name: windows-11-arm - quick-validation-msvc-release-arm64 uses: ./.github/workflows/_rwf_windows_build_test.yaml with: runner: windows-11-arm arch: arm64 - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release + configure_preset: msvc_release_arm64 + build_preset: msvc_release_arm64 + test_preset: quick-validation-msvc-release-arm64 secrets: inherit diff --git a/CMakePresets.json b/CMakePresets.json index 772f9858..2cb24984 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -54,6 +54,7 @@ "generator": "Visual Studio 17 2022", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_GENERATOR_PLATFORM": "x64", "VCPKG_TARGET_TRIPLET": "x64-windows" }, "condition": { @@ -69,6 +70,7 @@ "generator": "Visual Studio 17 2022", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_GENERATOR_PLATFORM": "x64", "VCPKG_TARGET_TRIPLET": "x64-windows" }, "condition": { @@ -76,6 +78,22 @@ "lhs": "${hostSystemName}", "rhs": "Windows" } + }, + { + "name": "msvc_release_arm64", + "inherits": "default", + "description": "Release build using MSVC for Windows ARM64", + "generator": "Visual Studio 17 2022", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_GENERATOR_PLATFORM": "ARM64", + "VCPKG_TARGET_TRIPLET": "arm64-windows" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } } ], "buildPresets": [ @@ -116,6 +134,16 @@ "lhs": "${hostSystemName}", "rhs": "Windows" } + }, + { + "name": "msvc_release_arm64", + "configurePreset": "msvc_release_arm64", + "configuration": "Release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } } ], "testPresets": [ @@ -248,12 +276,30 @@ "configurePreset": "msvc_release", "configuration": "Release" }, + { + "name": "quick-validation-msvc-release-arm64", + "inherits": ["tier-quick", "windows"], + "configurePreset": "msvc_release_arm64", + "configuration": "Release" + }, + { + "name": "intermediate-validation-msvc-release-arm64", + "inherits": ["tier-intermediate", "windows"], + "configurePreset": "msvc_release_arm64", + "configuration": "Release" + }, { "name": "intermediate-validation-msvc-release", "inherits": ["tier-intermediate", "windows"], "configurePreset": "msvc_release", "configuration": "Release" }, + { + "name": "deep-validation-msvc-release-arm64", + "inherits": ["tier-deep", "windows"], + "configurePreset": "msvc_release_arm64", + "configuration": "Release" + }, { "name": "deep-validation-msvc-release", "inherits": ["tier-deep", "windows"], @@ -265,6 +311,12 @@ "inherits": ["tier-all", "windows"], "configurePreset": "msvc_release", "configuration": "Release" + }, + { + "name": "full-suite-msvc-release-arm64", + "inherits": ["tier-all", "windows"], + "configurePreset": "msvc_release_arm64", + "configuration": "Release" } ], "packagePresets": [ @@ -275,6 +327,10 @@ { "name": "msvc_release", "configurePreset": "msvc_release" + }, + { + "name": "msvc_release_arm64", + "configurePreset": "msvc_release_arm64" } ] -} \ No newline at end of file +} diff --git a/docs/cmake.md b/docs/cmake.md index 1d06f597..caf258f3 100644 --- a/docs/cmake.md +++ b/docs/cmake.md @@ -49,6 +49,7 @@ build/ ├── clang_release/ # Artifacts for Clang Release ├── msvc_debug/ # Artifacts for MSVC Debug ├── msvc_release/ # Artifacts for MSVC Release + ├── msvc_release_arm64/ # Artifacts for MSVC Release on Windows ARM64 └── install/ # Staged install artifacts ``` @@ -114,6 +115,7 @@ These presets handle compiler selection, generator choice and toolchain injectio | **`clang_release`** | Unix | Ninja | **Production** Optimized build. | | **`msvc_debug`** | Windows | VS 2022 | **Dev Mode** Uses `x64-windows` triplet. | | **`msvc_release`** | Windows | VS 2022 | **Production** Uses `x64-windows` triplet. | +| **`msvc_release_arm64`** | Windows | VS 2022 | **Production** Uses `arm64-windows` triplet. | ### 👷 Build Presets @@ -123,6 +125,7 @@ These presets handle compiler selection, generator choice and toolchain injectio | **`clang_release`** | Unix | Ninja | **Production** | | **`msvc_debug`** | Windows | VS 2022 | **Dev Mode** | | **`msvc_release`** | Windows | VS 2022 | **Production** | +| **`msvc_release_arm64`** | Windows | VS 2022 | **Production** | ### 🧪 Test Presets Reference @@ -167,8 +170,12 @@ Test presets follow this pattern: | `intermediate-validation-msvc-debug` | Deeper checks on debug build. | | `full-suite-msvc-debug` | Run everything on debug. | | `quick-validation-msvc-release` | Fast checks on optimized build. | +| `quick-validation-msvc-release-arm64` | Fast checks on optimized Windows ARM64 build. | | `intermediate-validation-msvc-release` | **Pre-Push.** Standard checks on release build. | +| `intermediate-validation-msvc-release-arm64` | Standard checks on optimized Windows ARM64 build. | | `deep-validation-msvc-release` | **CI.** Exhaustive checks on release build. | +| `deep-validation-msvc-release-arm64` | Exhaustive checks on optimized Windows ARM64 build. | +| `full-suite-msvc-release-arm64` | Run everything on optimized Windows ARM64 build. | ## 🏗 Developer Guide: How Tests are Discovered From 1a5155496ef407beedfc52ccebe631d4d6687a7e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:53:42 +0200 Subject: [PATCH 68/86] set recurrent workflows (clang debug on push) to use arm64 arch cause they run faster and more often --- .github/workflows/linux_build_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index ef16aa61..730e3656 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -29,13 +29,13 @@ jobs: run: | if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' elif [[ "$EVENT_ACTION" != "labeled" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} ]}' else MATRIX='{"include":[]}' From 4c4c3bf17ad62abd0fd7ef1c6eec4ecdaac6d9e3 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 17:55:26 +0200 Subject: [PATCH 69/86] using arm arch for clang tidy job --- .github/workflows/clang_tidy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 4bcc8eed..da1e9c84 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -23,8 +23,8 @@ jobs: fail-fast: false matrix: include: - - runner: ubuntu-24.04 - arch: x64 + - runner: ubuntu-24.04-arm + arch: arm64 name: clang_debug configure_preset: clang_debug build_preset: clang_debug From 8dfabad2843398a9d67aa8cb86fec5f1a344fdcf Mon Sep 17 00:00:00 2001 From: Baptiste PENOT <103385400+Hardcode3@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:07:31 +0200 Subject: [PATCH 70/86] Forgot to update Ubuntu runner type --- .github/workflows/linux_build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 730e3656..909ffd56 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -29,7 +29,7 @@ jobs: run: | if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' From 90bb18e611c6fba08043362c259649487140cf13 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 20:52:04 +0200 Subject: [PATCH 71/86] removed unnecessary arguments --- .github/actions/_log_to_gh_summary_bash/action.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/_log_to_gh_summary_bash/action.yaml b/.github/actions/_log_to_gh_summary_bash/action.yaml index a62a0562..0ed6a42b 100644 --- a/.github/actions/_log_to_gh_summary_bash/action.yaml +++ b/.github/actions/_log_to_gh_summary_bash/action.yaml @@ -12,14 +12,6 @@ inputs: description: Temporary text file to store command output required: false default: tmp_step_output.txt - summary-mode: - description: log (wraps output in code block) or file (cats a file found in output) - required: false - default: log - summary-extract-regexp: - description: Regex to find a file path in the logs to append to the summary - required: false - default: '' runs: using: composite From 611b0921ca7b5244033675af048ef9a2e2226fc9 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 20:58:48 +0200 Subject: [PATCH 72/86] removed unecessary name matrix field --- .github/workflows/clang_tidy.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index da1e9c84..7517d36f 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -17,7 +17,7 @@ permissions: jobs: clang-tidy-linting: runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.name }} + name: ${{ matrix.runner }} - ${{ matrix.build_preset }} strategy: fail-fast: false @@ -25,7 +25,6 @@ jobs: include: - runner: ubuntu-24.04-arm arch: arm64 - name: clang_debug configure_preset: clang_debug build_preset: clang_debug @@ -36,7 +35,7 @@ jobs: uses: ./.github/actions/_setup_linux_ci with: arch: ${{ matrix.arch }} - cache-name: ${{ matrix.name }} + cache-name: ${{ matrix.build_preset }} - name: Configure (${{ matrix.configure_preset }}) uses: ./.github/actions/_log_to_gh_summary_bash From 9da14bc6fbe721aaf07deedd32ac2b758f61a799 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:05:22 +0200 Subject: [PATCH 73/86] small refactoring --- .github/workflows/linux_build_test.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 730e3656..e9303b4d 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -17,6 +17,7 @@ jobs: plan-linux-build: runs-on: ubuntu-slim name: Plan Linux Build + outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} should_run: ${{ steps.set-matrix.outputs.should_run }} @@ -27,6 +28,7 @@ jobs: EVENT_ACTION: ${{ github.event.action }} HAS_PREMERGE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} run: | + SHOULD_RUN=true if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, @@ -39,12 +41,7 @@ jobs: ]}' else MATRIX='{"include":[]}' - fi - - if [[ "$MATRIX" == '{"include":[]}' ]]; then SHOULD_RUN=false - else - SHOULD_RUN=true fi EOF_MARKER=$(openssl rand -hex 8) From 8f9869e4d35005cd70125425ea9c922208ac0df3 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:12:02 +0200 Subject: [PATCH 74/86] removed unecesssary test run to publish coverage --- .github/workflows/publish_llvm_coverage.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index fe8c7b84..7ff062db 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -38,12 +38,6 @@ jobs: step-name: Build (clang_debug) command: "cmake --build --preset clang_debug" - - name: Test (quick-validation-clang-debug) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Test (quick-validation-clang-debug) - command: "ctest --preset quick-validation-clang-debug --output-on-failure" - - name: Publish coverage (clang_debug) uses: ./.github/actions/_publish_llvm_coverage with: From 375aa9277d1581e3d28022481ff9b5c7b33a6ba1 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:16:21 +0200 Subject: [PATCH 75/86] formatting --- cmake/coverage/define_coverage_targets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/coverage/define_coverage_targets.cmake b/cmake/coverage/define_coverage_targets.cmake index 4af9643d..f9ad707e 100644 --- a/cmake/coverage/define_coverage_targets.cmake +++ b/cmake/coverage/define_coverage_targets.cmake @@ -40,8 +40,8 @@ if (ENABLE_COVERAGE) message(STATUS "LLVM coverage setup failed. Coverage targets will not be created.") else() message(STATUS "Enabling LLVM coverage tools") - message(STATUS "Coverage Build: Downgrading CX macros to runtime for tests instrumentation.") + add_compile_definitions(COVERAGE_BUILD) # see include/bitbishop/config.hpp add_compile_options( From 59d1cf4f17df9f2555693d344564a69dcd1330bf Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:19:58 +0200 Subject: [PATCH 76/86] restored important comment --- .github/actions/_generate_llvm_html_coverage/action.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/_generate_llvm_html_coverage/action.yaml b/.github/actions/_generate_llvm_html_coverage/action.yaml index 51462794..781f746a 100644 --- a/.github/actions/_generate_llvm_html_coverage/action.yaml +++ b/.github/actions/_generate_llvm_html_coverage/action.yaml @@ -23,6 +23,11 @@ runs: set -e HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) + # -P: Uses Perl-style regex. + # -o: Only outputs the matched part (not the whole line). + # \K: Tells the engine to match the string but ignore it in the final output. + # .*: Matches the rest of the line (the path) + echo "html_cov_dir=$HTML_COV_DIR" >> "$GITHUB_OUTPUT" exit $COV_EXIT_CODE From e4d8a96cbcf8c25ddb33f9c4924f7232faad7400 Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:48:40 +0200 Subject: [PATCH 77/86] refactored setup configure and build into composite actions --- .../_setup_configure_build_linux/action.yaml | 84 +++++++++++++++++++ .../_setup_configure_build_macos/action.yaml | 80 ++++++++++++++++++ .../action.yaml | 83 ++++++++++++++++++ .github/actions/_setup_linux_ci/action.yaml | 57 ------------- .github/workflows/_rwf_macos_build_test.yaml | 68 --------------- .../workflows/_rwf_windows_build_test.yaml | 69 --------------- .github/workflows/clang_tidy.yaml | 21 ++--- .github/workflows/linux_build_test.yaml | 23 ++--- .github/workflows/macos_build_test.yaml | 53 +++++++----- .github/workflows/publish_llvm_coverage.yaml | 19 +---- .github/workflows/windows_build_test.yaml | 68 ++++++++------- 11 files changed, 331 insertions(+), 294 deletions(-) create mode 100644 .github/actions/_setup_configure_build_linux/action.yaml create mode 100644 .github/actions/_setup_configure_build_macos/action.yaml create mode 100644 .github/actions/_setup_configure_build_windows/action.yaml delete mode 100644 .github/actions/_setup_linux_ci/action.yaml delete mode 100644 .github/workflows/_rwf_macos_build_test.yaml delete mode 100644 .github/workflows/_rwf_windows_build_test.yaml diff --git a/.github/actions/_setup_configure_build_linux/action.yaml b/.github/actions/_setup_configure_build_linux/action.yaml new file mode 100644 index 00000000..1b776a09 --- /dev/null +++ b/.github/actions/_setup_configure_build_linux/action.yaml @@ -0,0 +1,84 @@ +name: Setup, Configure, and Build Linux CI +description: Configures the Linux CI environment, restores caches, and runs CMake configure/build + +inputs: + arch: + description: Architecture label used in cache keys + required: true + configure-preset: + description: CMake configure preset to use + required: true + build-preset: + description: CMake build preset to use + required: true + build-target: + description: Optional CMake build target + required: false + default: "" + build-step-name: + description: Display label used in the GitHub summary for the build step + required: false + default: Build + +runs: + using: composite + steps: + - name: Setup VCPKG environment + shell: bash + run: | + set -euo pipefail + + if [[ -n "${VCPKG_INSTALLATION_ROOT:-}" ]]; then + VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" + elif [[ -d /usr/local/share/vcpkg ]]; then + VCPKG_ROOT=/usr/local/share/vcpkg + else + echo "::error::No pre-installed vcpkg root was found on this runner." + exit 1 + fi + + mkdir -p \ + "$GITHUB_WORKSPACE/.cache/vcpkg/downloads" \ + "$GITHUB_WORKSPACE/.cache/vcpkg/archives" + + { + echo "VCPKG_ROOT=$VCPKG_ROOT" + echo "VCPKG_DOWNLOADS=$GITHUB_WORKSPACE/.cache/vcpkg/downloads" + echo "VCPKG_DEFAULT_BINARY_CACHE=$GITHUB_WORKSPACE/.cache/vcpkg/archives" + } >> "$GITHUB_ENV" + + - name: Cache VCPKG assets + uses: actions/cache@v4 + with: + path: | + .cache/vcpkg/downloads + .cache/vcpkg/archives + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build-preset }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + + - name: Configure (${{ inputs.configure-preset }}) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Configure (${{ inputs.configure-preset }}) + command: "cmake --preset ${{ inputs.configure-preset }}" + + - name: Build (${{ inputs.build-preset }}) + if: ${{ inputs.build-target == '' }} + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }}" + + - name: Build target (${{ inputs.build-target }}) + if: ${{ inputs.build-target != '' }} + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }} --target ${{ inputs.build-target }}" diff --git a/.github/actions/_setup_configure_build_macos/action.yaml b/.github/actions/_setup_configure_build_macos/action.yaml new file mode 100644 index 00000000..b723226d --- /dev/null +++ b/.github/actions/_setup_configure_build_macos/action.yaml @@ -0,0 +1,80 @@ +name: Setup, Configure, and Build macOS CI +description: Configures the macOS CI environment, restores caches, and runs CMake configure/build + +inputs: + arch: + description: Architecture label used in cache keys + required: true + configure-preset: + description: CMake configure preset to use + required: true + build-preset: + description: CMake build preset to use + required: true + build-target: + description: Optional CMake build target + required: false + default: "" + build-step-name: + description: Display label used in the GitHub summary for the build step + required: false + default: Build + +runs: + using: composite + steps: + - name: Setup VCPKG environment + shell: bash + run: | + set -euo pipefail + + if [[ -z "${VCPKG_INSTALLATION_ROOT:-}" ]]; then + echo "::error::No pre-installed vcpkg root was found on this runner." + exit 1 + fi + + mkdir -p \ + "$GITHUB_WORKSPACE/.cache/vcpkg/downloads" \ + "$GITHUB_WORKSPACE/.cache/vcpkg/archives" + + { + echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" + echo "VCPKG_DOWNLOADS=$GITHUB_WORKSPACE/.cache/vcpkg/downloads" + echo "VCPKG_DEFAULT_BINARY_CACHE=$GITHUB_WORKSPACE/.cache/vcpkg/archives" + } >> "$GITHUB_ENV" + + - name: Cache VCPKG assets + uses: actions/cache@v4 + with: + path: | + .cache/vcpkg/downloads + .cache/vcpkg/archives + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build-preset }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + + - name: Configure (${{ inputs.configure-preset }}) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Configure (${{ inputs.configure-preset }}) + command: "cmake --preset ${{ inputs.configure-preset }}" + + - name: Build (${{ inputs.build-preset }}) + if: ${{ inputs.build-target == '' }} + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }}" + + - name: Build target (${{ inputs.build-target }}) + if: ${{ inputs.build-target != '' }} + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }} --target ${{ inputs.build-target }}" diff --git a/.github/actions/_setup_configure_build_windows/action.yaml b/.github/actions/_setup_configure_build_windows/action.yaml new file mode 100644 index 00000000..545acba3 --- /dev/null +++ b/.github/actions/_setup_configure_build_windows/action.yaml @@ -0,0 +1,83 @@ +name: Setup, Configure, and Build Windows CI +description: Configures the Windows CI environment, restores caches, and runs CMake configure/build + +inputs: + arch: + description: Architecture label used in cache keys + required: true + configure-preset: + description: CMake configure preset to use + required: true + build-preset: + description: CMake build preset to use + required: true + build-target: + description: Optional CMake build target + required: false + default: "" + build-step-name: + description: Display label used in the GitHub summary for the build step + required: false + default: Build + +runs: + using: composite + steps: + - name: Setup VCPKG environment + shell: pwsh + run: | + $vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT + if (-not $vcpkgRoot -and (Test-Path 'C:\vcpkg')) { + $vcpkgRoot = 'C:\vcpkg' + } + + if (-not $vcpkgRoot -or -not (Test-Path $vcpkgRoot)) { + throw 'No pre-installed vcpkg root was found on this runner.' + } + + $downloadsDir = Join-Path $env:GITHUB_WORKSPACE '.cache\vcpkg\downloads' + $binaryCacheDir = Join-Path $env:GITHUB_WORKSPACE '.cache\vcpkg\archives' + + New-Item -ItemType Directory -Force -Path $downloadsDir, $binaryCacheDir | Out-Null + + @( + "VCPKG_ROOT=$vcpkgRoot" + "VCPKG_DOWNLOADS=$downloadsDir" + "VCPKG_DEFAULT_BINARY_CACHE=$binaryCacheDir" + ) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Cache VCPKG assets + uses: actions/cache@v4 + with: + path: | + .cache/vcpkg/downloads + .cache/vcpkg/archives + key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build-preset }}-${{ hashFiles('vcpkg.json') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- + + - name: Cache build + uses: actions/cache@v4 + with: + path: build + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} + restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + + - name: Configure (${{ inputs.configure-preset }}) + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: Configure (${{ inputs.configure-preset }}) + command: "cmake --preset ${{ inputs.configure-preset }}" + + - name: Build (${{ inputs.build-preset }}) + if: ${{ inputs.build-target == '' }} + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }}" + + - name: Build target (${{ inputs.build-target }}) + if: ${{ inputs.build-target != '' }} + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: ${{ inputs.build-step-name }} (${{ inputs.build-preset }}) + command: "cmake --build --preset ${{ inputs.build-preset }} --target ${{ inputs.build-target }}" diff --git a/.github/actions/_setup_linux_ci/action.yaml b/.github/actions/_setup_linux_ci/action.yaml deleted file mode 100644 index 32cfcc4a..00000000 --- a/.github/actions/_setup_linux_ci/action.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Setup Linux CMake CI -description: Installs the Linux toolchain, bootstraps vcpkg, and restores common CMake caches - -inputs: - arch: - description: Architecture label used in cache keys - required: true - cache-name: - description: Build flavor label used in cache keys - required: true - -runs: - using: composite - steps: - - name: Install dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - clang \ - clang-tidy \ - llvm \ - gcc \ - g++ \ - git \ - curl \ - zip \ - unzip \ - pkg-config \ - ninja-build \ - cmake - - - name: Setup vcpkg - shell: bash - run: | - git clone https://github.com/microsoft/vcpkg.git /tmp/vcpkg - /tmp/vcpkg/bootstrap-vcpkg.sh - echo "VCPKG_ROOT=/tmp/vcpkg" >> "$GITHUB_ENV" - echo "/tmp/vcpkg" >> "$GITHUB_PATH" - - - name: Cache VCPKG - uses: actions/cache@v4 - with: - path: | - /tmp/vcpkg/downloads - /tmp/vcpkg/installed - ~/.cache/vcpkg - key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.cache-name }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.cache-name }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- diff --git a/.github/workflows/_rwf_macos_build_test.yaml b/.github/workflows/_rwf_macos_build_test.yaml deleted file mode 100644 index 364480d5..00000000 --- a/.github/workflows/_rwf_macos_build_test.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: Reusable macOS Build Test - -on: - workflow_call: - inputs: - runner: - required: true - type: string - arch: - required: true - type: string - configure_preset: - required: true - type: string - build_preset: - required: true - type: string - test_preset: - required: true - type: string - -permissions: - contents: read - -jobs: - macos-build: - runs-on: ${{ inputs.runner }} - name: macOS Build & Test - - steps: - - uses: actions/checkout@v4 - - - name: Setup pre-installed VCPKG - run: | - echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV - - - name: Cache VCPKG - run: | - # Use the GitHub Actions cache as a binary source. - echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV - env: - ACTIONS_CACHE_URL: ${{ secrets.ACTIONS_CACHE_URL }} - ACTIONS_RUNTIME_TOKEN: ${{ secrets.ACTIONS_RUNTIME_TOKEN }} - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build_preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- - - - name: Configure (${{ inputs.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Configure (${{ inputs.configure_preset }}) - command: "cmake --preset ${{ inputs.configure_preset }}" - - - name: Build (${{ inputs.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Build (${{ inputs.build_preset }}) - command: "cmake --build --preset ${{ inputs.build_preset }}" - - - name: Test (${{ inputs.test_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Test (${{ inputs.test_preset }}) - command: "ctest --preset ${{ inputs.test_preset }} --output-on-failure" diff --git a/.github/workflows/_rwf_windows_build_test.yaml b/.github/workflows/_rwf_windows_build_test.yaml deleted file mode 100644 index 9d254bcf..00000000 --- a/.github/workflows/_rwf_windows_build_test.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: Reusable Windows Build Test - -on: - workflow_call: - inputs: - runner: - required: true - type: string - arch: - required: true - type: string - configure_preset: - required: true - type: string - build_preset: - required: true - type: string - test_preset: - required: true - type: string - -permissions: - contents: read - -jobs: - windows-build: - runs-on: ${{ inputs.runner }} - name: Windows Build & Test - - steps: - - uses: actions/checkout@v4 - - - name: Cache VCPKG - uses: actions/cache@v4 - with: - path: | - C:\vcpkg\installed - C:\vcpkg\packages - C:\vcpkg\buildtrees - ~\AppData\Local\vcpkg\archives - key: ${{ runner.os }}-${{ inputs.arch }}-vcpkg-${{ inputs.build_preset }}-${{ hashFiles('vcpkg.json') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-vcpkg- - - - name: Cache build - uses: actions/cache@v4 - with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build_preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- - - - name: Configure (${{ inputs.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary_pwsh - env: - VCPKG_ROOT: C:\vcpkg - with: - step-name: Configure (${{ inputs.configure_preset }}) - command: "cmake --preset ${{ inputs.configure_preset }}" - - - name: Build (${{ inputs.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary_pwsh - with: - step-name: Build (${{ inputs.build_preset }}) - command: "cmake --build --preset ${{ inputs.build_preset }}" - - - name: Test (${{ inputs.test_preset }}) - uses: ./.github/actions/_log_to_gh_summary_pwsh - with: - step-name: Test (${{ inputs.test_preset }}) - command: "ctest --preset ${{ inputs.test_preset }} --output-on-failure" diff --git a/.github/workflows/clang_tidy.yaml b/.github/workflows/clang_tidy.yaml index 7517d36f..52ebe053 100644 --- a/.github/workflows/clang_tidy.yaml +++ b/.github/workflows/clang_tidy.yaml @@ -31,20 +31,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Linux CI - uses: ./.github/actions/_setup_linux_ci + - name: Setup, configure, and run clang-tidy + uses: ./.github/actions/_setup_configure_build_linux with: arch: ${{ matrix.arch }} - cache-name: ${{ matrix.build_preset }} - - - name: Configure (${{ matrix.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Configure (${{ matrix.configure_preset }}) - command: "cmake --preset ${{ matrix.configure_preset }}" - - - name: Run clang-tidy - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Run clang-tidy (${{ matrix.configure_preset }}) - command: "cmake --build --preset ${{ matrix.build_preset }} --target clang-tidy" + configure-preset: ${{ matrix.configure_preset }} + build-preset: ${{ matrix.build_preset }} + build-target: clang-tidy + build-step-name: Run clang-tidy diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index e9303b4d..02640546 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -31,13 +31,13 @@ jobs: SHOULD_RUN=true if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' elif [[ "$EVENT_ACTION" != "labeled" ]]; then MATRIX='{"include":[ - {"runner":"ubuntu-24.04","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} + {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} ]}' else MATRIX='{"include":[]}' @@ -64,23 +64,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Linux CI - uses: ./.github/actions/_setup_linux_ci + - name: Setup, configure, and build Linux CI + uses: ./.github/actions/_setup_configure_build_linux with: arch: ${{ matrix.arch }} - cache-name: ${{ matrix.build_preset }} - - - name: Configure (${{ matrix.configure_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Configure (${{ matrix.configure_preset }}) - command: "cmake --preset ${{ matrix.configure_preset }}" - - - name: Build (${{ matrix.build_preset }}) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Build (${{ matrix.build_preset }}) - command: "cmake --build --preset ${{ matrix.build_preset }}" + configure-preset: ${{ matrix.configure_preset }} + build-preset: ${{ matrix.build_preset }} - name: Test (${{ matrix.test_preset }}) uses: ./.github/actions/_log_to_gh_summary_bash diff --git a/.github/workflows/macos_build_test.yaml b/.github/workflows/macos_build_test.yaml index 4c5fb8d0..4597e0bd 100644 --- a/.github/workflows/macos_build_test.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -13,26 +13,37 @@ permissions: contents: read jobs: - macos-intel-build: + macos-build: if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: macos-26-intel - quick-validation-clang-release - uses: ./.github/workflows/_rwf_macos_build_test.yaml - with: - runner: macos-26-intel - arch: intel - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - secrets: inherit + strategy: + fail-fast: false + matrix: + include: + - runner: macos-26-intel + arch: intel + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + - runner: macos-26 + arch: arm64 + configure_preset: clang_release + build_preset: clang_release + test_preset: quick-validation-clang-release + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - macos-arm-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: macos-26 - quick-validation-clang-release - uses: ./.github/workflows/_rwf_macos_build_test.yaml - with: - runner: macos-26 - arch: arm64 - configure_preset: clang_release - build_preset: clang_release - test_preset: quick-validation-clang-release - secrets: inherit + steps: + - uses: actions/checkout@v4 + + - name: Setup, configure, and build macOS CI + uses: ./.github/actions/_setup_configure_build_macos + with: + arch: ${{ matrix.arch }} + configure-preset: ${{ matrix.configure_preset }} + build-preset: ${{ matrix.build_preset }} + + - name: Test (${{ matrix.test_preset }}) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index 7ff062db..b2a56547 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -20,23 +20,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Linux CI - uses: ./.github/actions/_setup_linux_ci + - name: Setup, configure, and build Linux CI + uses: ./.github/actions/_setup_configure_build_linux with: arch: x64 - cache-name: clang_debug - - - name: Configure (clang_debug) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Configure (clang_debug) - command: "cmake --preset clang_debug" - - - name: Build (clang_debug) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Build (clang_debug) - command: "cmake --build --preset clang_debug" + configure-preset: clang_debug + build-preset: clang_debug - name: Publish coverage (clang_debug) uses: ./.github/actions/_publish_llvm_coverage diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 8250d2a5..8e5ea20a 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -13,38 +13,42 @@ permissions: contents: read jobs: - windows-2022-build: + windows-build: if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: windows-2022 - quick-validation-msvc-release - uses: ./.github/workflows/_rwf_windows_build_test.yaml - with: - runner: windows-2022 - arch: x64 - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release - secrets: inherit + strategy: + fail-fast: false + matrix: + include: + - runner: windows-2022 + arch: x64 + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + - runner: windows-2025 + arch: x64 + configure_preset: msvc_release + build_preset: msvc_release + test_preset: quick-validation-msvc-release + - runner: windows-11-arm + arch: arm64 + configure_preset: msvc_release_arm64 + build_preset: msvc_release_arm64 + test_preset: quick-validation-msvc-release-arm64 + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} - windows-2025-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: windows-2025 - quick-validation-msvc-release - uses: ./.github/workflows/_rwf_windows_build_test.yaml - with: - runner: windows-2025 - arch: x64 - configure_preset: msvc_release - build_preset: msvc_release - test_preset: quick-validation-msvc-release - secrets: inherit + steps: + - uses: actions/checkout@v4 - windows-11-arm-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') - name: windows-11-arm - quick-validation-msvc-release-arm64 - uses: ./.github/workflows/_rwf_windows_build_test.yaml - with: - runner: windows-11-arm - arch: arm64 - configure_preset: msvc_release_arm64 - build_preset: msvc_release_arm64 - test_preset: quick-validation-msvc-release-arm64 - secrets: inherit + - name: Setup, configure, and build Windows CI + uses: ./.github/actions/_setup_configure_build_windows + with: + arch: ${{ matrix.arch }} + configure-preset: ${{ matrix.configure_preset }} + build-preset: ${{ matrix.build_preset }} + + - name: Test (${{ matrix.test_preset }}) + uses: ./.github/actions/_log_to_gh_summary_pwsh + with: + step-name: Test (${{ matrix.test_preset }}) + command: "ctest --preset ${{ matrix.test_preset }} --output-on-failure" From 3f8c2723d65b635e4ab21e761edf9918e5eed86f Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 21:53:52 +0200 Subject: [PATCH 78/86] fixed stale cmake build cache --- .github/actions/_setup_configure_build_linux/action.yaml | 5 ++--- .github/actions/_setup_configure_build_macos/action.yaml | 5 ++--- .github/actions/_setup_configure_build_windows/action.yaml | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/actions/_setup_configure_build_linux/action.yaml b/.github/actions/_setup_configure_build_linux/action.yaml index 1b776a09..7bf49d3f 100644 --- a/.github/actions/_setup_configure_build_linux/action.yaml +++ b/.github/actions/_setup_configure_build_linux/action.yaml @@ -59,9 +59,8 @@ runs: - name: Cache build uses: actions/cache@v4 with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + path: build/${{ inputs.build-preset }} + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_linux/action.yaml') }} - name: Configure (${{ inputs.configure-preset }}) uses: ./.github/actions/_log_to_gh_summary_bash diff --git a/.github/actions/_setup_configure_build_macos/action.yaml b/.github/actions/_setup_configure_build_macos/action.yaml index b723226d..45a5067f 100644 --- a/.github/actions/_setup_configure_build_macos/action.yaml +++ b/.github/actions/_setup_configure_build_macos/action.yaml @@ -55,9 +55,8 @@ runs: - name: Cache build uses: actions/cache@v4 with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + path: build/${{ inputs.build-preset }} + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_macos/action.yaml') }} - name: Configure (${{ inputs.configure-preset }}) uses: ./.github/actions/_log_to_gh_summary_bash diff --git a/.github/actions/_setup_configure_build_windows/action.yaml b/.github/actions/_setup_configure_build_windows/action.yaml index 545acba3..b8f4d998 100644 --- a/.github/actions/_setup_configure_build_windows/action.yaml +++ b/.github/actions/_setup_configure_build_windows/action.yaml @@ -58,9 +58,8 @@ runs: - name: Cache build uses: actions/cache@v4 with: - path: build - key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', '**/*.cmake') }} - restore-keys: ${{ runner.os }}-${{ inputs.arch }}-cmake- + path: build/${{ inputs.build-preset }} + key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_windows/action.yaml') }} - name: Configure (${{ inputs.configure-preset }}) uses: ./.github/actions/_log_to_gh_summary_pwsh From e5e8fd4e343874aa2d0bc7d368466113d21d780e Mon Sep 17 00:00:00 2001 From: baptiste Date: Thu, 2 Apr 2026 22:40:05 +0200 Subject: [PATCH 79/86] hopefully fixed the issue with clang debug run and llvm coverage tools binary names --- .../_generate_llvm_html_coverage/action.yaml | 48 ++++++++++++++++++- .../_publish_llvm_coverage/action.yaml | 37 +++++++++++++- .../_setup_configure_build_linux/action.yaml | 36 ++++++++++++++ .github/workflows/linux_build_test.yaml | 1 + .github/workflows/publish_llvm_coverage.yaml | 7 +++ 5 files changed, 127 insertions(+), 2 deletions(-) diff --git a/.github/actions/_generate_llvm_html_coverage/action.yaml b/.github/actions/_generate_llvm_html_coverage/action.yaml index 781f746a..b36c2a19 100644 --- a/.github/actions/_generate_llvm_html_coverage/action.yaml +++ b/.github/actions/_generate_llvm_html_coverage/action.yaml @@ -5,6 +5,9 @@ inputs: build-preset: description: CMake build preset used to generate HTML coverage artifacts required: true + test-preset: + description: CTest preset whose recorded coverage data should be reported + required: true outputs: html-cov-dir: @@ -17,9 +20,52 @@ runs: - id: htmlcov shell: bash run: | + resolve_llvm_tool() { + local tool="$1" + local candidate="" + + if candidate=$(command -v "$tool" 2>/dev/null); then + printf '%s\n' "$candidate" + return 0 + fi + + for suffix in 20 19 18 17 16; do + if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then + printf '%s\n' "$candidate" + return 0 + fi + done + + return 1 + } + + BUILD_DIR="$GITHUB_WORKSPACE/build/${{ inputs.build-preset }}" + COVERAGE_DIR="$BUILD_DIR/coverage/${{ inputs.test-preset }}" + PROFDATA_FILE="$COVERAGE_DIR/coverage.profdata" + LLVM_PROFDATA_BIN=$(resolve_llvm_tool llvm-profdata) + LLVM_COV_BIN=$(resolve_llvm_tool llvm-cov) + set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-html 2>&1 | tee coverage_html_summary.txt + cmake -E make_directory "$COVERAGE_DIR" + cmake \ + "-DCOVERAGE_DIR=$COVERAGE_DIR" \ + "-DPROFDATA_FILE=$PROFDATA_FILE" \ + "-DLLVM_PROFDATA=$LLVM_PROFDATA_BIN" \ + -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_merge.cmake" 2>&1 | tee coverage_html_summary.txt COV_EXIT_CODE=${PIPESTATUS[0]} + + if [ "$COV_EXIT_CODE" -eq 0 ]; then + cmake \ + "-DCOVERAGE_DIR=$COVERAGE_DIR" \ + "-DPROFDATA_FILE=$PROFDATA_FILE" \ + "-DCTEST_PRESET=${{ inputs.test-preset }}" \ + "-DLLVM_COV=$LLVM_COV_BIN" \ + "-DPROJECT_SOURCE_DIR=$GITHUB_WORKSPACE" \ + "-DREPORT_MODE=html" \ + -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_report.cmake" 2>&1 | tee -a coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} + fi + set -e HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) diff --git a/.github/actions/_publish_llvm_coverage/action.yaml b/.github/actions/_publish_llvm_coverage/action.yaml index 119b151b..71d3f659 100644 --- a/.github/actions/_publish_llvm_coverage/action.yaml +++ b/.github/actions/_publish_llvm_coverage/action.yaml @@ -5,6 +5,9 @@ inputs: build-preset: description: CMake build preset used to generate coverage artifacts required: true + test-preset: + description: CTest preset whose recorded coverage data should be reported + required: true github-token: description: GitHub token used to publish the generated site required: true @@ -25,13 +28,45 @@ runs: uses: ./.github/actions/_generate_llvm_html_coverage with: build-preset: ${{ inputs.build-preset }} + test-preset: ${{ inputs.test-preset }} - name: Generate shields.io badge id: shieldsio shell: bash run: | + resolve_llvm_tool() { + local tool="$1" + local candidate="" + + if candidate=$(command -v "$tool" 2>/dev/null); then + printf '%s\n' "$candidate" + return 0 + fi + + for suffix in 20 19 18 17 16; do + if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then + printf '%s\n' "$candidate" + return 0 + fi + done + + return 1 + } + + BUILD_DIR="$GITHUB_WORKSPACE/build/${{ inputs.build-preset }}" + COVERAGE_DIR="$BUILD_DIR/coverage/${{ inputs.test-preset }}" + PROFDATA_FILE="$COVERAGE_DIR/coverage.profdata" + LLVM_COV_BIN=$(resolve_llvm_tool llvm-cov) + set +e - cmake --build --preset "${{ inputs.build-preset }}" --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + cmake \ + "-DCOVERAGE_DIR=$COVERAGE_DIR" \ + "-DPROFDATA_FILE=$PROFDATA_FILE" \ + "-DCTEST_PRESET=${{ inputs.test-preset }}" \ + "-DLLVM_COV=$LLVM_COV_BIN" \ + "-DPROJECT_SOURCE_DIR=$GITHUB_WORKSPACE" \ + "-DREPORT_MODE=shieldsio" \ + -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_report.cmake" 2>&1 | tee coverage_shieldsio_summary.txt COV_EXIT_CODE=${PIPESTATUS[0]} set -e diff --git a/.github/actions/_setup_configure_build_linux/action.yaml b/.github/actions/_setup_configure_build_linux/action.yaml index 7bf49d3f..0b5b2e4c 100644 --- a/.github/actions/_setup_configure_build_linux/action.yaml +++ b/.github/actions/_setup_configure_build_linux/action.yaml @@ -62,6 +62,42 @@ runs: path: build/${{ inputs.build-preset }} key: ${{ runner.os }}-${{ inputs.arch }}-cmake-${{ inputs.build-preset }}-${{ hashFiles('CMakeLists.txt', 'CMakePresets.json', 'vcpkg.json', '**/*.cmake', '.github/actions/_setup_configure_build_linux/action.yaml') }} + - name: Setup LLVM tool aliases + shell: bash + run: | + set -euo pipefail + + # GitHub's Ubuntu runners sometimes expose versioned LLVM binaries + # (for example `llvm-cov-18`) without the unversioned names that our + # existing CMake lookup expects. Adding a lightweight workspace-local + # aliases here instead of reinstalling LLVM packages on every run. + + TOOL_BIN_DIR="$GITHUB_WORKSPACE/.local/bin" + mkdir -p "$TOOL_BIN_DIR" + + ensure_llvm_tool() { + local tool="$1" + + if command -v "$tool" >/dev/null 2>&1; then + return 0 + fi + + for suffix in 20 19 18 17 16; do + if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then + ln -sf "$candidate" "$TOOL_BIN_DIR/$tool" + return 0 + fi + done + + echo "::warning::Could not find $tool or a versioned variant in PATH." + return 0 + } + + ensure_llvm_tool llvm-cov + ensure_llvm_tool llvm-profdata + + echo "$TOOL_BIN_DIR" >> "$GITHUB_PATH" + - name: Configure (${{ inputs.configure-preset }}) uses: ./.github/actions/_log_to_gh_summary_bash with: diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 02640546..e5c3e111 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -83,6 +83,7 @@ jobs: uses: ./.github/actions/_generate_llvm_html_coverage with: build-preset: ${{ matrix.build_preset }} + test-preset: ${{ matrix.test_preset }} - name: Upload coverage artifact (${{ matrix.build_preset }}) if: matrix.build_preset == 'clang_debug' diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index b2a56547..10793e56 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -27,8 +27,15 @@ jobs: configure-preset: clang_debug build-preset: clang_debug + - name: Test (quick-validation-clang-debug) + uses: ./.github/actions/_log_to_gh_summary_bash + with: + step-name: Test (quick-validation-clang-debug) + command: "ctest --preset quick-validation-clang-debug --output-on-failure" + - name: Publish coverage (clang_debug) uses: ./.github/actions/_publish_llvm_coverage with: build-preset: clang_debug + test-preset: quick-validation-clang-debug github-token: ${{ secrets.GITHUB_TOKEN }} From cbf049926be5a4d391d435af524f34886ef1376e Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:33:14 +0200 Subject: [PATCH 80/86] improved cmake llvm coverage tools resolution --- cmake/coverage/define_coverage_targets.cmake | 66 +++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/cmake/coverage/define_coverage_targets.cmake b/cmake/coverage/define_coverage_targets.cmake index f9ad707e..9c97904b 100644 --- a/cmake/coverage/define_coverage_targets.cmake +++ b/cmake/coverage/define_coverage_targets.cmake @@ -11,6 +11,50 @@ # - https://clang.llvm.org/docs/SourceBasedCodeCoverage.html # - https://llvm.org/docs/CommandGuide/llvm-cov.html +function(_find_preferred_llvm_tool OUT_PATH_VAR OUT_NAME_VAR TOOL_BASENAME) + # Reads the active compiler's major version from CMAKE_CXX_COMPILER_VERSION. + # Look in the compiler's own directory first to locate a matching llvm tool. + # Fallback to the unversioned base tool name in the PATH if the binary was not found in compiler's directory. + + set(_search_hints "") + + if (CMAKE_CXX_COMPILER) + get_filename_component(_compiler_bin_dir "${CMAKE_CXX_COMPILER}" DIRECTORY) + list(APPEND _search_hints "${_compiler_bin_dir}") + endif () + + set(_candidate_names "${TOOL_BASENAME}") + + if (CMAKE_CXX_COMPILER_VERSION) + string(REGEX MATCH "^[0-9]+" _compiler_major_version "${CMAKE_CXX_COMPILER_VERSION}") + if (_compiler_major_version) + list(INSERT _candidate_names 0 "${TOOL_BASENAME}-${_compiler_major_version}") + endif () + endif () + + # Build a "safe" dynamic cache filename for storing the tool's location in a CMake cache variable. + string(REGEX REPLACE "[^A-Za-z0-9_]" "_" _tool_cache_suffix "${TOOL_BASENAME}") + set(_tool_cache_var "_llvm_tool_${_tool_cache_suffix}") + unset(${_tool_cache_var} CACHE) + unset(${_tool_cache_var}) + + find_program(${_tool_cache_var} + NAMES ${_candidate_names} + HINTS ${_search_hints} + ) + + set(_selected_tool "${${_tool_cache_var}}") + if (_selected_tool) + get_filename_component(_selected_tool_name "${_selected_tool}" NAME) + set(${OUT_PATH_VAR} "${_selected_tool}" PARENT_SCOPE) + set(${OUT_NAME_VAR} "${_selected_tool_name}" PARENT_SCOPE) + else () + set(${OUT_PATH_VAR} "" PARENT_SCOPE) + set(${OUT_NAME_VAR} "" PARENT_SCOPE) + endif () +endfunction() + + if (ENABLE_COVERAGE) set(_CAN_ENABLE_COVERAGE TRUE) @@ -20,17 +64,35 @@ if (ENABLE_COVERAGE) endif() if (_CAN_ENABLE_COVERAGE) - find_program(LLVM_PROFDATA llvm-profdata) - find_program(LLVM_COV llvm-cov) + if (CMAKE_CXX_COMPILER_VERSION) + string(REGEX MATCH "^[0-9]+" LLVM_TOOLCHAIN_MAJOR_VERSION "${CMAKE_CXX_COMPILER_VERSION}") + else () + set(LLVM_TOOLCHAIN_MAJOR_VERSION "") + endif () + + _find_preferred_llvm_tool(LLVM_PROFDATA LLVM_PROFDATA_NAME llvm-profdata) + _find_preferred_llvm_tool(LLVM_COV LLVM_COV_NAME llvm-cov) if (NOT LLVM_PROFDATA) message(WARNING "Required tool 'llvm-profdata' not found in PATH.") set(_CAN_ENABLE_COVERAGE FALSE) + else () + if (LLVM_TOOLCHAIN_MAJOR_VERSION AND LLVM_PROFDATA_NAME STREQUAL "llvm-profdata-${LLVM_TOOLCHAIN_MAJOR_VERSION}") + message(STATUS "Using compiler-matched llvm-profdata tool: ${LLVM_PROFDATA_NAME} (${LLVM_PROFDATA})") + else () + message(STATUS "Using fallback llvm-profdata tool: ${LLVM_PROFDATA_NAME} (${LLVM_PROFDATA})") + endif () endif() if (NOT LLVM_COV) message(WARNING "Required tool 'llvm-cov' not found in PATH.") set(_CAN_ENABLE_COVERAGE FALSE) + else () + if (LLVM_TOOLCHAIN_MAJOR_VERSION AND LLVM_COV_NAME STREQUAL "llvm-cov-${LLVM_TOOLCHAIN_MAJOR_VERSION}") + message(STATUS "Using compiler-matched llvm-cov tool: ${LLVM_COV_NAME} (${LLVM_COV})") + else () + message(STATUS "Using fallback llvm-cov tool: ${LLVM_COV_NAME} (${LLVM_COV})") + endif () endif() endif() From 10d61775634326e8b1146b0bda27b9fb05e17f43 Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:34:09 +0200 Subject: [PATCH 81/86] llvm tools must now be resolved directly by cmake and not by gh runner --- .../_generate_llvm_html_coverage/action.yaml | 47 +------------------ .../_publish_llvm_coverage/action.yaml | 35 +------------- 2 files changed, 4 insertions(+), 78 deletions(-) diff --git a/.github/actions/_generate_llvm_html_coverage/action.yaml b/.github/actions/_generate_llvm_html_coverage/action.yaml index b36c2a19..721ac596 100644 --- a/.github/actions/_generate_llvm_html_coverage/action.yaml +++ b/.github/actions/_generate_llvm_html_coverage/action.yaml @@ -20,52 +20,9 @@ runs: - id: htmlcov shell: bash run: | - resolve_llvm_tool() { - local tool="$1" - local candidate="" - - if candidate=$(command -v "$tool" 2>/dev/null); then - printf '%s\n' "$candidate" - return 0 - fi - - for suffix in 20 19 18 17 16; do - if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then - printf '%s\n' "$candidate" - return 0 - fi - done - - return 1 - } - - BUILD_DIR="$GITHUB_WORKSPACE/build/${{ inputs.build-preset }}" - COVERAGE_DIR="$BUILD_DIR/coverage/${{ inputs.test-preset }}" - PROFDATA_FILE="$COVERAGE_DIR/coverage.profdata" - LLVM_PROFDATA_BIN=$(resolve_llvm_tool llvm-profdata) - LLVM_COV_BIN=$(resolve_llvm_tool llvm-cov) - set +e - cmake -E make_directory "$COVERAGE_DIR" - cmake \ - "-DCOVERAGE_DIR=$COVERAGE_DIR" \ - "-DPROFDATA_FILE=$PROFDATA_FILE" \ - "-DLLVM_PROFDATA=$LLVM_PROFDATA_BIN" \ - -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_merge.cmake" 2>&1 | tee coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - - if [ "$COV_EXIT_CODE" -eq 0 ]; then - cmake \ - "-DCOVERAGE_DIR=$COVERAGE_DIR" \ - "-DPROFDATA_FILE=$PROFDATA_FILE" \ - "-DCTEST_PRESET=${{ inputs.test-preset }}" \ - "-DLLVM_COV=$LLVM_COV_BIN" \ - "-DPROJECT_SOURCE_DIR=$GITHUB_WORKSPACE" \ - "-DREPORT_MODE=html" \ - -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_report.cmake" 2>&1 | tee -a coverage_html_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} - fi - + cmake --build --preset ${{ matrix.build_preset }} --target coverage-html 2>&1 | tee coverage_html_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee set -e HTML_COV_DIR=$(grep -Po "HTML coverage directory: \K.*" coverage_html_summary.txt) diff --git a/.github/actions/_publish_llvm_coverage/action.yaml b/.github/actions/_publish_llvm_coverage/action.yaml index 71d3f659..9d029cea 100644 --- a/.github/actions/_publish_llvm_coverage/action.yaml +++ b/.github/actions/_publish_llvm_coverage/action.yaml @@ -34,40 +34,9 @@ runs: id: shieldsio shell: bash run: | - resolve_llvm_tool() { - local tool="$1" - local candidate="" - - if candidate=$(command -v "$tool" 2>/dev/null); then - printf '%s\n' "$candidate" - return 0 - fi - - for suffix in 20 19 18 17 16; do - if candidate=$(command -v "${tool}-${suffix}" 2>/dev/null); then - printf '%s\n' "$candidate" - return 0 - fi - done - - return 1 - } - - BUILD_DIR="$GITHUB_WORKSPACE/build/${{ inputs.build-preset }}" - COVERAGE_DIR="$BUILD_DIR/coverage/${{ inputs.test-preset }}" - PROFDATA_FILE="$COVERAGE_DIR/coverage.profdata" - LLVM_COV_BIN=$(resolve_llvm_tool llvm-cov) - set +e - cmake \ - "-DCOVERAGE_DIR=$COVERAGE_DIR" \ - "-DPROFDATA_FILE=$PROFDATA_FILE" \ - "-DCTEST_PRESET=${{ inputs.test-preset }}" \ - "-DLLVM_COV=$LLVM_COV_BIN" \ - "-DPROJECT_SOURCE_DIR=$GITHUB_WORKSPACE" \ - "-DREPORT_MODE=shieldsio" \ - -P "$GITHUB_WORKSPACE/cmake/coverage/target_coverage_report.cmake" 2>&1 | tee coverage_shieldsio_summary.txt - COV_EXIT_CODE=${PIPESTATUS[0]} + cmake --build --preset ${{ matrix.build_preset }} --target coverage-shieldsio 2>&1 | tee coverage_shieldsio_summary.txt + COV_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee set -e SHIELDSIO_REGION_COV_BADGE_FILE=$(grep -Po "Shields.io Region Coverage badge written to: \K.*" coverage_shieldsio_summary.txt) From fa3fc1bcbe8fdfb4ad0125cb5ccf2a30f2f8b78c Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:34:41 +0200 Subject: [PATCH 82/86] VCPKG_INSTALLATION_ROOT shoud exist on the runner or raise an error, not try a magical path --- .github/actions/_setup_configure_build_linux/action.yaml | 8 ++------ .../actions/_setup_configure_build_windows/action.yaml | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/actions/_setup_configure_build_linux/action.yaml b/.github/actions/_setup_configure_build_linux/action.yaml index 0b5b2e4c..d5fe3ee9 100644 --- a/.github/actions/_setup_configure_build_linux/action.yaml +++ b/.github/actions/_setup_configure_build_linux/action.yaml @@ -28,11 +28,7 @@ runs: run: | set -euo pipefail - if [[ -n "${VCPKG_INSTALLATION_ROOT:-}" ]]; then - VCPKG_ROOT="$VCPKG_INSTALLATION_ROOT" - elif [[ -d /usr/local/share/vcpkg ]]; then - VCPKG_ROOT=/usr/local/share/vcpkg - else + if [[ -z "${VCPKG_INSTALLATION_ROOT:-}" ]]; then echo "::error::No pre-installed vcpkg root was found on this runner." exit 1 fi @@ -42,7 +38,7 @@ runs: "$GITHUB_WORKSPACE/.cache/vcpkg/archives" { - echo "VCPKG_ROOT=$VCPKG_ROOT" + echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" echo "VCPKG_DOWNLOADS=$GITHUB_WORKSPACE/.cache/vcpkg/downloads" echo "VCPKG_DEFAULT_BINARY_CACHE=$GITHUB_WORKSPACE/.cache/vcpkg/archives" } >> "$GITHUB_ENV" diff --git a/.github/actions/_setup_configure_build_windows/action.yaml b/.github/actions/_setup_configure_build_windows/action.yaml index b8f4d998..58dc540b 100644 --- a/.github/actions/_setup_configure_build_windows/action.yaml +++ b/.github/actions/_setup_configure_build_windows/action.yaml @@ -27,10 +27,6 @@ runs: shell: pwsh run: | $vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT - if (-not $vcpkgRoot -and (Test-Path 'C:\vcpkg')) { - $vcpkgRoot = 'C:\vcpkg' - } - if (-not $vcpkgRoot -or -not (Test-Path $vcpkgRoot)) { throw 'No pre-installed vcpkg root was found on this runner.' } From ea5710f8635a21ee8231d6bc9c12829e8bb98df6 Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:52:14 +0200 Subject: [PATCH 83/86] fixed all workflows triggering when setting any label event --- .github/workflows/linux_build_test.yaml | 10 ++++++++-- .github/workflows/macos_build_test.yaml | 6 ++++-- .github/workflows/windows_build_test.yaml | 6 ++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index e5c3e111..5a75c373 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -26,16 +26,22 @@ jobs: - id: set-matrix env: EVENT_ACTION: ${{ github.event.action }} + EVENT_LABEL: ${{ github.event.label.name || '' }} HAS_PREMERGE_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') }} run: | SHOULD_RUN=true - if [[ "$HAS_PREMERGE_LABEL" == "true" ]]; then + if [[ "$EVENT_ACTION" == "labeled" && "$EVENT_LABEL" == "run-pre-merge-checks" ]]; then + MATRIX='{"include":[ + {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, + {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} + ]}' + elif [[ "$EVENT_ACTION" == "synchronize" && "$HAS_PREMERGE_LABEL" == "true" ]]; then MATRIX='{"include":[ {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"}, {"runner":"ubuntu-24.04","arch":"x64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"}, {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_release","build_preset":"clang_release","test_preset":"quick-validation-clang-release"} ]}' - elif [[ "$EVENT_ACTION" != "labeled" ]]; then + elif [[ "$EVENT_ACTION" == "opened" || "$EVENT_ACTION" == "reopened" || "$EVENT_ACTION" == "synchronize" ]]; then MATRIX='{"include":[ {"runner":"ubuntu-24.04-arm","arch":"arm64","configure_preset":"clang_debug","build_preset":"clang_debug","test_preset":"quick-validation-clang-debug"} ]}' diff --git a/.github/workflows/macos_build_test.yaml b/.github/workflows/macos_build_test.yaml index 4597e0bd..99260751 100644 --- a/.github/workflows/macos_build_test.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -3,7 +3,7 @@ name: MacOS Build Test on: pull_request: branches: [ main ] - types: [ labeled, synchronize, reopened ] + types: [ labeled, synchronize ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -14,7 +14,9 @@ permissions: jobs: macos-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + if: | + (github.event.action == 'labeled' && github.event.label.name == 'run-pre-merge-checks') || + (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks')) strategy: fail-fast: false matrix: diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index 8e5ea20a..dbcea89a 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -3,7 +3,7 @@ name: Windows Build Test on: pull_request: branches: [ main ] - types: [ labeled, synchronize, reopened ] + types: [ labeled, synchronize ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -14,7 +14,9 @@ permissions: jobs: windows-build: - if: contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks') + if: | + (github.event.action == 'labeled' && github.event.label.name == 'run-pre-merge-checks') || + (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks')) strategy: fail-fast: false matrix: From fb214abcc0d2fea5411c2e2908c1265e2f1fb1d3 Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:58:12 +0200 Subject: [PATCH 84/86] formatting --- .github/workflows/linux_build_test.yaml | 5 +++-- .github/workflows/macos_build_test.yaml | 5 +++-- .github/workflows/windows_build_test.yaml | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 5a75c373..0e11cac2 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -61,11 +61,12 @@ jobs: linux-build: needs: plan-linux-build if: needs.plan-linux-build.outputs.should_run == 'true' + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + strategy: fail-fast: false matrix: ${{ fromJson(needs.plan-linux-build.outputs.matrix) }} - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos_build_test.yaml b/.github/workflows/macos_build_test.yaml index 99260751..c66edc39 100644 --- a/.github/workflows/macos_build_test.yaml +++ b/.github/workflows/macos_build_test.yaml @@ -17,6 +17,9 @@ jobs: if: | (github.event.action == 'labeled' && github.event.label.name == 'run-pre-merge-checks') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks')) + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + strategy: fail-fast: false matrix: @@ -31,8 +34,6 @@ jobs: configure_preset: clang_release build_preset: clang_release test_preset: quick-validation-clang-release - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/windows_build_test.yaml b/.github/workflows/windows_build_test.yaml index dbcea89a..ed1e4ce7 100644 --- a/.github/workflows/windows_build_test.yaml +++ b/.github/workflows/windows_build_test.yaml @@ -17,6 +17,9 @@ jobs: if: | (github.event.action == 'labeled' && github.event.label.name == 'run-pre-merge-checks') || (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-pre-merge-checks')) + runs-on: ${{ matrix.runner }} + name: ${{ matrix.runner }} - ${{ matrix.test_preset }} + strategy: fail-fast: false matrix: @@ -36,8 +39,6 @@ jobs: configure_preset: msvc_release_arm64 build_preset: msvc_release_arm64 test_preset: quick-validation-msvc-release-arm64 - runs-on: ${{ matrix.runner }} - name: ${{ matrix.runner }} - ${{ matrix.test_preset }} steps: - uses: actions/checkout@v4 From bbe5c7e7858b35b99afa6b1fc4542f80c6dfb8fd Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 10:59:08 +0200 Subject: [PATCH 85/86] more formatting --- .github/workflows/linux_build_test.yaml | 2 +- .github/workflows/publish_llvm_coverage.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_build_test.yaml b/.github/workflows/linux_build_test.yaml index 0e11cac2..36f361e1 100644 --- a/.github/workflows/linux_build_test.yaml +++ b/.github/workflows/linux_build_test.yaml @@ -3,7 +3,7 @@ name: Linux Build Test on: pull_request: branches: [ main ] - types: [opened, reopened, synchronize, labeled] + types: [ opened, reopened, synchronize, labeled ] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index 10793e56..85db4698 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -2,7 +2,7 @@ name: Publish LLVM Coverage on: push: - branches: [main] + branches: [ main ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From c024e10fe1f911c03e9888684a93231b1b85aa26 Mon Sep 17 00:00:00 2001 From: baptiste Date: Fri, 3 Apr 2026 11:01:37 +0200 Subject: [PATCH 86/86] removed testing before running coverage generation since this is already a dependency of the html-coverage target --- .github/workflows/publish_llvm_coverage.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/publish_llvm_coverage.yaml b/.github/workflows/publish_llvm_coverage.yaml index 85db4698..a2bf23ba 100644 --- a/.github/workflows/publish_llvm_coverage.yaml +++ b/.github/workflows/publish_llvm_coverage.yaml @@ -27,12 +27,6 @@ jobs: configure-preset: clang_debug build-preset: clang_debug - - name: Test (quick-validation-clang-debug) - uses: ./.github/actions/_log_to_gh_summary_bash - with: - step-name: Test (quick-validation-clang-debug) - command: "ctest --preset quick-validation-clang-debug --output-on-failure" - - name: Publish coverage (clang_debug) uses: ./.github/actions/_publish_llvm_coverage with: