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 17, 2024
1 parent aba09a4 commit e47a5d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,5 @@ github_checks:

slack_app: false

parsers:
gcov:
branch_detection:
conditional: true
loop: true
method: false
macro: false

ignore:
- "tests/"
25 changes: 20 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,31 @@ 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 no_exception_branch=1 --rc lcov_branch_coverage=1 --no-external --capture --initial --directory $( realpath .. ) --output-file /tmp/base.info
tests/tests -a
lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --no-external --capture --directory $( realpath .. ) --output-file /tmp/test.info
lcov --rc no_exception_branch=1 --rc lcov_branch_coverage=1 --add-tracefile /tmp/base.info --add-tracefile /tmp/test.info --output-file /tmp/total.info
lcov --rc no_exception_branch=1 --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: archive coverage data
uses: actions/upload-artifact@v4
with:
name: coverage.lcov
path: coverage.lcov
retention-days: 30

- name: upload coverage report
uses: codecov/[email protected]
with:
fail_ci_if_error: true
disable_search: false
file: coverage.lcov
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 e47a5d9

Please sign in to comment.