-
Notifications
You must be signed in to change notification settings - Fork 44
64 lines (53 loc) · 1.51 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 Report
on:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: submodules
run: git submodule update --init util ast
- name: make
env:
CFLAGS: -ftest-coverage -fprofile-arcs
LDFLAGS: -ftest-coverage -fprofile-arcs
run: make
- name: Tests
env:
VALGRIND: NO_VALGRIND
USE_MEMCHECK: 0
SEVERITY: 3
run: export GWION_TEST_DIR=${{ runner.tmp }}/tmp/test; mkdir $GWION_TEST_DIR && make test
- name: Install gcovr
run: |
pip install git+https://github.com/gcovr/gcovr.git
- name: Generate Report
run: |
COV_TXT=$(gcovr -s --html-details cov.html --filter '.*\.c$' src ast util | grep lines | cut -d" " -f2)
COV_NUM=${COV_TXT: : -1}
if [ $COV_NUM -ge 90 ]
then COLOR=green
elif [ $COV_NUM -ge 90 ]
then COLOR=yellow
else COLOR=red
fi
wget https://badgen.net/badge/coverage/$COV_TXT/$COLOR -O badge.svg
echo $COV_NUM $COLOR
ls
- name: Push Report
run: |
git clone https://github.com/fennecdjay/gwion-coverage-report
cd gwion-coverage-report
rm -f *.html
cp ../*.html .
cp ../badge.svg .
mv cov.html index.html
ls
cat index.html