forked from eclipse-openbsw/openbsw
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.32 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
43
44
45
name: Code Coverage Report
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
#Code coverage
- name: Install lcov
run: sudo apt install lcov
- name: Capture code coverage
run: lcov --capture --directory cmake-build-unit-tests --output-file cmake-build-unit-tests/coverage_unfiltered.info
- name: Filter out 3rd party and mock files
run: |
echo "Filtering out 3rd party and mock files from coverage data..."
lcov --remove cmake-build-unit-tests/coverage_unfiltered.info \
'*libs/3rdparty/googletest/*' \
'*/mock/*' \
'*/gmock/*' \
--output-file cmake-build-unit-tests/coverage.info
- name: Generate HTML coverage report
run: |
echo "Generating HTML coverage report..."
genhtml cmake-build-unit-tests/coverage.info \
--output-directory cmake-build-unit-tests/coverage
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: cmake-build-unit-tests/coverage
force_orphan: true