-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (72 loc) · 2.05 KB
/
test_cmake.yaml
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
82
83
84
85
86
87
---
name: CMake
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
cmake_build_type: RelOnHost
- platform: macos-latest
cmake_build_type: RelOnHost
- platform: windows-latest
cmake_build_type: Release
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: >
cmake
-DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}}
-S "${{github.workspace}}" -B "${{runner.workspace}}/bld"
- name: Build
run: >
cmake
--build "${{runner.workspace}}/bld"
--config ${{matrix.cmake_build_type}}
- name: Test
working-directory: ${{runner.workspace}}/bld
run: >
ctest
--timeout 10
-C ${{matrix.cmake_build_type}}
coverage:
runs-on: ubuntu-latest
env:
cmake_build_type: Debug
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: >
cmake
-DCMAKE_BUILD_TYPE=${{env.cmake_build_type}}
-DCMAKE_C_FLAGS="--coverage -Og"
-DCMAKE_CXX_FLAGS="--coverage -Og"
-DCMAKE_EXE_LINKER_FLAGS="--coverage -Og"
-S "${{github.workspace}}" -B "${{runner.workspace}}/bld"
- name: Build
run: >
cmake
--build "${{runner.workspace}}/bld"
--config ${{env.cmake_build_type}}
- name: Test
working-directory: ${{runner.workspace}}/bld
run: >
ctest
--timeout 10
-C ${{env.cmake_build_type}}
- name: LCOV
uses: imciner2/run-lcov@v1
with:
input_directory: "${{runner.workspace}}/bld/"
exclude: '"/usr/*" "${{runner.workspace}}/bld/_deps/*"'
output_file: "${{runner.workspace}}/bld/coverage_report.info"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "${{runner.workspace}}/bld/coverage_report.info"