From a2a09d374cda6057f12ce01443136f38851f2d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fahller?= Date: Fri, 3 Nov 2023 14:06:51 +0100 Subject: [PATCH] Use gcov for coverage in CI rather that kcov --- .github/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6f8a057..0ae0b588 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1572,6 +1572,10 @@ jobs: then cxx_flags="${cxx_flags} -fno-omit-frame-pointer" fi + if [ ${{ matrix.config.os }} != "windows" ] + then + cxx_flags="${cxx_flags} --coverage" + fi cmake \ -S . \ -B build \ @@ -1598,17 +1602,19 @@ jobs: ./build/test/self_test - name: Collect coverage - if: (startsWith(matrix.config.name, 'Linux')) - shell: bash + if: (!startsWith(matrix.config.name, 'windows')) run: | - kcov --skip-solibs --include-pattern=trompeloeil.hpp ./coverage ./build/test/self_test || true + COV=`echo ${CXX} | grep -q clang && echo "llvm-cov gcov"|| echo gcov` + find . -name "*.gcno" + ${COV} -abcfup `find build/test -name "*.gcno"` + ls *.gcov| grep -v 'include#trompeloeil'|xargs rm - name: Upload coverage - if: startsWith(matrix.config.name, 'Linux') && github.repository == 'rollbear/trompeloeil' + if: (!startsWith(matrix.config.name, 'windows')) && github.repository == 'rollbear/trompeloeil' uses: codecov/codecov-action@v3 with: - directory: coverage - files: self_test*/cobertura.xml - name: ${{ matrix.config.name }} + gcov_include: "include/trompeloeil" + name: "${{ matrix.config.os }} ${{matrix.config.cxx}} C++${{matrix.config.std}} ${{matrix.config.stdlib}}" fail_ci_if_error: false verbose: true +