-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.18 KB
/
cmake.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
name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
build_type: [Release, Debug]
runs-on: ubuntu-latest
env:
BUILD_DIR: ${{github.workspace}}/build/${{matrix.build_type}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
run: cmake -B ${{env.BUILD_DIR}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}}
- name: Test
working-directory: ${{env.BUILD_DIR}}
run: ctest -C ${{env.BUILD_TYPE}}
- name: Generate coverage report
if: ${{matrix.build_type == 'Debug'}}
working-directory: ${{github.workspace}}
run: |
sudo apt-get install lcov
lcov --base-directory . --directory ${{env.BUILD_DIR}} -c -o coverage.info
lcov --remove coverage.info "test/*" -o coverage.info
- name: Upload coverage to Codecov
if: ${{matrix.build_type == 'Debug'}}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
files: coverage.info