-
Notifications
You must be signed in to change notification settings - Fork 84
57 lines (47 loc) · 1.31 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
name: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: make
run: |
cmake -B build -DCMAKE_C_FLAGS="--coverage" && cmake --build build -j
- uses: sreimers/[email protected]
with:
name: rem
repo: https://github.com/baresip/rem
secret: ${{ secrets.GITHUB_TOKEN }}
working-directory: '../.'
- uses: sreimers/[email protected]
with:
name: retest
repo: https://github.com/baresip/retest.git
secret: ${{ secrets.GITHUB_TOKEN }}
working-directory: '../.'
- name: retest
run: |
cd ..
cmake -S rem -B rem/build && cmake --build rem/build
cd retest; cmake -B build -DCMAKE_EXE_LINKER_FLAGS="--coverage" && \
cmake --build build -j && ./build/retest -v -a
- name: gcov
run: |
cd ../re
gcov build/**/*.o
- name: install gcovr
run: |
pip install gcovr==5.0
- name: coverage check
run: |
min_cov="59.0"
cov=$(~/.local/bin/gcovr -r . -s | grep lines | awk '{ print $2 }' | sed 's/%//')
echo "Coverage: ${cov}% (min $min_cov%)"
exit $(echo "$cov < $min_cov" | bc -l)