Skip to content

Commit 8a19f89

Browse files
committed
enable codecov
1 parent 501be31 commit 8a19f89

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,16 @@ jobs:
2828
run: cmake --build build --parallel
2929

3030
- name: Zero coverage counters
31-
run: lcov --directory build --zerocounters
31+
run: lcov -d build -z
3232

3333
- name: Run tests
3434
run: ctest --test-dir build --output-on-failure
3535

3636
- name: Capture coverage
37-
run: lcov \
38-
--directory build \
39-
--capture \
40-
--output-file coverage.info
37+
run: lcov -d build -c -o coverage.info
4138

4239
- name: Filter coverage
43-
run: lcov \
44-
--remove coverage.info \
45-
'/usr/*' '*/test/*' \
46-
--output-file coverage.filtered.info
40+
run: lcov -r coverage.info '/usr/*' '*/test/*' -o coverage.filtered.info
4741

4842
- name: Generate HTML report
4943
run: genhtml coverage.filtered.info --output-directory coverage-report
@@ -54,9 +48,9 @@ jobs:
5448
name: coverage-report
5549
path: coverage-report
5650

57-
# Optional: push to Codecov (requires you set CODECOV_TOKEN in secrets)
58-
# - name: Upload to Codecov
59-
# uses: codecov/codecov-action@v3
60-
# with:
61-
# files: coverage.filtered.info
62-
# fail_ci_if_error: true
51+
- name: Upload coverage reports to Codecov
52+
uses: codecov/codecov-action@v5
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
files: coverage.filtered.info
56+
fail_ci_if_error: true

0 commit comments

Comments
 (0)