From 3ff123c6c2ff286f62c2796f1f12ef5bdf4c4e00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:54:25 -0700 Subject: [PATCH] Bump codecov/codecov-action from 3 to 4 (#7) * Bump codecov/codecov-action from 3 to 4 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update tests.yml * Update tests.yml * Update tests.yml * drop gcc7 cov * Update codecov.yml * Update tests.yml * shell: bash * Update tests.yml * Update codecov.yml * Update tests.yml * clang coverage * Update tests.yml * Update tests.yml * modules * Update tests.yml * drop windows codecov --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adam Lugowski --- .github/workflows/tests.yml | 16 ++++++++++++---- codecov.yml | 2 ++ tests/CMakeLists.txt | 5 ++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6391831..a445d8c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,7 @@ jobs: llvm-version: "7" description: "LLVM 7" cppstd: "11 14 17" + gcov_executable: "llvm-cov gcov" - os: ubuntu-20.04 # oldest GCC that the setup-gcc action is able to install @@ -32,6 +33,7 @@ jobs: - os: ubuntu-latest # default GCC, which has gcov cppstd: "11 14 17 20 23" + gcov_executable: "gcov" - os: macos-latest # uses Apple Clang @@ -59,6 +61,8 @@ jobs: - name: Build and Test run: | + pip install gcovr + for cppstd in ${{ matrix.cppstd }}; do echo "" echo "" @@ -68,13 +72,17 @@ jobs: cmake --build $BUILD --config Debug cd $BUILD/tests ctest -C Debug --output-on-failure --verbose + if [ -n '${{ matrix.gcov_executable }}' ]; then + gcovr --delete --root ../../ --print-summary --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}' --merge-mode-functions=separate --gcov-ignore-parse-errors=negative_hits.warn_once_per_file + fi cd ../.. done shell: bash - name: Upload Coverage to Codecov - if: contains(matrix.os, 'ubuntu') - uses: codecov/codecov-action@v3 + if: matrix.gcov_executable != '' + uses: codecov/codecov-action@v4 with: - gcov: true - gcov_include: include/* + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/codecov.yml b/codecov.yml index bc5b9f2..e246205 100644 --- a/codecov.yml +++ b/codecov.yml @@ -12,6 +12,8 @@ parsers: branch_detection: conditional: no loop: no + cobertura: + partials_as_hits: true ignore: - "tests" - "benchmark" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c49abb6..03e7ed0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,8 +11,11 @@ endif() option(TASK_THREAD_POOL_TEST_COVERAGE "Code-coverage" OFF) if(TASK_THREAD_POOL_TEST_COVERAGE) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - add_compile_options("--coverage") + add_compile_options("-O0" "--coverage") add_link_options("-lgcov" "--coverage") + elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + add_compile_options("-O0" "--coverage") + add_link_options("--coverage") endif() endif()