Skip to content

Commit

Permalink
Switch coverage format to LCOV
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Apr 16, 2024
1 parent aba09a4 commit 68454f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
- name: configure
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends lcov
sudo apt-get clean
mkdir ${build_dir}
cd ${build_dir}
cmake \
Expand All @@ -106,19 +109,24 @@ jobs:
-DCMAKE_CXX_FLAGS="-g --coverage -fprofile-abs-path -fno-early-inlining" \
..
- name: build, run tests, prepare .gcov files
- name: build, run tests, prepare coverage data
shell: bash
run: |
cd ${build_dir}
cmake --build . --target all
tests/tests -a # generate .gcda files
gcov -pbc $( find tests/ -type f -name '*.gcno' ) # generate .gcov files
cmake --build .
lcov --rc lcov_branch_coverage=1 --no-external --capture --initial --directory $( realpath .. ) --output-file /tmp/base.info
tests/tests -a
lcov --rc lcov_branch_coverage=1 --no-external --capture --directory $( realpath .. ) --output-file /tmp/test.info
lcov --rc lcov_branch_coverage=1 --add-tracefile /tmp/base.info --add-tracefile /tmp/test.info --output-file /tmp/total.info
lcov --rc lcov_branch_coverage=1 --remove /tmp/total.info "$( realpath . )" "$( realpath ../tests )" --output-file /tmp/filtered.info
cp /tmp/filtered.info "$( realpath .. )/coverage.txt"
- name: upload coverage report
uses: codecov/[email protected]
with:
fail_ci_if_error: true
disable_search: false
files: coverage.txt
disable_search: true
verbose: true
plugin: noop
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 0 additions & 1 deletion tests/catch2

This file was deleted.

0 comments on commit 68454f8

Please sign in to comment.