-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (59 loc) · 1.59 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Code Coverage
on:
push:
paths:
- 'include/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- '**conanfile.py'
- '.github/workflows/coverage.yml'
pull_request:
jobs:
coverage:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Install gcovr
run: pip install gcovr
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: conan profile detect --force
- name: Install dependencies
run: >
conan install
--build=missing
--settings build_type=Debug
--settings compiler.cppstd=17
${{github.workspace}}
- name: Configure CMake
run: >
cmake
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_TOOLCHAIN_FILE=build/Debug/generators/conan_toolchain.cmake
--preset=coverage-gcov
- name: Build
run: cmake --build build/Debug
- name: Test
run: ctest --test-dir build/Debug
# Compute line coverage
- name: Generate coverage report
id: coverage
run: >
gcovr
--root ${{github.workspace}}
--filter include/
--exclude-throw-branches
--exclude-unreachable-branches
--lcov coverage.lcov
--print-summary
shell: bash
# TODO Coveralls integration