-
Notifications
You must be signed in to change notification settings - Fork 175
38 lines (35 loc) · 1.03 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
name: Coverage
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
coverage:
runs-on: ubuntu-20.04
steps:
- name: Install LCOV
run: sudo apt install -y lcov
- uses: actions/checkout@v3
- name: Build project
env:
CC: gcc-9
CXX: g++-9
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DENABLE_COVERAGE=ON
cmake --build build -j
- name: Run tests
run: |
ctest --test-dir build/ --verbose
- name: Generate report
run: |
cd build/tests/CMakeFiles/FakeIt_tests.dir
gcov-9 *.o
lcov --gcov-tool gcov-9 --directory . -c -o report.info
lcov --gcov-tool gcov-9 --remove report.info '/usr/*' '*/tests/*' -o report_filtered.info
- name: Upload report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./build/tests/CMakeFiles/FakeIt_tests.dir/report_filtered.info