-
Notifications
You must be signed in to change notification settings - Fork 352
404 lines (344 loc) · 10.6 KB
/
tests.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
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
name: Tests
on:
push:
branches:
- main
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CTEST_OUTPUT_ON_FAILURE: "1"
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
matrix:
std: ["11", "14", "17", "20"]
precompile: ["ON", "OFF"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get LCov
run: |
wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz
tar -xzf lcov-1.16.tar.gz
cd lcov-1.16
sudo make install
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCLI11_SINGLE_FILE_TESTS=OFF \
-DCLI11_BUILD_EXAMPLES=OFF \
-DCLI11_PRECOMPILED=${{matrix.precompile}} \
-DCMAKE_BUILD_TYPE=Coverage
- name: Build
run: cmake --build build -j4
- name: Test
run: cmake --build build --target CLI11_coverage
- name: Prepare coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' '*/book/*' '*/fuzz/*' --output-file coverage.info
lcov --list coverage.info
working-directory: build
- uses: codecov/codecov-action@v4
with:
files: build/coverage.info
functionalities: fixes
catch2-3:
name: Catch 2 3.x
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Get Catch 2
run: brew install catch2
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=14 \
-DCLI11_SINGLE_FILE_TESTS=OFF \
-DCLI11_BUILD_EXAMPLES=OFF \
-DCLI11_PRECOMPILED=ON
- name: Build
run: cmake --build build -j4
- name: Test
run: cmake --build build --target test
clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-latest
container: silkeh/clang:17
steps:
- uses: actions/checkout@v4
- name: Configure
run: >
cmake -S . -B build -DCMAKE_CXX_STANDARD=17
-DCMAKE_CXX_CLANG_TIDY="$(which
clang-tidy);--use-color;--warnings-as-errors=*"
- name: Build
run: cmake --build build -j4 -- --keep-going
cuda11-build:
name: CUDA 11 build only
runs-on: ubuntu-latest
container: nvidia/cuda:11.8.0-devel-ubuntu22.04
steps:
- name: Add build tools
run: apt-get update && apt-get install -y wget git cmake
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build -j2
cuda12-build:
name: CUDA 12 build only
runs-on: ubuntu-latest
container: nvidia/cuda:12.3.1-devel-ubuntu22.04
steps:
- name: Add build tools
run: apt-get update && apt-get install -y wget git cmake
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DCLI11_CUDA_TESTS=ON
- name: Build
run: cmake --build build -j2
boost-build:
name: Boost build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Add boost
run: sudo apt-get update && sudo apt-get install -y libboost-dev
# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
- name: Configure
run: cmake -S . -B build -DCLI11_BOOST=ON
- name: Build
run: cmake --build build -j2
- name: Run tests
run: ctest --output-on-failure
working-directory: build
meson-build:
name: Meson build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare commands
run: |
pipx install meson
pipx install ninja
- name: Configure
run: meson setup build-meson . -Dtests=true
- name: Build
run: meson compile -C build-meson
- name: Test
run: meson test -C build-meson
bazel-build:
name: Bazel build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: bazel build //...
- name: Test
run: bazel test --test_output=errors //...
install:
name: install tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DCLI11_INSTALL_PACKAGE_TESTS=ON -DCMAKE_INSTALL_PREFIX=/home/runner/work/install
- name: Build
run: cmake --build build -j2
- name: install
run: cmake --install build
- name: Run tests
run: ctest --output-on-failure -L Packaging
working-directory: build
install-precompiled:
name: install tests precompiled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DCLI11_INSTALL_PACKAGE_TESTS=ON -DCMAKE_INSTALL_PREFIX=/home/runner/work/install -DCLI11_PRECOMPILED=ON
- name: Build
run: cmake --build build -j2
- name: install
run: cmake --install build
- name: Run tests
run: ctest --output-on-failure -L Packaging
working-directory: build
install-single_file:
name: install tests single file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -S . -B build -DCLI11_INSTALL_PACKAGE_TESTS=ON -DCMAKE_INSTALL_PREFIX=/home/runner/work/install -DCLI11_SINGLE_FILE=ON
- name: Build
run: cmake --build build -j2
- name: install
run: cmake --install build
- name: Run tests
run: ctest --output-on-failure -L Packaging
working-directory: build
cmake-config-ubuntu-2004:
name: CMake config check (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Check CMake 3.5
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.5"
if: success() || failure()
- name: Check CMake 3.6
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.6"
if: success() || failure()
- name: Check CMake 3.7
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.7"
if: success() || failure()
- name: Check CMake 3.8
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.8"
if: success() || failure()
- name: Check CMake 3.9
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.9"
if: success() || failure()
- name: Check CMake 3.10
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.10"
if: success() || failure()
- name: Check CMake 3.11
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.11"
if: success() || failure()
- name: Check CMake 3.12
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.12"
if: success() || failure()
- name: Check CMake 3.13
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.13"
if: success() || failure()
- name: Check CMake 3.14.7
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.14.7"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()
- name: Check CMake 3.15
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.15"
if: success() || failure()
- name: Check CMake 3.16
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.16"
if: success() || failure()
cmake-config-ubuntu-2204:
name: CMake config check (Ubuntu 22.04)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check CMake 3.17
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.17"
if: success() || failure()
- name: Check CMake 3.18
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.18"
if: success() || failure()
- name: Check CMake 3.19
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.19"
if: success() || failure()
- name: Check CMake 3.20
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.20"
if: success() || failure()
- name: Check CMake 3.21
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.21"
if: success() || failure()
- name: Check CMake 3.22
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.22"
if: success() || failure()
- name: Check CMake 3.23
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.23"
if: success() || failure()
- name: Check CMake 3.24
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.24"
if: success() || failure()
- name: Check CMake 3.25
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.25"
if: success() || failure()
- name: Check CMake 3.26 (full)
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.26"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()
- name: Check CMake 3.27
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.27"
if: success() || failure()
- name: Check CMake 3.28 (full)
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.28.X"
args: -DCLI11_SANITIZERS=ON -DCLI11_BUILD_EXAMPLES_JSON=ON
if: success() || failure()
- name: Check CMake 3.29
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.29"
if: success() || failure()
- name: Check CMake 3.30
uses: ./.github/actions/quick_cmake
with:
cmake-version: "3.30"
if: success() || failure()