-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (38 loc) · 1.16 KB
/
ci.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: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up CMake
run: sudo apt-get install cmake lcov
- name: Configure with CMake
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
- name: Build
run: cmake --build build
- name: Run Tests
run: ctest --test-dir build
- name: Capture Coverage Info
run: |
cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # Remove coverage for system files.
lcov --list coverage.info # Optional: Display coverage info
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
codecov_yml_path: .github/codecov.yml