-
Notifications
You must be signed in to change notification settings - Fork 17
81 lines (71 loc) · 2.07 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
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: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
jobs:
Linux:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
name: Linux
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 10
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get -o Acquire::Retries=3 install \
lcov \
ccache
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV"
- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-Release-cache-${{ github.sha }}
restore-keys: ${{ runner.os }}-Release-cache
- name: Prepare ccache
run: |
ccache --max-size=1.0G
ccache -V && ccache --show-stats && ccache --zero-stats
- name: Configure
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DWMTK_CODE_COVERAGE=ON
- name: Build
run: cd build; make -j2; ccache --show-stats
- name: Run Coverage
run: |
cd build
ctest --verbose --output-on-failure
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '*tests/*.cpp' '*tests/*.hpp' --output-file coverage.info
- name: Upload Coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: wildmeshing # optional
files: coverage.info
name: wildmeshing # optional
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)