-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (111 loc) · 4.29 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
ubuntu-build:
strategy:
fail-fast: false
matrix:
build-type: [Debug, RelWithDebInfo, Release]
compiler: [{c: gcc-10, cpp: g++-10}, {c: gcc-11, cpp: g++-11, code-cov: true}, {c: clang-13, cpp: clang++-13}, {c: clang-14, cpp: clang++-14}, {c: clang-15, cpp: clang++-15}]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Get Conan
uses: turtlebrowser/[email protected]
with:
version: 1.59
- name: Create default profile
run: |
conan profile new default --detect
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DUSE_CLANG_TIDY=ON -DCODE_COVERAGE=${{ matrix.build-type == 'Debug' && matrix.compiler.code-cov }}
- name: Check compile commands
run: cat ${{ github.workspace }}/build/compile_commands.json
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
with:
os: ubuntu-latest
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build-type }} -j 3
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ matrix.build-type }} --output-on-failure
- name: Prepare Codecov
if: ${{ matrix.build-type == 'Debug' && matrix.compiler.code-cov }}
run: |
sudo apt-get install -y lcov
lcov --directory . --capture --output-file coverage.info --rc lcov_branch_coverage=1 # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1 # filter out system
lcov --remove coverage.info '/home/runner/.conan/*' --output-file coverage.info --rc lcov_branch_coverage=1 # filter out conan files
lcov --list coverage.info --rc lcov_branch_coverage=1 # debug info
- name: Codecov
if: ${{ matrix.build-type == 'Debug' && matrix.compiler.code-cov }}
uses: codecov/[email protected]
with:
files: coverage.info
fail_ci_if_error: true
verbose: true
macos-build:
strategy:
fail-fast: false
matrix:
build-type: [Debug, RelWithDebInfo, Release]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Select Python 3.10
# otherwise turtlebrowser/[email protected] fails on macos-12
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Get Conan
uses: turtlebrowser/[email protected]
with:
version: 1.59
- name: Create default profile
# M1 is not supported by all dependencies
run: |
conan profile new default --detect
conan profile update settings.arch=x86_64 default
conan profile update settings.arch_build=x86_64 default
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Check compile commands
run: cat ${{ github.workspace }}/build/compile_commands.json
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build-type }} -j 3
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ matrix.build-type }} --output-on-failure
windows-build:
strategy:
fail-fast: false
matrix:
build-type: [Debug, RelWithDebInfo, Release]
os: [windows-latest, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Get Conan
uses: turtlebrowser/[email protected]
with:
version: 1.59
- name: Create default profile
run: |
conan profile new default --detect
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build-type }} -j 3
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{ matrix.build-type }} --output-on-failure