-
Notifications
You must be signed in to change notification settings - Fork 186
262 lines (248 loc) · 8.41 KB
/
build.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
name: Build
on:
push:
branches: master
pull_request:
branches: master
schedule:
- cron: "0 12 * * 1"
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
jobs:
macos:
name: Apple Other
# visionOS requires Xcode 15.2+, which is only available on the arm64 runners.
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
targets: aarch64-apple-darwin, aarch64-apple-ios
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo test --no-run --target=aarch64-apple-darwin --features=std
- run: cargo test --no-run --target=aarch64-apple-ios --features=std
- run: cargo test --no-run --target=aarch64-apple-tvos -Zbuild-std --features=std
- run: cargo test --no-run --target=aarch64-apple-watchos -Zbuild-std --features=std
# visionOS requires Xcode 15.2+, GitHub Actions defaults to an older version.
- run: sudo xcode-select -switch /Applications/Xcode_15.2.app
# std is broken on visionOS right now
#- run: cargo test --no-run --target=aarch64-apple-visionos -Zbuild-std --features=std
cross:
name: Cross
runs-on: ubuntu-24.04
strategy:
matrix:
target: [
sparcv9-sun-solaris,
x86_64-unknown-illumos,
]
steps:
- uses: actions/checkout@v4
- name: Install precompiled cross
run: |
VERSION=v0.2.5
URL=https://github.com/cross-rs/cross/releases/download/${VERSION}/cross-x86_64-unknown-linux-gnu.tar.gz
wget -O - $URL | tar -xz -C ~/.cargo/bin
cross --version
- name: Build Tests
run: cross test --no-run --target=${{ matrix.target }} --features=std
tier2:
name: Tier 2
runs-on: ubuntu-24.04
strategy:
matrix:
target: [
x86_64-unknown-fuchsia,
x86_64-unknown-redox,
x86_64-fortanix-unknown-sgx,
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --target=${{ matrix.target }} --features=std
tier3:
name: Tier 3
runs-on: ubuntu-24.04
strategy:
matrix:
target: [
aarch64-kmc-solid_asp3,
aarch64-unknown-nto-qnx710,
armv6k-nintendo-3ds,
armv7-sony-vita-newlibeabihf,
i686-unknown-hurd-gnu,
x86_64-unknown-hermit,
x86_64-wrs-vxworks,
x86_64-unknown-dragonfly,
x86_64-unknown-haiku,
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly # Required to build libcore
with:
components: rust-src
- uses: Swatinem/rust-cache@v2
- run: cargo build -Z build-std=core --target=${{ matrix.target }}
# Ubuntu does not support running x32 binaries:
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1994516/comments/21
linux-x32:
name: Linux x32
runs-on: ubuntu-24.04
strategy:
matrix:
target: [x86_64-unknown-linux-gnux32]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install libc and libgcc
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libc6-dev-x32 libx32gcc-11-dev
- uses: Swatinem/rust-cache@v2
- run: cargo build --target=${{ matrix.target }} --features=std
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_getrandom"
run: cargo build --target=${{ matrix.target }} --features=std
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_raw"
run: cargo build --target=${{ matrix.target }} --features=std
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_test_linux_fallback
run: cargo build --features=std
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rdrand"
run: cargo build --features=std
linux-raw:
name: Build Raw Linux
runs-on: ubuntu-24.04
strategy:
matrix:
target: [
arm-unknown-linux-gnueabihf,
aarch64-unknown-linux-gnu,
loongarch64-unknown-linux-gnu,
riscv32gc-unknown-linux-gnu,
riscv64gc-unknown-linux-gnu,
i686-unknown-linux-gnu,
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-gnux32,
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-10-24
components: rust-src
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_raw"
run: cargo build -Zbuild-std=core --target=${{ matrix.target }}
web:
name: ${{ matrix.target.description }} ${{ matrix.feature.description }} ${{ matrix.atomic.description }}
runs-on: ubuntu-24.04
env:
RUSTFLAGS: --cfg getrandom_backend="wasm_js" ${{ matrix.atomic.flags }}
strategy:
fail-fast: false
matrix:
target: [
{ description: Web, target: wasm32-unknown-unknown },
{ description: WasmV1, target: wasm32v1-none },
]
feature: [
{ description: no_std, feature: "", build-std: "core,alloc", std: false },
{ feature: --features std, build-std: "panic_abort,std", std: true },
]
atomic: [
{ flags: "" },
{ description: with Atomics, flags: "-Ctarget-feature=+atomics,bulk-memory" },
]
exclude:
- target: { target: wasm32v1-none }
feature: { std: true }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
targets: ${{ matrix.target.target }}
toolchain: nightly-2024-10-24
components: rust-src
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --target ${{ matrix.target.target }} ${{ matrix.feature.feature }} -Zbuild-std=${{ matrix.feature.build-std }}
rdrand-uefi:
name: RDRAND UEFI
runs-on: ubuntu-24.04
strategy:
matrix:
target: [
x86_64-unknown-uefi,
i686-unknown-uefi,
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly # Required to build libcore
with:
components: rust-src
- uses: Swatinem/rust-cache@v2
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rdrand"
run: cargo build -Z build-std=core --target=${{ matrix.target }}
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rdrand"
run: cargo build -Z build-std=std --target=${{ matrix.target }} --features std
rndr:
name: RNDR
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: aarch64-unknown-linux-gnu, aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
- name: RNDR enabled at compile time (Linux)
env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rndr" -C target-feature=+rand
run: cargo build --target=aarch64-unknown-linux-gnu
- name: Runtime RNDR detection without std (Linux)
env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rndr"
run: cargo build --target=aarch64-unknown-linux-gnu
- name: Runtime RNDR detection with std (macOS)
env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rndr"
run: cargo build --target=aarch64-unknown-linux-gnu --features std
esp-idf:
name: ESP-IDF
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly # Required to build libcore
with:
components: rust-src
- uses: Swatinem/rust-cache@v2
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="esp_idf"
run: cargo build -Z build-std=core --target=riscv32imc-esp-espidf
no-atomics:
name: No Atomics
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: riscv32i-unknown-none-elf
- uses: Swatinem/rust-cache@v2
- env:
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="custom"
run: cargo build --target riscv32i-unknown-none-elf