-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 890 Bytes
/
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
name: Code Coverage
# Run it when you push to all branches
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build binary files
run: |
make build
coverage:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install gcov
run: |
if ! command -v gcov &>/dev/null; then
echo "gcov is not installed. Installing..."
sudo apt-get update
sudo apt-get install -y gcov
fi
echo "gcov is installed."
- name: Generate Coverage
run: |
COVERAGE=$(make coverage | grep 'TOTAL COVERAGE' | grep -Eo '[0-9]+')
if [ "$COVERAGE" -gt 89 ]; then
echo "success"
else
echo "failure"
fi