forked from andreasbuhr/cppcoro
-
Notifications
You must be signed in to change notification settings - Fork 1
372 lines (354 loc) · 12.2 KB
/
cmake.yml
File metadata and controls
372 lines (354 loc) · 12.2 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
name: CMake
on: [push, pull_request]
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Linux g++ 10.2 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "g++-10",
cxxver: 17,
}
- {
name: "Linux g++ 10.2 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "g++-10",
cxxver: 20,
}
- {
name: "Linux g++ 11 C++17 Debug",
os: ubuntu-20.04,
buildtype: Debug,
cxx: "g++-11",
cxxver: 17,
}
- {
name: "Linux g++ 11 C++20 Debug",
os: ubuntu-20.04,
buildtype: Release,
cxx: "g++-11",
cxxver: 20,
}
- {
name: "Linux g++ 11 C++17",
os: ubuntu-20.04,
buildtype: Debug,
cxx: "g++-11",
cxxver: 17,
}
- {
name: "Linux g++ 11 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "g++-11",
cxxver: 20,
}
- {
name: "Linux clang-10 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-10",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-10 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-10",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-11 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-11",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-11 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-11",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-12 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-12",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-12 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-12",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-13 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-13",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-13 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-13",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-14 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-14",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-14 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-14",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-15 C++17 Debug",
os: ubuntu-20.04,
buildtype: Debug,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-15 C++20 Debug",
os: ubuntu-20.04,
buildtype: Debug,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Linux clang-15 C++17",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 17,
}
- {
name: "Linux clang-15 C++20",
os: ubuntu-20.04,
buildtype: Release,
cxx: "clang++-15",
cxx_flags: -stdlib=libc++,
exe_linker_flags: -lc++,
cxxver: 20,
}
- {
name: "Windows MSVC 2017 (x64) C++17",
os: windows-2019,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 17,
msvcver: 2017,
}
- {
name: "Windows MSVC 2017 (x64) C++20",
os: windows-2019,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 20,
msvcver: 2017,
}
- {
name: "Windows MSVC 2019 (x64) C++17",
os: windows-2019,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 17,
}
- {
name: "Windows MSVC 2019 (x64) C++20",
os: windows-2019,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 20,
}
- {
name: "Windows MSVC 2022 (x64) C++17",
os: windows-2022,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 17,
}
- {
name: "Windows MSVC 2022 (x64) C++20",
os: windows-2022,
buildtype: Release,
cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxxver: 20,
}
steps:
- uses: actions/checkout@v2
- name: Install Clang 10
id: install_clang_10
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-10' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 10
sudo apt-get install libc++-10-dev libc++abi-10-dev
- name: Install Clang 11
id: install_clang_11
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-11' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
sudo apt-get install libc++-11-dev libc++abi-11-dev
- name: Install Clang 12
id: install_clang_12
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-12' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
sudo apt-get install libc++-12-dev libc++abi-12-dev libunwind-12-dev
- name: Install Clang 13
id: install_clang_13
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-13' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 13
sudo apt-get install libc++-13-dev libc++abi-13-dev libunwind-13-dev
- name: Install Clang 14
id: install_clang_14
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-14' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo apt-get install libc++-14-dev libc++abi-14-dev libunwind-14-dev
- name: Install Clang 15
id: install_clang_15
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-15' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo apt-get install libc++-15-dev libc++abi-15-dev libunwind-15-dev
- name: Install g++ 10
id: install_gcc_10
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-10' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get install g++-10
- name: Install g++ 11
id: install_gcc_11
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-11' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt-get install g++-11
- name: Install MSVC 2017
id: install_msvc_2017
if: startsWith(matrix.config.os, 'windows-2019') && ( matrix.config.cxx == 'cl' ) && ( matrix.config.msvcver == 2017 )
shell: bash
working-directory: ${{ env.HOME }}
run: |
choco install visualstudio2017community
choco install visualstudio2017-workload-nativedesktop
choco install visualstudio2017-workload-vctools
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{ matrix.config.cxx }}
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
# run environment setup script if any
[ -n "${{ matrix.config.environment_script }}" ] && "${{ matrix.config.environment_script }}"
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{ matrix.config.buildtype }} \
-DCMAKE_CXX_STANDARD=${{ matrix.config.cxxver }} \
-DBUILD_TESTING=ON \
-DCMAKE_CXX_FLAGS=${{ matrix.config.cxx_flags }} \
-DCMAKE_EXE_LINKER_FLAGS=${{ matrix.config.exe_linker_flags }} \
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.config.buildtype }}
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --output-on-failure -C ${{ matrix.config.buildtype }}