-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (39 loc) · 1.37 KB
/
cmake_test.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
name: Run tests on Ubuntu
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: COVERAGE
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Update apt repo
run: sudo apt-get update
- name: Install tools manually
run: sudo apt install lcov gcovr libtbb-dev
- uses: actions/checkout@v4
- name: Configure CMake
working-directory: ${{github.workspace}}/test
run: cmake -DTEST=ON -DCODE_COVERAGE=ON -B ${{github.workspace}}/test/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
working-directory: ${{github.workspace}}/test
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/test/build --config ${{env.BUILD_TYPE}}
- name: Run tests
working-directory: ${{github.workspace}}/test
run: ./dsm_tests.out
- name: create Report
working-directory: ${{github.workspace}}/test
run: lcov --capture --directory .. --output-file coverage.xml
- uses: codecov/codecov-action@v4.5.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{github.workspace}}/test/coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)