-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·67 lines (61 loc) · 1.87 KB
/
coverage.yml
File metadata and controls
executable file
·67 lines (61 loc) · 1.87 KB
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: Run Test Suite
on:
push:
branches:
- master
- dev
jobs:
test_single_header:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: test_single_header
run: |
echo 'testing'
cd tests/
bash build_tests_for_single_header_flippy
cd cmake-build-default
./flippy_test
echo 'done testing'
test:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: install lcov
run: brew install lcov
- name: install gcovr
run: brew install gcovr
- name: test
run: |
echo 'testing'
cd tests/
bash build_tests
cd cmake-build-default
./flippy_test
cd ..
gcovr -r .. --exclude='.*external.*' --exclude=cmake --json-summary -o test_out.json
total=`jq .function_percent test_out.json`
if (( $(echo "$total <= 50" | bc -l) )) ; then
COLOR=red
elif (( $(echo "$total > 90" | bc -l) )); then
COLOR=green
else
COLOR=orange
fi
GIST_ID=2e1b636e9ff08fb7d0d5a8168bcf5613
GITHUB_PAT=${{ secrets.GITHUB_PAT }}
FILENAME="coverage.json"
CONTENT='{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\""${total}%"\",\"color\":\""${COLOR}"\"}'
curl -X POST "https://api.github.com/gists/$GIST_ID" \
-H "Authorization: token $GITHUB_PAT" \
-d "{
\"description\": \"Gist description\",
\"files\": {
\"$FILENAME\": {
\"content\": \"$CONTENT\"
}
}
}"
echo "done testing"