File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed
Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ RUN apt update && apt upgrade --yes
99
1010RUN apt install --yes gcc-14 g++-14
1111RUN apt install --yes clang-format pre-commit
12- RUN apt install --yes lcov
12+ RUN apt install --yes gcovr lcov
1313
1414# Choose default gcc and g++ version
1515
Original file line number Diff line number Diff line change @@ -8,12 +8,22 @@ on: # rebuild any PRs and main branch changes
88
99jobs :
1010 coverage :
11- uses : ./.github/workflows/devcontainer-command.yml
12- with :
13- run_cmd : |
14- cmake -E make_directory build
15- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTRAITS_TEST_COVERAGE=On -S .
16- cmake --build build --config Debug --target all
17- cmake --build build --config Debug --target test
18- cmake --build build --config Debug --target coverage
11+ runs-on : ' ubuntu-24.04'
12+
13+ steps :
14+ - name : Check test coverage
15+ uses : ./.github/actions/devcontainer
16+ with :
17+ command : |
18+ cmake -E make_directory build
19+ cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTRAITS_TEST_COVERAGE=On -S .
20+ cmake --build build --config Debug --target all
21+ cmake --build build --config Debug --target test
22+ cmake --build build --config Debug --target coverage
23+
24+ - name : Create test coverage report
25+ 26+ with :
27+ filename : coverage.cobertura.xml
28+ badge : true
1929
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ add_test(NAME test.fetch COMMAND ${CMAKE_COMMAND} --build "${PROJECT_BINARY_DIR}
6868
6969if (TRAITS_TEST_COVERAGE)
7070 find_program (LCOV lcov REQUIRED)
71+ find_program (GCOVR gcovr REQUIRED)
7172 find_program (GENHTML genhtml REQUIRED)
7273
7374 set (CMAKE_CXX_FLAGS "-O0 -coverage" )
@@ -78,5 +79,6 @@ if(TRAITS_TEST_COVERAGE)
7879 COMMAND "${LCOV} " --remove coverage.info '/usr/*' '*/gtest/*' --output -file coverage.info
7980 COMMAND "${LCOV} " --list coverage.info
8081 COMMAND "${GENHTML} " --demangle-cpp -o coverage coverage.info
82+ COMMAND "${GCOVR} " --cobertura --output coverage.cobertura.xml
8183 WORKING_DIRECTORY "${CMAKE_BINARY_DIR} " )
8284endif ()
You can’t perform that action at this time.
0 commit comments