-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (42 loc) · 1.28 KB
/
c-cpp.yml
File metadata and controls
53 lines (42 loc) · 1.28 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
BUILD_TYPE: Release
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
BUILD_TYPE: Debug
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake lcov
sudo apt-get install -y libgtest-dev googletest
- name: Configure CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -fprofile-update=atomic -O0"
- name: Build
run: cmake --build build --clean-first
- name: Run Tests
working-directory: ./build
run: ./test/flexitimerTest
- name: Generate Coverage Report
run: |
lcov --capture --directory ./build --output-file coverage.info \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors mismatch,negative
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info || true # Prevent failure on warnings
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.info
fail_ci_if_error: false