-
-
Notifications
You must be signed in to change notification settings - Fork 108
454 lines (442 loc) · 13 KB
/
test.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
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- 'master'
- 'stable/**'
jobs:
# test:
# name: Test Corrosion
# runs-on: ${{ matrix.os }}
# continue-on-error: ${{ matrix.rust == 'nightly' }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - windows-2022
# - ubuntu-latest
# - macos-13
# arch:
# - x86_64
# - i686
# - aarch64
# - powerpc64le
# abi:
# - gnu
# - darwin
# - msvc
# cmake:
# - 3.22.6
# rust:
# - "stable"
# generator:
# - default # This is just whatever the platform default is
# - ninja
# compiler: [default]
# include:
# - rust: nightly
# cmake: 3.22.6
# generator: ninja
# arch: x86_64
# abi: msvc
# os: windows-2022
# - rust: nightly
# cmake: 3.22.6
# generator: ninja
# arch: x86_64
# abi: gnu
# os: ubuntu-latest
# - rust: nightly
# cmake: 3.22.6
# generator: ninja
# arch: x86_64
# abi: darwin
# os: macos-13
# - rust: 1.54
# cmake: 3.22.6
# generator: ninja
# arch: x86_64
# abi: msvc
# os: windows-2019
# compiler: clang
# - os: ubuntu-latest
# arch: x86_64
# abi: gnu
# cmake: 3.22.6
# rust: 1.54
# generator: ninja-multiconfig
#
# exclude:
#
# # We have a separate test Matrix for the Visual Studio Generator
# - os: windows-2022
# generator: default # Default generator is Visual Studio
#
# # ARCH
# - os: windows-2022
# arch: i686
# abi: gnu
# - os: windows-2022
# arch: aarch64
# abi: gnu
# - os: windows-2022
# arch: i686
# generator: ninja
# - os: windows-2022
# arch: aarch64
# generator: ninja
# - os: windows-2022
# arch: powerpc64le
# - os: macos-13
# arch: i686
# - os: macos-13
# arch: aarch64
# - os: macos-13
# arch: powerpc64le
#
# # ABI
# - os: ubuntu-latest
# abi: msvc
# - os: ubuntu-latest
# abi: darwin
# - os: windows-2022
# abi: darwin
# - os: macos-13
# abi: msvc
# - os: macos-13
# abi: gnu
#
# steps:
# - uses: actions/checkout@v4
# - name: Setup Environment and Configure CMake
# uses: "./.github/actions/setup_test"
# with:
# target_arch: ${{matrix.arch}}
# abi: ${{matrix.abi}}
# cmake: ${{matrix.cmake}}
# rust: ${{matrix.rust}}
# generator: ${{matrix.generator}}
# build_dir: build
# compiler: ${{matrix.compiler}}
# - name: Run Tests
# id: run_tests
# working-directory: build
# run: ctest --output-on-failure --build-config Debug -j 3
test_msvc:
name: Test Windows Visual Studio
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
arch:
- x86_64
- i686
- aarch64
include:
- os: windows-2019
vs_version: vs-2019
cmake: 3.22.6
- os: windows-2022
vs_version: vs-2022
cmake: 3.22.6
- rust: 1.54.0
# Override rust version for x86_64
- arch: x86_64
rust: 1.46.0
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: corrosion-rs/install-cmake@v2
with:
cmake: ${{ matrix.cmake }}
ninja: 1.10.0
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-msvc
# The initial configure for MSVC is quite slow, so we cache the build directory
# (including the build directories of the tests) since reconfiguring is
# significantly faster.
- name: Cache MSVC build directory
id: cache-msvc-builddir
uses: actions/cache@v3
with:
path: build
key: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.rust }}-msvc-build
- name: New configure
run: cmake -S. -Bbuild -DCORROSION_TESTS_KEEP_BUILDDIRS=ON "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.vs_version }}-${{ matrix.arch }}"
- name: Run Tests
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3
windows_ninja_cl:
name: Test Windows Ninja MSVC
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
arch:
- x86_64
- i686
- aarch64
compiler:
- cl
- clang-cl
include:
- os: windows-2022
vs_version: vs-2022
cmake: 3.22.6
- rust: 1.54.0
# Override rust version for x86_64
- arch: x86_64
rust: 1.46.0
# Add variable mapping for ilammy/msvc-dev-cmd action
- arch: x86_64
msvc_dev_arch: amd64
- arch: i686
msvc_dev_arch: amd64_x86
- arch: aarch64
msvc_dev_arch: amd64_arm64
exclude:
# Not sure what parameters CMake needs when cross-compiling with clang-cl, so exclude for now
- compiler: clang-cl
arch: i686
- compiler: clang-cl
arch: aarch64
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: corrosion-rs/install-cmake@v2
with:
cmake: ${{ matrix.cmake }}
ninja: 1.10.0
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-msvc
- name: Setup MSVC Development Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_dev_arch }}
- name: New configure
run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "ninja-${{ matrix.arch }}-pc-windows-msvc-${{ matrix.compiler }}"
- name: Run Tests
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3
windows_gnu:
name: Test Windows GNU
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
arch:
- x86_64
# - i686
# - aarch64
compiler:
- gcc # Clang only has experimental support for Cygwin / MinGW, so we don't test it
generator:
- ninja
- make
include:
- cmake: 3.22.6
- rust: 1.54.0
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: corrosion-rs/install-cmake@v2
with:
cmake: ${{ matrix.cmake }}
ninja: 1.10.0
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-gnu
- name: New configure
run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.generator }}-${{ matrix.arch }}-pc-windows-gnu-${{ matrix.compiler }}"
- name: Run Tests
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3
linux: # todo: could probably be merged into one action with windows-gnu
name: Test Linux
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
arch:
- x86_64
- i686
- aarch64
compiler:
- gcc
- clang
generator:
- "Ninja"
- "Unix Makefiles"
include:
- cmake: 3.22.6
- rust: 1.54.0
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: corrosion-rs/install-cmake@v2
with:
cmake: ${{ matrix.cmake }}
ninja: 1.10.0
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-unknown-linux-gnu
- name: Install Cross Compiler
shell: bash
run: |
if [[ "${{ matrix.arch }}" != 'x86_64' ]]; then
echo "::group::apt-install"
sudo apt-get update
sudo apt-get install -y "g++-${{matrix.arch}}-linux-gnu"
echo "::endgroup::"
fi
if: ${{ 'Linux' == runner.os }}
- name: New configure
run: cmake -S. -Bbuild -G "${{ matrix.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.generator }}-${{ matrix.arch }}-unknown-linux-gnu-${{ matrix.compiler }}"
- name: Run Tests
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3
# test_cxxbridge:
# name: Test cxxbridge integration
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - windows-2022
# - ubuntu-latest
# - macos-13
# include:
# - abi: default
# # - os: windows-2019
# # abi: gnu
# steps:
# - uses: actions/checkout@v4
# - uses: actions/cache@v3
# id: cache_cxxbridge
# with:
# path: "~/.cargo/bin/cxxbridge*"
# key: ${{ runner.os }}-cxxbridge_1_0_86
# - name: Install cxxbridge
# if: steps.cache_cxxbridge.outputs.cache-hit != 'true'
# run: cargo install [email protected]
# - name: Install lld
# run: sudo apt update && sudo apt install -y lld
# if: ${{ 'Linux' == runner.os }}
# - name: Setup Environment and Configure CMake
# uses: "./.github/actions/setup_test"
# with:
# target_arch: x86_64
# cmake: 3.22.6
# rust: stable minus 2 releases
# abi: ${{ matrix.abi }}
# generator: ninja
# build_dir: build
# configure_params: -DCORROSION_TESTS_CXXBRIDGE=ON
# - name: Run Tests
# working-directory: build
# run: ctest --output-on-failure --build-config Debug -j 3 -R "^cxxbridge"
# install:
# name: Test Corrosion as a Library
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - windows-2019
# - ubuntu-latest
# - macos-13
# include:
# - rust: 1.46.0
# - os: macos-13
# rust: 1.54.0 # On MacOS-12 linking fails before Rust 1.54
# steps:
# - uses: actions/checkout@v3
# - name: Setup MSVC Development Environment
# uses: ilammy/msvc-dev-cmd@v1
# if: runner.os == 'Windows'
# - name: Install CMake
# uses: corrosion-rs/install-cmake@v2
# with:
# cmake: 3.22.6
# ninja: 1.10.0
# - name: Install Rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{matrix.rust}}
# - name: CMake Version
# run: cmake --version
# - name: Rust Version
# run: rustc --version
# - name: Test Corrosion as subdirectory
# run: >
# cmake
# -S.
# -Bbuild
# -GNinja
# -DCORROSION_VERBOSE_OUTPUT=ON
# -DCORROSION_TESTS_INSTALL_CORROSION=OFF
# &&
# cd build
# &&
# ctest --output-on-failure -C Debug -j 3
# - name: Test Corrosion as installed module
# run: >
# cmake -E remove_directory build
# &&
# cmake
# -S.
# -Bbuild
# -GNinja
# -DCORROSION_VERBOSE_OUTPUT=ON
# -DCMAKE_BUILD_TYPE=Release
# -DCORROSION_TESTS_INSTALL_CORROSION=ON
# &&
# cd build
# &&
# ctest --output-on-failure -C Release -j 3
# We want an "accumulation" job here because it is easier to specify required
# jobs here via needs, then in the github UI, since we use matrix jobs.
ci-success:
name: bors-ci-status
if: ${{ always() }}
needs:
# - test
- test_msvc
# - test_cxxbridge
# - install
runs-on: ubuntu-latest
# Step copied from: https://github.com/cross-rs/cross/blob/80c9f9109a719ffb0f694060ddc6e371d5b3a540/.github/workflows/ci.yml#L361
steps:
- name: Result
run: |
jq -C <<< "${needs}"
# Check if all needs were successful or skipped.
"$(jq -r 'all(.result as $result | (["success", "skipped"] | contains([$result])))' <<< "${needs}")"
env:
needs: ${{ toJson(needs) }}