-
Notifications
You must be signed in to change notification settings - Fork 18
272 lines (261 loc) · 8.76 KB
/
ci.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
on: push
name: Continuous integration
jobs:
lints:
name: Lints
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt, clippy
- name: Run rustfmt
if: matrix.os == 'ubuntu-latest'
run: |
cargo fmt --all -- --check
- name: Run clippy
run: |
cargo clippy --all-targets --all-features -- -D warnings
tier1:
# Matches the Rust Tier 1 platform support
# See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-1-with-host-tools
name: Tier 1
needs: lints
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use_cross: true
- os: ubuntu-latest
target: i686-unknown-linux-gnu
use_cross: true
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: i686-pc-windows-gnu
- os: windows-latest
target: i686-pc-windows-msvc
use_cross: true
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macOS-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
# Based on https://github.com/actions/runner-images/issues/2549#issuecomment-770632307
- name: add mingw32 to path
shell: bash
run: |
echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
- name: Check without features
run: cargo check --target=${{ matrix.target }}
- name: Check with all features enabled
run: ${{ env.CARGO_BINARY }} check --all-features --target=${{ matrix.target }}
env:
CARGO_BINARY: ${{ matrix.use_cross == true && 'cross' || 'cargo' }}
- name: Run tests
run: ${{ env.CARGO_BINARY }} test --all-features --target=${{ matrix.target }}
env:
CARGO_BINARY: ${{ matrix.use_cross == true && 'cross' || 'cargo' }}
tier2_with_host_tools:
# Matches Rust "Tier 2 with Host Tools" platform support
# For as much as possible
#
# See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
name: Tier 2 (with Host Tools)
needs: tier1
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macOS-latest
target: aarch64-apple-darwin
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: linux-latest
target: aarch64-unknown-linux-musl
- os: linux-latest
target: arm-unknown-linux-gnueabi
- os: linux-latest
target: arm-unknown-linux-gnueabihf
- os: linux-latest
target: armv7-unknown-linux-gnueabihf
- os: linux-latest
target: loongarch64-unknown-linux-gnu
- os: linux-latest
target: mips-unknown-linux-gnu
- os: linux-latest
target: mips64-unknown-linux-gnuabi64
- os: linux-latest
target: mips64el-unknown-linux-gnuabi64
- os: linux-latest
target: mipsel-unknown-linux-gnu
- os: linux-latest
target: powerpc-unknown-linux-gnu
- os: linux-latest
target: powerpc64-unknown-linux-gnu
- os: linux-latest
target: powerpc64le-unknown-linux-gnu
- os: linux-latest
target: riscv64gc-unknown-linux-gnu
- os: linux-latest
target: s390x-unknown-linux-gnu
- os: linux-latest
target: x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: Run build
# TODO: Temporary
continue-on-error: true
run: |
cross build --all-features --target=${{ matrix.target }}
tier2_with_host_tools_via_cross:
# Matches Rust "Tier 2 with Host Tools" platform support
# For as much as possible, but where `cross` is needed for cross-compilation
#
# See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
name: Tier 2 (with Host Tools, via Cross)
needs: tier1
runs-on: linux-latest
strategy:
matrix:
target:
- x86_64-unknown-freebsd
- x86_64-unknown-illumos
- x86_64-unknown-netbsd
steps:
- uses: actions/checkout@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: Run build
# TODO: Temporary
continue-on-error: true
run: |
cross build --all-features --target=${{ matrix.target }}
tier2_without_host_tools:
# Matches Rust "Tier 2 with host tools" platform support
# For as much as possible, but where `cross` is needed for cross-compilation
#
# See https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2-with-host-tools
name: Tier 2 (without Host Tools)
needs: tier1
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macOS-latest
target: aarch64-apple-ios
- os: linux-latest
target: aarch64-unknown-fuchsia
- os: linux-latest
target: aarch64-linux-android
- os: linux-latest
target: arm-linux-androideabi
- os: linux-latest
target: arm-unknown-linux-musleabi
- os: linux-latest
target: arm-unknown-linux-musleabihf
- os: linux-latest
target: armv5te-unknown-linux-gnueabi
- os: linux-latest
target: armv5te-unknown-linux-musleabi
- os: linux-latest
target: armv7-linux-androideabi
- os: linux-latest
target: armv7-unknown-linux-gnueabi
- os: linux-latest
target: armv7-unknown-linux-musleabi
- os: linux-latest
target: armv7-unknown-linux-musleabihf
- os: linux-latest
target: i586-unknown-linux-gnu
- os: linux-latest
target: i586-unknown-linux-musl
- os: linux-latest
target: i686-linux-android
- os: linux-latest
target: i686-unknown-freebsd
- os: linux-latest
target: i686-unknown-linux-musl
- os: linux-latest
target: mips-unknown-linux-musl
- os: linux-latest
target: mips64-unknown-linux-muslabi64
- os: linux-latest
target: mips64el-unknown-linux-muslabi64
- os: linux-latest
target: mipsel-unknown-linux-musl
- os: linux-latest
target: sparc64-unknown-linux-gnu
- os: linux-latest
target: sparcv9-sun-solaris
- os: linux-latest
target: thumbv7neon-linux-androideabi
- os: linux-latest
target: thumbv7neon-unknown-linux-gnueabihf
- os: macOS-latest
target: x86_64-apple-ios
- os: linux-latest
target: x86_64-fortanix-unknown-sgx
- os: linux-latest
target: x86_64-unknown-fuchsia
- os: linux-latest
target: x86_64-linux-android
- os: linux-latest
target: x86_64-pc-solaris
- os: linux-latest
target: x86_64-unknown-linux-gnux32
- os: linux-latest
target: x86_64-unknown-redox
steps:
- uses: actions/checkout@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: Run build
# TODO: Temporary
continue-on-error: true
run: |
cross build --all-features --target=${{ matrix.target }}
# TODO: Tier 3
# - x86_64-unknown-dragonfly
# And other targets that have `std` comnpiled