Skip to content

Commit

Permalink
Use gcov for coverage in CI rather that kcov
Browse files Browse the repository at this point in the history
  • Loading branch information
rollbear committed Nov 3, 2023
1 parent 13b6433 commit a2a09d3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

0 comments on commit a2a09d3

Please sign in to comment.