From df29251a241bb3e50b0557740c9a7663473487a7 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:36:30 +0100 Subject: [PATCH 01/18] ci: add coverage workflow --- .github/workflows/coverage.yml | 184 +++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..dedd176 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,184 @@ +# Copyright Dominic (DNKpp) Koepke 2025. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +name: coverage + +env: + COBERTURA_REPORT: cobertura.xml + COVERALLS_REPORT: coveralls.json + JSON_REPORT: report.json + JSON_SUMMARY: summary.json + HTML_REPORT_DIR: html/ + COVERAGE_ARTIFACT_NAME: coverage-report + +on: + push: + branches: [ main, development ] + paths-ignore: + - 'README.md' + - 'docs/**' + pull_request: + branches: [ main, development ] + paths-ignore: + - 'README.md' + - 'docs/**' + +jobs: + create-coverage-report: + runs-on: ubuntu-latest + container: + image: "ghcr.io/dnkpp/gcc:15" + + steps: + - uses: actions/checkout@v6 + + - name: Install gcovr + run: | + python -m pip install gcovr + + - name: Print versions + run: | + cmake --version + gcc --version + g++ --version + gcov --version + gcovr --version + + - name: Configure + shell: bash + env: + COMPILER_FLAGS: "--coverage;-fno-inline;-fprofile-abs-path;-fkeep-inline-functions;-fkeep-static-functions" + LINKER_FLAGS: "--coverage" + run: | + cmake -S . \ + -B build \ + --log-level=DEBUG \ + -D CMAKE_VERBOSE_MAKEFILE=YES \ + -D CMAKE_BUILD_TYPE="Debug" \ + -D GIMO_TEST_ADDITIONAL_COMPILER_FLAGS=${COMPILER_FLAGS} \ + -D GIMO_TEST_ADDITIONAL_LINKER_FLAGS=${LINKER_FLAGS} \ + -D GIMO_CONFIG_CXX_STANDARD=23 \ + -D GIMO_BUILD_BENCHMARKS=NO \ + -D GIMO_BUILD_EXAMPLES=YES \ + -D GIMO_BUILD_TESTS=YES + + - name: Build + run: | + cmake --build build --parallel + + - name: Run tests + shell: bash + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: | + ctest --test-dir build \ + -C Debug \ + --output-on-failure \ + --no-tests=error \ + --parallel + + - name: Run gcovr + run: | + # circumvent "fatal: detected dubious ownership in repository" error + git config --global --add safe.directory ${GITHUB_WORKSPACE} + cd build + gcovr --root .. \ + --verbose \ + --include "${GITHUB_WORKSPACE}/include/gimo(_ext)?" \ + --filter "${GITHUB_WORKSPACE}/include/gimo(_ext)?" \ + --exclude-lines-by-pattern "\s*GIMO_ASSERT\(" \ + --exclude-unreachable-branches \ + --exclude-function-lines \ + --exclude-noncode-lines \ + --exclude-throw-branches \ + --decisions \ + --calls \ + --keep \ + --txt \ + --cobertura ${{env.COBERTURA_REPORT}} --cobertura-pretty \ + --html-nested ${{env.HTML_REPORT_DIR}} --html-title "gimo Coverage Report" \ + --coveralls ${{env.COVERALLS_REPORT}} --coveralls-pretty \ + --json-summary ${{env.JSON_SUMMARY}} --json-summary-pretty \ + --json ${{env.JSON_REPORT}} --json-pretty + + mv ${{env.COBERTURA_REPORT}} .. + mv ${{env.HTML_REPORT_DIR}} .. + mv ${{env.COVERALLS_REPORT}} .. + mv ${{env.JSON_SUMMARY}} .. + mv ${{env.JSON_REPORT}} .. + + - name: Find gcov-files + shell: bash + run: find . -type f -name "*.gcov" + + - name: Upload gcov coverage report artifacts + uses: actions/upload-artifact@v6 + with: + name: gcov-files + path: "**/*.gcov" + if-no-files-found: error + + - name: Upload generated report artifacts + uses: actions/upload-artifact@v6 + with: + name: ${{env.COVERAGE_ARTIFACT_NAME}} + path: | + ${{env.COBERTURA_REPORT}} + ${{env.COVERALLS_REPORT}} + ${{env.JSON_REPORT}} + ${{env.JSON_SUMMARY}} + ${{env.HTML_REPORT_DIR}} + if-no-files-found: error + + codacy-report: + needs: create-coverage-report + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v7 + with: + name: ${{env.COVERAGE_ARTIFACT_NAME}} + + - name: Upload coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + with: + project-token: ${{secrets.CODACY_PROJECT_TOKEN}} + coverage-reports: ${{env.COBERTURA_REPORT}} + + codecov-report: + needs: create-coverage-report + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v7 + with: + name: ${{env.COVERAGE_ARTIFACT_NAME}} + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + name: $GITHUB_REPOSITORY + token: ${{secrets.CODECOV_TOKEN}} + files: ${{env.COBERTURA_REPORT}} + fail_ci_if_error: true + verbose: true + + coveralls-report: + needs: create-coverage-report + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v7 + with: + name: ${{env.COVERAGE_ARTIFACT_NAME}} + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + file: ${{env.COVERALLS_REPORT}} + # can not use ${{ github.workspace }} here + # see: https://github.com/actions/checkout/issues/785 + base-path: "/__w/gimo/gimo/include" + format: coveralls + debug: true + fail-on-error: true From d1fad152538f684a16fa5214f65edf534a915b7d Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:45:06 +0100 Subject: [PATCH 02/18] chore: add Gimo-EnableTestFlags.cmake and utilize in unit-tests --- cmake/Gimo-EnableTestFlags.cmake | 23 +++++++++++++++++++++++ test/unit-tests/CMakeLists.txt | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 cmake/Gimo-EnableTestFlags.cmake diff --git a/cmake/Gimo-EnableTestFlags.cmake b/cmake/Gimo-EnableTestFlags.cmake new file mode 100644 index 0000000..efa3e00 --- /dev/null +++ b/cmake/Gimo-EnableTestFlags.cmake @@ -0,0 +1,23 @@ +# Copyright Dominic (DNKpp) Koepke 2025. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +if (NOT TARGET gimo-internal-test-flags) + add_library(gimo-internal-test-flags INTERFACE) + add_library(gimo::internal::enable-test-flags ALIAS gimo-internal-test-flags) + + if (GIMO_TEST_ADDITIONAL_COMPILER_FLAGS) + message(DEBUG "${MESSAGE_PREFIX} enabled additional compiler-flags: ${GIMO_TEST_ADDITIONAL_COMPILER_FLAGS}") + target_compile_options(gimo-internal-test-flags INTERFACE + ${GIMO_TEST_ADDITIONAL_COMPILER_FLAGS} + ) + endif () + + if (GIMO_TEST_ADDITIONAL_LINKER_FLAGS) + message(DEBUG "${MESSAGE_PREFIX} enabled additional linker-flags: ${GIMO_TEST_ADDITIONAL_LINKER_FLAGS}") + target_link_options(gimo-internal-test-flags INTERFACE + ${GIMO_TEST_ADDITIONAL_LINKER_FLAGS} + ) + endif () +endif () diff --git a/test/unit-tests/CMakeLists.txt b/test/unit-tests/CMakeLists.txt index 5b2c6c9..f81b4a9 100644 --- a/test/unit-tests/CMakeLists.txt +++ b/test/unit-tests/CMakeLists.txt @@ -21,11 +21,13 @@ include(EnableSanitizers) enable_sanitizers(${TARGET_NAME}) include(EnableWarnings) +include(Gimo-EnableTestFlags) find_package(Catch2 REQUIRED) find_package(gimo-mimic++ REQUIRED) target_link_libraries(${TARGET_NAME} PRIVATE gimo::gimo gimo::internal::enable-warnings + gimo::internal::enable-test-flags Catch2::Catch2WithMain mimicpp::mimicpp From eed2f74c7149aa13867fea5eedb7fcaba1ab1321 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:46:44 +0100 Subject: [PATCH 03/18] fix: correct project homepage url --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1a9136..390f59e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,10 @@ include(GimoReadVersion) gimo_read_version("include/gimo/Version.hpp" GIMO_VERSION) project(gimo - LANGUAGES CXX - VERSION ${GIMO_VERSION} - DESCRIPTION "TBD" - HOMEPAGE_URL "https://github.com/DNKpp/nullables" + LANGUAGES CXX + VERSION ${GIMO_VERSION} + DESCRIPTION "TBD" + HOMEPAGE_URL "https://github.com/DNKpp/gimo" ) message(STATUS "${MESSAGE_PREFIX} version: v${PROJECT_VERSION} from: ${gimo_SOURCE_DIR}") From 4f97981938c08c19018c828e3f964d3e5db7ecf6 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:48:10 +0100 Subject: [PATCH 04/18] chore: use cmake version range 3.15...3.31 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 390f59e..4bcd344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.15...3.31) set(MESSAGE_PREFIX "gimo:") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") From 4def297efb0cd34ffe8d2dd03dceaceab2150a5a Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:57:35 +0100 Subject: [PATCH 05/18] fix: reference *.json.gz files instead of *.gcov --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dedd176..ac81e21 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -117,7 +117,7 @@ jobs: uses: actions/upload-artifact@v6 with: name: gcov-files - path: "**/*.gcov" + path: "**/*.json.gz" if-no-files-found: error - name: Upload generated report artifacts From 0713cb857e0851ca4c577114b1a84ea5994bed72 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 04:57:49 +0100 Subject: [PATCH 06/18] ci: utilize new gcovr options --- .github/workflows/coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ac81e21..88b3dce 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -96,6 +96,8 @@ jobs: --decisions \ --calls \ --keep \ + --merge-lines \ + --json-trace-data-source \ --txt \ --cobertura ${{env.COBERTURA_REPORT}} --cobertura-pretty \ --html-nested ${{env.HTML_REPORT_DIR}} --html-title "gimo Coverage Report" \ From 60474390b6ee4bf6360b42e5ffb9d2e48d6b90a7 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:00:37 +0100 Subject: [PATCH 07/18] chore: use available std facilities instead of third-party libraries within mimic++ --- .github/workflows/coverage.yml | 3 +++ cmake/Findgimo-mimic++.cmake | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 88b3dce..112d553 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -57,6 +57,9 @@ jobs: --log-level=DEBUG \ -D CMAKE_VERBOSE_MAKEFILE=YES \ -D CMAKE_BUILD_TYPE="Debug" \ + -D MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE=C++23 \ + -D MIMICPP_CONFIG_EXPERIMENTAL_PRETTY_TYPES=OFF \ + -D MIMICPP_CONFIG_USE_FMT=OFF \ -D GIMO_TEST_ADDITIONAL_COMPILER_FLAGS=${COMPILER_FLAGS} \ -D GIMO_TEST_ADDITIONAL_LINKER_FLAGS=${LINKER_FLAGS} \ -D GIMO_CONFIG_CXX_STANDARD=23 \ diff --git a/cmake/Findgimo-mimic++.cmake b/cmake/Findgimo-mimic++.cmake index 7f08fc0..baa94e3 100644 --- a/cmake/Findgimo-mimic++.cmake +++ b/cmake/Findgimo-mimic++.cmake @@ -5,7 +5,7 @@ include(Gimo-get_cpm) -set(MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE "cpptrace" CACHE BOOL "" FORCE) -set(MIMICPP_CONFIG_EXPERIMENTAL_PRETTY_TYPES ON CACHE BOOL "" FORCE) -set(MIMICPP_CONFIG_USE_FMT ON CACHE BOOL "" FORCE) +set(MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE "cpptrace" CACHE BOOL "") +set(MIMICPP_CONFIG_EXPERIMENTAL_PRETTY_TYPES ON CACHE BOOL "") +set(MIMICPP_CONFIG_USE_FMT ON CACHE BOOL "") CPMAddPackage("gh:DNKpp/mimicpp@9.2.1") From 4d46d29a3678a2ad99d9fdf095ab5ef3c60517f1 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:02:21 +0100 Subject: [PATCH 08/18] ci: remove obsolete env variable --- .github/workflows/coverage.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 112d553..1e64fcc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -73,8 +73,6 @@ jobs: - name: Run tests shell: bash - env: - CTEST_OUTPUT_ON_FAILURE: 1 run: | ctest --test-dir build \ -C Debug \ From aa23f528d6345bcc31832250a5b6d535894b35a0 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:02:44 +0100 Subject: [PATCH 09/18] fix: remove unknown gcovr option --- .github/workflows/coverage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1e64fcc..a82ef79 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -98,7 +98,6 @@ jobs: --calls \ --keep \ --merge-lines \ - --json-trace-data-source \ --txt \ --cobertura ${{env.COBERTURA_REPORT}} --cobertura-pretty \ --html-nested ${{env.HTML_REPORT_DIR}} --html-title "gimo Coverage Report" \ From e6ea4b235ca347b6191b238a227a7670187204fa Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:12:17 +0100 Subject: [PATCH 10/18] ci: upload junit test-report to codecov --- .github/workflows/coverage.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a82ef79..908df64 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,6 +12,7 @@ env: JSON_SUMMARY: summary.json HTML_REPORT_DIR: html/ COVERAGE_ARTIFACT_NAME: coverage-report + JUNIT_REPORT: junit.cml on: push: @@ -75,6 +76,7 @@ jobs: shell: bash run: | ctest --test-dir build \ + --output-junit -C Debug \ --output-on-failure \ --no-tests=error \ @@ -110,6 +112,7 @@ jobs: mv ${{env.COVERALLS_REPORT}} .. mv ${{env.JSON_SUMMARY}} .. mv ${{env.JSON_REPORT}} .. + mv ${{env.JUNIT_REPORT}} .. - name: Find gcov-files shell: bash @@ -131,6 +134,7 @@ jobs: ${{env.COVERALLS_REPORT}} ${{env.JSON_REPORT}} ${{env.JSON_SUMMARY}} + ${{env.JUNIT_REPORT}} ${{env.HTML_REPORT_DIR}} if-no-files-found: error @@ -165,6 +169,14 @@ jobs: fail_ci_if_error: true verbose: true + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ${{env.JUNIT_REPORT}} + verbose: true + fail_ci_if_error: true + coveralls-report: needs: create-coverage-report runs-on: ubuntu-latest From 9ef364f90c7f38f067259b0be0d8878698df5626 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:13:46 +0100 Subject: [PATCH 11/18] fix: use correct value for MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE option --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 908df64..262cc76 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -58,7 +58,7 @@ jobs: --log-level=DEBUG \ -D CMAKE_VERBOSE_MAKEFILE=YES \ -D CMAKE_BUILD_TYPE="Debug" \ - -D MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE=C++23 \ + -D MIMICPP_CONFIG_EXPERIMENTAL_STACKTRACE=c++23 \ -D MIMICPP_CONFIG_EXPERIMENTAL_PRETTY_TYPES=OFF \ -D MIMICPP_CONFIG_USE_FMT=OFF \ -D GIMO_TEST_ADDITIONAL_COMPILER_FLAGS=${COMPILER_FLAGS} \ From 530aaa90cc25e8d1e6e048aa54eb4c74527d325c Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 05:24:27 +0100 Subject: [PATCH 12/18] fix: link to stdc++exp in coverage workflow --- .github/workflows/coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 262cc76..1a41286 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -52,6 +52,7 @@ jobs: env: COMPILER_FLAGS: "--coverage;-fno-inline;-fprofile-abs-path;-fkeep-inline-functions;-fkeep-static-functions" LINKER_FLAGS: "--coverage" + LDFLAGS: "-Wl,--whole-archive -lstdc++exp -Wl,--no-whole-archive" run: | cmake -S . \ -B build \ From f10afc271ec7867523227b9ed5213c938c35d9b7 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 06:50:27 +0100 Subject: [PATCH 13/18] fix: correct ctest call --- .github/workflows/coverage.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1a41286..8d79971 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,7 +12,7 @@ env: JSON_SUMMARY: summary.json HTML_REPORT_DIR: html/ COVERAGE_ARTIFACT_NAME: coverage-report - JUNIT_REPORT: junit.cml + JUNIT_REPORT: junit.xml on: push: @@ -77,7 +77,7 @@ jobs: shell: bash run: | ctest --test-dir build \ - --output-junit + --output-junit ${{env.JUNIT_REPORT}} \ -C Debug \ --output-on-failure \ --no-tests=error \ @@ -113,7 +113,6 @@ jobs: mv ${{env.COVERALLS_REPORT}} .. mv ${{env.JSON_SUMMARY}} .. mv ${{env.JSON_REPORT}} .. - mv ${{env.JUNIT_REPORT}} .. - name: Find gcov-files shell: bash From bbd3c168a6e23f3df1a8b939efbcd9f266f9dbf7 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 07:10:47 +0100 Subject: [PATCH 14/18] fix: correct codecov test result upload --- .github/workflows/coverage.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8d79971..2fb85b7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -166,16 +166,19 @@ jobs: name: $GITHUB_REPOSITORY token: ${{secrets.CODECOV_TOKEN}} files: ${{env.COBERTURA_REPORT}} + disable_search: true fail_ci_if_error: true verbose: true - name: Upload test results to Codecov - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v5 with: token: ${{secrets.CODECOV_TOKEN}} - file: ${{env.JUNIT_REPORT}} - verbose: true + report_type: test_results + files: ${{env.JUNIT_REPORT}} + disable_search: true fail_ci_if_error: true + verbose: true coveralls-report: needs: create-coverage-report From 89a24e767fcd2d5cedbc5bc544b44329680a2f3f Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 07:12:58 +0100 Subject: [PATCH 15/18] fix: move junit report out of build directory --- .github/workflows/coverage.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2fb85b7..8028cf9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -78,10 +78,11 @@ jobs: run: | ctest --test-dir build \ --output-junit ${{env.JUNIT_REPORT}} \ - -C Debug \ --output-on-failure \ --no-tests=error \ - --parallel + --parallel \ + -C Debug + mv build/${{env.JUNIT_REPORT}} . - name: Run gcovr run: | @@ -174,6 +175,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{secrets.CODECOV_TOKEN}} + flags: coverage report_type: test_results files: ${{env.JUNIT_REPORT}} disable_search: true From 4adce6fed7c38753757095149ae973655e8b7a5b Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 08:21:26 +0100 Subject: [PATCH 16/18] ci: upload test result to codecov in build workflow --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 147c965..2fde6a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,9 @@ on: - 'README.md' - 'docs/**' +env: + JUNIT_REPORT: junit.xml + jobs: build-and-test: runs-on: ${{ matrix.config.os }} @@ -390,12 +393,25 @@ jobs: shell: bash run: | ctest --test-dir build \ + --output-junit ${{env.JUNIT_REPORT}} \ --output-on-failure \ --schedule-random \ --no-tests=error \ --parallel \ -C ${{ matrix.build_mode }} \ + mv build/${{env.JUNIT_REPORT}} . # # End Build # ############# + + - name: Upload test results to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{secrets.CODECOV_TOKEN}} + flags: ${{matrix.config.compiler.name}},${{matrix.config.compiler.version}} + report_type: test_results + files: ${{env.JUNIT_REPORT}} + disable_search: true + fail_ci_if_error: true + verbose: true From ae8870fcc569f0bf68fa1c0e9701fcfc8a53d87d Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 08:51:09 +0100 Subject: [PATCH 17/18] ci: remove base-path option from coverallsapp step --- .github/workflows/coverage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8028cf9..e247c38 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -195,9 +195,6 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} file: ${{env.COVERALLS_REPORT}} - # can not use ${{ github.workspace }} here - # see: https://github.com/actions/checkout/issues/785 - base-path: "/__w/gimo/gimo/include" format: coveralls debug: true fail-on-error: true From 97b9ea93e3a73a33f67aa72d99897a483095b8bb Mon Sep 17 00:00:00 2001 From: DNKpp Date: Wed, 24 Dec 2025 09:08:38 +0100 Subject: [PATCH 18/18] ci: tweak test result upload --- .github/workflows/build.yml | 5 ++++- .github/workflows/coverage.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fde6a3..f734c8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -384,6 +384,7 @@ jobs: - name: Build Framework shell: bash + id: build run: | cmake --build build \ -j5 \ @@ -406,12 +407,14 @@ jobs: ############# - name: Upload test results to Codecov + if: ${{ steps.build.outcome == 'success' && !cancelled() }} uses: codecov/codecov-action@v5 with: token: ${{secrets.CODECOV_TOKEN}} flags: ${{matrix.config.compiler.name}},${{matrix.config.compiler.version}} report_type: test_results - files: ${{env.JUNIT_REPORT}} + files: /__w/gimo/gimo/${{env.JUNIT_REPORT}} disable_search: true fail_ci_if_error: true + handle_no_reports_found: true verbose: true diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e247c38..f347f1a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -177,7 +177,7 @@ jobs: token: ${{secrets.CODECOV_TOKEN}} flags: coverage report_type: test_results - files: ${{env.JUNIT_REPORT}} + files: ./${{env.JUNIT_REPORT}} disable_search: true fail_ci_if_error: true verbose: true