-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (38 loc) · 1.18 KB
/
cpp-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
name: CPP Coverage Report
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
build-and-test:
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
steps:
- name: checkout repo & submodules
uses: actions/checkout@v2
with:
submodules: true
- name: install tools
run: sudo apt install lcov
- name: make build directory
run: mkdir build_dir
- name: run unit tests with coverage
run: |
cmake ../cEpiabm/. -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
cmake --build . --parallel $(nproc) --target unit_tests
ctest -j2 --output-on-failure
working-directory: build_dir
- name: upload coverage results
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/test/*' '*/examples/*' '*/src/configuration/json.hpp' --output-file coverage.info
lcov --list coverage.info
bash <(curl https://codecov.io/bash) -f coverage.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
working-directory: build_dir