Skip to content

Commit 3dcb5c4

Browse files
committed
Switch to gcov for code coverage upload
1 parent 14d1f41 commit 3dcb5c4

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

.github/workflows/run_cpp_tests.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,21 @@ jobs:
4242
- name: Configure for coverage
4343
if: runner.os == 'Linux'
4444
run: |
45-
cmake -S. -Bbuild -DBUILD_MEX=False -DCHECK_COVERAGE=True
45+
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DBUILD_MEX=False -DBUILD_TESTS=True
4646
4747
- name: Build
4848
run: |
4949
cmake --build build
5050
5151
- name: Run tests
52-
if: runner.os == 'macOS'
53-
working-directory: ./build
54-
run: |
55-
ctest -C Release --output-on-failure --verbose
56-
57-
- name: Generate coverage report
58-
if: runner.os == 'Linux'
5952
working-directory: ./build
6053
run: |
61-
make coverage
62-
gcovr -r .. . --txt-metric branch --cobertura > coverage.xml
54+
ctest --output-on-failure --verbose
6355
64-
- uses: codecov/codecov-action@v5
56+
- name: Upload coverage report to Codecov
57+
uses: codecov/codecov-action@v5
6558
if: runner.os == 'Linux'
6659
with:
67-
disable_search: true
68-
files: build/coverage.xml
6960
verbose: true
7061
env:
7162
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ endif()
1616

1717
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
1818

19-
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og")
20-
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -Og")
19+
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og --coverage")
20+
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -Og --coverage")
2121

2222
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto")
2323
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O3 -flto")

0 commit comments

Comments
 (0)