-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.63 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
name: code coverage
on: [push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest cmake
uses: lukka/get-cmake@latest
- name: Install gcovr
run: pip install gcovr
- name: Configure
env:
CXXFLAGS: --coverage -fprofile-abs-path -g -O1
CFLAGS: --coverage -fprofile-abs-path -g -O1
LDFLAGS: --coverage
CC: gcc-13
CXX: g++-13
run: cmake -S . -B build -D VCPKG_TARGET_TRIPLET=x64-linux --toolchain "${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
- name: Build
run: cmake --build build --parallel
- name: Execute
run: ctest --test-dir build
- uses: actions/upload-artifact@v3
with:
name: sample gcda
path: build/CMakeFiles/test_io1-money.dir/test/tutorial.cpp.gcda
- name: Create report
run: |
mkdir build/html
gcovr -v --gcov-executable /usr/bin/gcov-13 --filter include/io1/money.hpp --exclude-unreachable-branches --exclude-lines-by-pattern '.*assert.*' --print-summary -x build/coverage.xml --html-details build/html/index.html --html-details-syntax-highlighting -r . build
- uses: actions/upload-artifact@v3
with:
name: detailed coverage report
path: build/html
- uses: 5monkeys/cobertura-action@v13
with:
path: build/coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 84
fail_below_threshold: true
show_line: true
show_branch: true
show_missing: true