-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (38 loc) · 1.17 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
name: coverage
on:
push:
branches:
- 'main'
- 'dev**'
pull_request:
branches:
- 'main'
env:
BUILD_TYPE: DEBUG
jobs:
coverage:
name: coverage
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup Dependencies
run: sudo apt-get install libelf-dev ninja-build gcovr
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMWR_BUILD_TESTS=ON -DMWR_COVERAGE=ON
- name: Build Project
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j $(nproc)
- name: Run Tests
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Generate Coverage Report
run: |
mkdir -p mwr-coverage-report
gcovr --html-details -f 'include/*' -f 'src/*' --output mwr-coverage-report/mwr.html --exclude-lines-by-pattern '\s*MWR_ERROR.*'
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: mwr-coverage-report
path: mwr-coverage-report/