-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.92 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
name: code coverage
on: [push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Get latest cmake
uses: lukka/get-cmake@latest
- name: Configure
shell: cmake -P {0}
run: |
set(vcpkg_triplet x64-linux)
set(compiler_flags "--coverage -g -O0")
set(linker_flags "--coverage")
set(ENV{CC} "gcc-13")
set(ENV{CXX} "g++-13")
execute_process(
COMMAND cmake
-S .
-B build
-D VCPKG_TARGET_TRIPLET=${vcpkg_triplet}
-D "CMAKE_CXX_FLAGS=${compiler_flags}"
-D "CMAKE_LD_FLAGS=${linker_flags}"
--toolchain "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: Build
run: cmake --build build --parallel
- name: Execute
run: cmake --build build --target test
- name: Install gcovr
run: |
sudo apt-get update
sudo apt-get install -yq gcovr
sudo apt-get clean
- name: Create report
run: |
mkdir html
gcovr --filter include/io1/money.hpp --exclude-unreachable-branches --exclude-lines-by-pattern '.*assert.*' --print-summary -x coverage.xml --html-details html/index.html --html-details-syntax-highlighting -r . build
- uses: 5monkeys/cobertura-action@v13
with:
path: coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 84
fail_below_threshold: true
show_line: true
show_branch: true
show_missing: true
- uses: actions/upload-artifact@v3
with:
name: detailed coverage report
path: html