-
Notifications
You must be signed in to change notification settings - Fork 21
42 lines (38 loc) · 1.2 KB
/
code_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
---
# This workflow will determine the code coverage of a standard gbsplay build and upload it to CodeCov.io
name: Code Coverage
on:
push:
pull_request:
types: [opened]
jobs:
coverage-linux:
name: Code Coverage under Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libasound2-dev libpulse-dev libaudio-dev
- name: Build impulsegen
# this builds impulsegen without coverage - LDFLAGS are not honored during build, so it would fail otherwise :/
run: |
./configure
make impulse.h
- name: Build with coverage
# this builds gbsplay with coverage enabled with GCC
env:
CFLAGS: '-O0 -coverage'
LDFLAGS: '-lgcov -coverage'
run: |
./configure
make gbsplay
- name: Test with coverage
# run the test under coverage
run: |
./gbsplay -c examples/gbsplayrc_sample -E b -o stdout examples/nightmode.gbs >/dev/null
gcov *.o
- name: Upload coverage to Codecov
# upload to codecov.io
uses: codecov/codecov-action@v3