forked from speeduino/speeduino
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 2.4 KB
/
code-coverage.yml
File metadata and controls
81 lines (69 loc) · 2.4 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Generate code coverage reports
on:
- push
- pull_request
- workflow_dispatch
jobs:
code-coverage:
runs-on: ubuntu-latest
env:
PIO_ENV: native_code_coverage
FILE_ROOT: speeduino_coverage
GCOV_IGNORES: |
test/
lib/ArduinoFake/
.pio/libdeps/
speeduino/src/SPIAsEEPROM/
(.+/)?unity_config\.c$
(.+/)?board_native\.(?:h|cpp)$
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: 'pip' # Enables caching for dependencies
- name: Create Python venv
run: |
sudo apt-get install python3-venv
python3 -m venv PIO
- name: Install PlatformIO
run: |
source PIO/bin/activate
pip install platformio
- name: Run Code Coverage Tests
# We want the coverage to reflect the status of the
# unit tests: so even if the tests fail or outright
# crash, continue the rest of the workflow.
continue-on-error: true
run: |
source PIO/bin/activate
platformio test -e ${{ env.PIO_ENV }} ${{ vars.PIO_CMD_PARAMS }}
- name: Upload to CodeCov
uses: codecov/codecov-action@v5
if: ${{ !env.ACT }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_ignore: ${{ env.GCOV_IGNORES }}
# verbose: true
- name: Generate coverage report
if: ${{ env.ACT }}
uses: threeal/gcovr-action@v1.2.0
with:
coveralls-send: false
print-summary: true
excludes: ${{ env.GCOV_IGNORES }}
html-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.html
html-details: true
coveralls-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.coveralls
cobertura-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.cobertura
xml-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.xml
jacoco-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.jacoco
json-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.json
lcov-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.lcov
sonarqube-out: .pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.sonarqube
- name: Upload reports
if: ${{ env.ACT }}
uses: actions/upload-artifact@v4
with:
path: |
.pio/build/${{ env.PIO_ENV }}/${{ env.FILE_ROOT }}.*