-
Notifications
You must be signed in to change notification settings - Fork 83
64 lines (51 loc) · 1.35 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
name: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
coverage:
runs-on: ubuntu-latest
env:
CMAKE_GENERATOR: Ninja
steps:
- uses: actions/checkout@v4
- name: fix flaky azure mirrors
if: ${{ runner.os == 'Linux' }}
run: |
sudo sed -i 's/azure\./de\./' /etc/apt/sources.list
- name: install packages
run: |
sudo apt-get update && sudo apt-get install -y ninja-build
- name: make
run: |
cmake -B build -DCMAKE_C_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage" -DUSE_TRACE=ON
cmake --build build -j -t retest
- name: retest
run: |
./build/test/retest -a -v
./build/test/retest -r -m select -v
- name: gcov
run: |
gcov build/**/*.o
- name: install gcovr
run: |
pip install gcovr==5.0
- name: coverage check
run: |
min_cov="64.6"
mkdir html
cov=$(~/.local/bin/gcovr -r . --html-details html/index.html --json-summary | jq .line_percent)
echo "Coverage: ${cov}% (min $min_cov%)"
exit $(echo "$cov < $min_cov" | bc -l)
- name: coverage zip
run: |
zip -r coverage.zip html
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.zip
retention-days: 7