Skip to content

Commit 8a1d5f3

Browse files
committed
Switch coverage format to LCOV
1 parent aba09a4 commit 8a1d5f3

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

Diff for: .codecov.yml

-8
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,5 @@ github_checks:
2626

2727
slack_app: false
2828

29-
parsers:
30-
gcov:
31-
branch_detection:
32-
conditional: true
33-
loop: true
34-
method: false
35-
macro: false
36-
3729
ignore:
3830
- "tests/"

Diff for: .github/workflows/action.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ jobs:
9696
- name: configure
9797
shell: bash
9898
run: |
99+
sudo apt-get update
100+
sudo apt-get install -y --no-install-recommends lcov
101+
sudo apt-get clean
99102
mkdir ${build_dir}
100103
cd ${build_dir}
101104
cmake \
@@ -106,19 +109,31 @@ jobs:
106109
-DCMAKE_CXX_FLAGS="-g --coverage -fprofile-abs-path -fno-early-inlining" \
107110
..
108111
109-
- name: build, run tests, prepare .gcov files
112+
- name: build, run tests, prepare coverage data
110113
shell: bash
111114
run: |
112115
cd ${build_dir}
113-
cmake --build . --target all
114-
tests/tests -a # generate .gcda files
115-
gcov -pbc $( find tests/ -type f -name '*.gcno' ) # generate .gcov files
116+
cmake --build .
117+
lcov --rc lcov_branch_coverage=1 --no-external --capture --initial --directory $( realpath .. ) --output-file /tmp/base.info
118+
tests/tests -a
119+
lcov --rc lcov_branch_coverage=1 --no-external --capture --directory $( realpath .. ) --output-file /tmp/test.info
120+
lcov --rc lcov_branch_coverage=1 --add-tracefile /tmp/base.info --add-tracefile /tmp/test.info --output-file /tmp/total.info
121+
lcov --rc lcov_branch_coverage=1 --remove /tmp/total.info "$( realpath . )/*" "$( realpath ../tests )/*" --output-file /tmp/filtered.info
122+
cp /tmp/filtered.info "$( realpath .. )/coverage.txt"
123+
124+
- name: archive coverage data
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: coverage.lcov
128+
path: coverage.lcov
129+
retention-days: 30
116130

117131
- name: upload coverage report
118132
uses: codecov/[email protected]
119133
with:
120134
fail_ci_if_error: true
121-
disable_search: false
135+
file: coverage.lcov
136+
disable_search: true
122137
verbose: true
123138
plugin: noop
124139
token: ${{ secrets.CODECOV_TOKEN }}

Diff for: tests/catch2

-1
This file was deleted.

0 commit comments

Comments
 (0)