-
-
Notifications
You must be signed in to change notification settings - Fork 112
356 lines (342 loc) · 9.77 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
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- 'master'
- 'stable/**'
jobs:
test_legacy_linux:
name: Test Corrosion (CMake 3.15)
uses: ./.github/workflows/test_legacy.yaml
with :
os: ubuntu-20.04
rust: 1.46.0
test_legacy_mac:
name: Test Corrosion (CMake 3.15)
uses: ./.github/workflows/test_legacy.yaml
with:
os: macos-12
rust: 1.54.0
test_legacy_windows:
name: Test Corrosion (CMake 3.15)
uses: ./.github/workflows/test_legacy.yaml
with:
os: windows-2019
rust: 1.46.0
test_legacy_stable:
name: Legacy CMake + stable Rust
uses: ./.github/workflows/test_legacy.yaml
strategy:
fail-fast: false
matrix:
os:
- windows-2019 # windows-latest is currently not having a supported MSVC compiler
- ubuntu-20.04
- macos-12
with:
os: ${{ matrix.os }}
rust: stable
test_legacy_nightly:
name: Legacy CMake + nightly Rust
uses: ./.github/workflows/test_legacy.yaml
with:
os: ubuntu-20.04
rust: nightly
test_legacy_new_lockfile_msrv:
name: Test MSRV of the new lockfile
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install Rust
id: install_rust
uses: dtolnay/[email protected]
- name: Test Generator build with MSRV
run: cargo build
working-directory: generator
test:
name: Test Corrosion
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019 # windows-latest is currently not having a supported MSVC compiler
- ubuntu-latest
- macos-12
arch:
- x86_64
- i686
- aarch64
- powerpc64le
abi:
- gnu
- darwin
- msvc
cmake:
- 3.19.0
rust:
# Our MSRV is already tested with the legacy generator, so just test the current stable rust here.
- stable
generator:
- default # This is just whatever the platform default is
- ninja
compiler: [default]
include:
- rust: nightly
cmake: 3.19.0
generator: ninja
arch: x86_64
abi: msvc
os: windows-2019
- rust: nightly
cmake: 3.19.0
generator: ninja
arch: x86_64
abi: gnu
os: ubuntu-latest
- rust: nightly
cmake: 3.19.0
generator: ninja
arch: x86_64
abi: darwin
os: macos-12
- rust: 1.54
cmake: 3.19.0
generator: ninja
arch: x86_64
abi: msvc
os: windows-2019
compiler: clang
- os: ubuntu-latest
arch: x86_64
abi: gnu
cmake: 3.20.0
rust: 1.54
generator: ninja-multiconfig
exclude:
# We have a separate test Matrix for the Visual Studio Generator
- os: windows-2019
generator: default # Default generator is Visual Studio
# ARCH
- os: windows-2019
arch: i686
abi: gnu
- os: windows-2019
arch: aarch64
abi: gnu
- os: windows-2019
arch: i686
generator: ninja
- os: windows-2019
arch: aarch64
generator: ninja
- os: windows-2019
arch: powerpc64le
- os: macos-12
arch: i686
- os: macos-12
arch: aarch64
- os: macos-12
arch: powerpc64le
# ABI
- os: ubuntu-latest
abi: msvc
- os: ubuntu-latest
abi: darwin
- os: windows-2019
abi: darwin
- os: macos-12
abi: msvc
- os: macos-12
abi: gnu
steps:
- uses: actions/checkout@v3
- 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 MSVC Generator
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
arch:
- x86_64
- i686
- aarch64
include:
- rust: 1.54.0
# Override rust version for x86_64
- arch: x86_64
rust: 1.46.0
- os: windows-2019
cmake: 3.20.6 # Multi-config Generators require at least CMake 3.20
- os: windows-2022
cmake: 3.21.5 # VS on windows-2022 requires at least CMake 3.21
steps:
- uses: actions/checkout@v3
# 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: Setup Environment and Configure CMake
uses: "./.github/actions/setup_test"
with:
target_arch: ${{matrix.arch}}
abi: msvc
cmake: ${{matrix.cmake}}
rust: ${{matrix.rust}}
generator: default
build_dir: build
configure_params: "-DCORROSION_TESTS_KEEP_BUILDDIRS=ON"
- 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-2019
- ubuntu-latest
- macos-12
include:
- abi: default
# - os: windows-2019
# abi: gnu
steps:
- uses: actions/checkout@v3
- 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.15.7
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-12
include:
- rust: 1.46.0
- os: macos-12
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.18.0
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 need some "accumulation" job here because bors fails (timeouts) to
# listen on matrix builds.
# Hence, we have some kind of dummy here that bors can listen on
ci-success:
name: bors-ci-status
if: ${{ always() }}
needs:
- test_legacy_linux
- test_legacy_mac
- test_legacy_windows
- test_legacy_stable
- test_legacy_new_lockfile_msrv
- 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) }}