15
15
jobs :
16
16
check-doc :
17
17
name : Docs, deadlinks, minimal dependencies
18
- runs-on : ubuntu-latest
18
+ runs-on : ubuntu-22.04
19
19
steps :
20
20
- uses : actions/checkout@v3
21
21
- uses : dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg
@@ -41,11 +41,11 @@ jobs:
41
41
runs-on : ${{ matrix.os }}
42
42
strategy :
43
43
matrix :
44
- os : [ubuntu-latest , windows-latest ]
44
+ os : [ubuntu-22.04 , windows-2022 ]
45
45
toolchain : [nightly, beta, stable, 1.36]
46
46
# Only Test macOS on stable to reduce macOS CI jobs
47
47
include :
48
- - os : macos-latest
48
+ - os : macos-12
49
49
toolchain : stable
50
50
steps :
51
51
- uses : actions/checkout@v3
61
61
62
62
linux-tests :
63
63
name : Linux Test
64
- runs-on : ubuntu-latest
64
+ runs-on : ubuntu-22.04
65
65
strategy :
66
66
matrix :
67
67
target : [
@@ -75,17 +75,13 @@ jobs:
75
75
with :
76
76
targets : ${{ matrix.target }}
77
77
- name : Install multilib
78
- # update is needed to fix the 404 error on install, see:
79
- # https://github.com/actions/virtual-environments/issues/675
80
- run : |
81
- sudo apt-get update
82
- sudo apt-get install gcc-multilib
78
+ run : sudo apt-get install gcc-multilib
83
79
- uses : Swatinem/rust-cache@v2
84
80
- run : cargo test --target=${{ matrix.target }} --features=std
85
81
86
82
ios-tests :
87
83
name : iOS Simulator Test
88
- runs-on : macos-11
84
+ runs-on : macos-12
89
85
steps :
90
86
- uses : actions/checkout@v3
91
87
- uses : dtolnay/rust-toolchain@stable
98
94
wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
99
95
cargo dinghy --version
100
96
- name : Setup Simulator
97
+ # Use the first installed iOS runtime and the first (i.e. oldest) supported iPhone device.
101
98
run : |
102
- RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
103
- SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID)
99
+ RUNTIME=$(xcrun simctl list runtimes --json | jq '.runtimes | map(select(.name | contains("iOS"))) | .[0]')
100
+ RUNTIME_ID=$(echo $RUNTIME | jq -r '.identifier')
101
+ echo "Using runtime:" $RUNTIME_ID
102
+ DEVICE_ID=$(echo $RUNTIME | jq -r '.supportedDeviceTypes | map(select(.productFamily == "iPhone")) | .[0].identifier')
103
+ echo "Using device:" $DEVICE_ID
104
+ SIM_ID=$(xcrun simctl create Test-iPhone $DEVICE_ID $RUNTIME_ID)
105
+ echo "Created simulator:" $SIM_ID
104
106
xcrun simctl boot $SIM_ID
105
107
echo "device=$SIM_ID" >> $GITHUB_ENV
106
108
- uses : Swatinem/rust-cache@v2
@@ -109,7 +111,7 @@ jobs:
109
111
110
112
windows-tests :
111
113
name : Windows Test
112
- runs-on : windows-latest
114
+ runs-on : windows-2022
113
115
strategy :
114
116
matrix :
115
117
toolchain : [
@@ -127,7 +129,7 @@ jobs:
127
129
128
130
cross-tests :
129
131
name : Cross Test
130
- runs-on : ubuntu-latest
132
+ runs-on : ubuntu-22.04
131
133
strategy :
132
134
matrix :
133
135
target : [
@@ -150,7 +152,7 @@ jobs:
150
152
151
153
macos-link :
152
154
name : macOS ARM64 Build/Link
153
- runs-on : macos-latest
155
+ runs-on : macos-12
154
156
steps :
155
157
- uses : actions/checkout@v3
156
158
- uses : dtolnay/rust-toolchain@nightly
@@ -164,7 +166,7 @@ jobs:
164
166
165
167
cross-link :
166
168
name : Cross Build/Link
167
- runs-on : ubuntu-latest
169
+ runs-on : ubuntu-22.04
168
170
strategy :
169
171
matrix :
170
172
target : [
@@ -191,24 +193,25 @@ jobs:
191
193
fail-fast : false
192
194
matrix :
193
195
include :
194
- - os : ubuntu-latest
195
- target : x86_64-unknown-linux-musl
196
- - os : windows-latest
197
- target : x86_64-pc-windows-msvc
196
+ # Firefox isn't available on 22.04 yet, so we must use 20.04
197
+ - os : ubuntu-20.04
198
+ host : x86_64-unknown-linux-musl
199
+ - os : windows-2022
200
+ host : x86_64-pc-windows-msvc
198
201
# Reenable when Safari tests start working
199
202
# - os: macos-12
200
- # target : x86_64-apple-darwin
203
+ # host : x86_64-apple-darwin
201
204
runs-on : ${{ matrix.os }}
202
205
steps :
203
206
- uses : actions/checkout@v3
204
207
- uses : dtolnay/rust-toolchain@stable
205
208
- run : choco install wget
206
- if : matrix .os == 'windows-latest '
209
+ if : runner .os == 'Windows '
207
210
- name : Install precompiled wasm-pack
208
211
shell : bash
209
212
run : |
210
213
VERSION=v0.10.3
211
- URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.target }}.tar.gz
214
+ URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.host }}.tar.gz
212
215
wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
213
216
wasm-pack --version
214
217
- uses : Swatinem/rust-cache@v2
@@ -219,18 +222,18 @@ jobs:
219
222
- name : Test (Chrome)
220
223
run : wasm-pack test --headless --chrome --features=js,test-in-browser
221
224
- name : Test (Edge)
222
- if : matrix .os == 'windows-latest '
225
+ if : runner .os == 'Windows '
223
226
run : wasm-pack test --headless --chrome --chromedriver $Env:EDGEWEBDRIVER\msedgedriver.exe --features=js,test-in-browser
224
227
# Safari tests are broken: https://github.com/rustwasm/wasm-bindgen/issues/3004
225
228
# - name: Test (Safari)
226
- # if: matrix .os == 'macos-12 '
229
+ # if: runner .os == 'macOS '
227
230
# run: wasm-pack test --headless --safari --features=js,test-in-browser
228
231
- name : Test (custom getrandom)
229
232
run : wasm-pack test --node --features=custom
230
233
231
234
wasm64-tests :
232
235
name : wasm64 Build/Link
233
- runs-on : ubuntu-latest
236
+ runs-on : ubuntu-22.04
234
237
steps :
235
238
- uses : actions/checkout@v3
236
239
- uses : dtolnay/rust-toolchain@nightly # Need to build libstd
@@ -245,7 +248,7 @@ jobs:
245
248
246
249
wasi-tests :
247
250
name : WASI Test
248
- runs-on : ubuntu-latest
251
+ runs-on : ubuntu-22.04
249
252
steps :
250
253
- uses : actions/checkout@v3
251
254
- uses : dtolnay/rust-toolchain@stable
@@ -262,7 +265,7 @@ jobs:
262
265
263
266
build-tier2 :
264
267
name : Tier 2 Build
265
- runs-on : ubuntu-latest
268
+ runs-on : ubuntu-22.04
266
269
strategy :
267
270
matrix :
268
271
target : [
@@ -281,7 +284,7 @@ jobs:
281
284
282
285
build-tier3 :
283
286
name : Tier 3 Build
284
- runs-on : ubuntu-latest
287
+ runs-on : ubuntu-22.04
285
288
strategy :
286
289
matrix :
287
290
# Supported tier 3 targets without libstd support
@@ -318,7 +321,7 @@ jobs:
318
321
319
322
clippy-fmt :
320
323
name : Clippy + rustfmt
321
- runs-on : ubuntu-latest
324
+ runs-on : ubuntu-22.04
322
325
steps :
323
326
- uses : actions/checkout@v1
324
327
- uses : dtolnay/rust-toolchain@stable
0 commit comments