-
-
Notifications
You must be signed in to change notification settings - Fork 4
371 lines (353 loc) · 16 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
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
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
tidy:
uses: taiki-e/github-actions/.github/workflows/tidy.yml@main
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
secrets: inherit
test:
needs: tidy
strategy:
fail-fast: false
matrix:
# https://github.com/taiki-e/rust-cross-toolchain/blob/HEAD/tools/target-list-shared.sh
target:
# Linux (GNU)
# rustup target list | grep -e '-linux-gnu'
# rustc --print target-list | grep -e '-linux-gnu'
- aarch64-unknown-linux-gnu
# - aarch64-unknown-linux-gnu_ilp32 # tier3
# TODO: https://github.com/BurntSushi/memchr/pull/162
# - aarch64_be-unknown-linux-gnu # tier3
# - aarch64_be-unknown-linux-gnu_ilp32 # tier3
- arm-unknown-linux-gnueabi
# - arm-unknown-linux-gnueabihf # supported in rust-cross-toolchain but not ported to this action
- armeb-unknown-linux-gnueabi # tier3
# - armv4t-unknown-linux-gnueabi # tier3, rustc generate code for armv5t (probably needs to pass +v4t to llvm)
- armv5te-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- i586-unknown-linux-gnu
- i686-unknown-linux-gnu
- loongarch64-unknown-linux-gnu
# - m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498
- mips-unknown-linux-gnu # tier3
- mips64-unknown-linux-gnuabi64 # tier3
- mips64el-unknown-linux-gnuabi64 # tier3
- mipsel-unknown-linux-gnu # tier3
- mipsisa32r6-unknown-linux-gnu # tier3
- mipsisa32r6el-unknown-linux-gnu # tier3
- mipsisa64r6-unknown-linux-gnuabi64 # tier3
- mipsisa64r6el-unknown-linux-gnuabi64 # tier3
- powerpc-unknown-linux-gnu
# - powerpc-unknown-linux-gnuspe # tier3, fails to run test, and GCC 9 removed support for this target
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv32gc-unknown-linux-gnu # tier3
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
# TODO: relocations in generic ELF (EM: 18)
# - sparc-unknown-linux-gnu # tier3
- sparc64-unknown-linux-gnu
- thumbv7neon-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
# - x86_64-unknown-linux-gnux32 # tier3, run-fail
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
include:
# Linux (musl)
# rustup target list | grep -e '-linux-musl'
# rustc --print target-list | grep -e '-linux-musl'
- target: aarch64-unknown-linux-musl
- target: aarch64-unknown-linux-musl
runner: qemu-user@7.2
- target: aarch64-unknown-linux-musl
qemu: '7.2'
- target: arm-unknown-linux-musleabi
- target: arm-unknown-linux-musleabihf
- target: armv5te-unknown-linux-musleabi
- target: armv7-unknown-linux-musleabi
- target: armv7-unknown-linux-musleabihf
# - target: hexagon-unknown-linux-musl # tier3
- target: i586-unknown-linux-musl
- target: i686-unknown-linux-musl
# - target: mips-unknown-linux-musl # tier3
# - target: mips64-openwrt-linux-musl # tier3
# - target: mips64-unknown-linux-muslabi64 # tier3
# - target: mips64el-unknown-linux-muslabi64 # tier3
# - target: mipsel-unknown-linux-musl # tier3
# - target: powerpc-unknown-linux-musl # tier3
# - target: powerpc64-unknown-linux-musl # tier3
# - target: powerpc64le-unknown-linux-musl # tier3
# - target: riscv32gc-unknown-linux-musl # tier3
# - target: riscv64gc-unknown-linux-musl # tier3
# - target: s390x-unknown-linux-musl # tier3
# - target: thumbv7neon-unknown-linux-musleabihf # tier3
- target: x86_64-unknown-linux-musl
# Linux (uClibc)
# rustc --print target-list | grep -e '-linux-uclibc'
# TODO: https://github.com/rust-lang/rust/issues/118190
# - target: armv5te-unknown-linux-uclibceabi # tier3
# - target: armv7-unknown-linux-uclibceabi # tier3
# - target: armv7-unknown-linux-uclibceabihf # tier3
# - target: mips-unknown-linux-uclibc # tier3
# - target: mipsel-unknown-linux-uclibc # tier3
# Android
# rustup target list | grep -e '-android'
# rustc --print target-list | grep -e '-android'
- target: aarch64-linux-android
- target: arm-linux-androideabi
- target: arm-linux-androideabi@21
- target: armv7-linux-androideabi
- target: i686-linux-android
- target: thumbv7neon-linux-androideabi
- target: x86_64-linux-android
# FreeBSD
# rustup target list | grep -e '-freebsd'
# rustc --print target-list | grep -e '-freebsd'
- target: aarch64-unknown-freebsd # tier3
# - target: armv6-unknown-freebsd # tier3
# - target: armv7-unknown-freebsd # tier3
- target: i686-unknown-freebsd
# - target: powerpc-unknown-freebsd # tier3
# - target: powerpc64-unknown-freebsd # tier3
# - target: powerpc64le-unknown-freebsd # tier3
# - target: riscv64gc-unknown-freebsd # tier3
- target: x86_64-unknown-freebsd
- target: x86_64-unknown-freebsd@13
# NetBSD
# rustup target list | grep -e '-netbsd'
# rustc --print target-list | grep -e '-netbsd'
- target: aarch64-unknown-netbsd # tier3
# - target: aarch64_be-unknown-netbsd # tier3
# - target: armv6-unknown-netbsd-eabihf # tier3
# - target: armv7-unknown-netbsd-eabihf # tier3
# - target: i686-unknown-netbsd # tier3
# - target: powerpc-unknown-netbsd # tier3
# - target: riscv64gc-unknown-netbsd # tier3
# - target: sparc64-unknown-netbsd # tier3
- target: x86_64-unknown-netbsd
- target: x86_64-unknown-netbsd@9
# Illumos
# rustup target list | grep -e '-illumos'
# rustc --print target-list | grep -e '-illumos'
# - target: aarch64-unknown-illumos # tier3 (not yet supported)
- target: x86_64-unknown-illumos
# WASI
# rustup target list | grep -e '-wasi'
# rustc --print target-list | grep -e '-wasi'
- target: wasm32-wasip1
# macOS
# rustup target list | grep -e '-darwin'
# rustc --print target-list | grep -e '-darwin'
- target: aarch64-apple-darwin
os: macos-14 # aarch64
- target: aarch64-apple-darwin
os: macos-13 # x86_64
# - target: i686-apple-darwin # tier3
# os: macos-latest
- target: x86_64-apple-darwin
os: macos-14 # aarch64
- target: x86_64-apple-darwin
os: macos-13 # x86_64
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64h-apple-darwin # tier3
os: macos-latest
# Mac Catalyst
# rustup target list | grep -e '-macabi'
# rustc --print target-list | grep -e '-macabi'
- target: aarch64-apple-ios-macabi
os: macos-latest # AArch64
- target: x86_64-apple-ios-macabi
os: macos-13 # x86_64
# Windows (MSVC)
# rustup target list | grep -e '-pc-windows-msvc'
# rustc --print target-list | grep -e '-pc-windows-msvc'
- { target: aarch64-pc-windows-msvc, os: windows-latest }
- { target: i586-pc-windows-msvc, os: windows-latest }
- { target: i686-pc-windows-msvc, os: windows-latest }
# - { target: thumbv7a-pc-windows-msvc, os: windows-latest } # tier3
- { target: x86_64-pc-windows-msvc, os: windows-latest }
# Windows (MinGW)
# rustup target list | grep -e '-pc-windows-gnu'
# rustc --print target-list | grep -e '-pc-windows-gnu'
# Windows host:
# - target: i686-pc-windows-gnu
# os: windows-latest
- target: x86_64-pc-windows-gnu
os: windows-latest
# Linux host:
# - target: i686-pc-windows-gnu
- target: x86_64-pc-windows-gnu
- target: x86_64-pc-windows-gnu
runner: wine@9.3
- target: x86_64-pc-windows-gnu
wine: '9.0.0.0'
- target: x86_64-pc-windows-gnullvm
- target: i686-pc-windows-gnullvm
- target: aarch64-pc-windows-gnullvm
# prettier-ignore
exclude:
# Linker error "unsupported ISA subset `z'" since nightly-2023-08-09 (LLVM 17)
- { target: riscv64gc-unknown-linux-gnu, os: ubuntu-20.04 }
# The futex facility returned an unexpected error code: https://github.com/rust-lang/rust/issues/124920
- { target: i586-unknown-linux-gnu, os: ubuntu-24.04 }
- { target: i686-unknown-linux-gnu, os: ubuntu-24.04 }
# Segmentation fault on ubuntu 24.04: https://github.com/taiki-e/setup-cross-toolchain-action/issues/1
- { target: aarch64_be-unknown-linux-gnu, os: ubuntu-24.04 }
- { target: armeb-unknown-linux-gnueabi, os: ubuntu-24.04 }
# Segmentation fault on ubuntu 20.04: https://github.com/taiki-e/setup-cross-toolchain-action/issues/1
- { target: aarch64_be-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: armeb-unknown-linux-gnueabi, os: ubuntu-20.04 }
- { target: mips-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: mips64-unknown-linux-gnuabi64, os: ubuntu-20.04 }
- { target: mipsisa32r6-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: mipsisa64r6-unknown-linux-gnuabi64, os: ubuntu-20.04 }
- { target: powerpc64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: sparc-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: sparc64-unknown-linux-gnu, os: ubuntu-20.04 }
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
- name: Install Rust
run: rustup toolchain add nightly --no-self-update && rustup default nightly
- run: echo "QEMU_STRACE=1" >>"${GITHUB_ENV}"
if: matrix.target != 'aarch64-pc-windows-gnullvm'
- uses: ./
with:
target: ${{ matrix.target }}
runner: ${{ matrix.runner }}
qemu: ${{ matrix.qemu }}
wine: ${{ matrix.wine }}
- run: git clone --depth 1 https://github.com/taiki-e/rust-cross-toolchain.git
- run: tools/ci/test.sh ${{ matrix.target }} rust-cross-toolchain/docker/test/fixtures/rust
id: test
- run: |
set -eEuxo pipefail
/system/bin/sh -c set
if: contains(matrix.target, '-android')
# For debugging
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-${{ matrix.os }}
# TODO(windows host): No files were found with the provided path: /tmp/artifacts/. No artifacts will be uploaded.
path: /tmp/artifacts/
if: matrix.runner == '' && matrix.qemu == '' && matrix.wine == ''
test-container:
needs: tidy
strategy:
fail-fast: false
matrix:
container:
- ubuntu:18.04 # glibc 2.27
- ubuntu:20.04 # glibc 2.31
- ubuntu:22.04 # glibc 2.35
- ubuntu:24.04 # glibc 2.39
- debian:10-slim # glibc 2.28
- debian:11-slim # glibc 2.31
- debian:12-slim # glibc 2.36
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
# TODO: No such file or directory
# - i586-unknown-linux-gnu
# - i686-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- aarch64-linux-android
- x86_64-unknown-freebsd
- x86_64-unknown-netbsd
- x86_64-unknown-illumos
- wasm32-wasip1
- x86_64-pc-windows-gnu
- x86_64-pc-windows-gnullvm
# prettier-ignore
exclude:
# Toolchains not available on ubuntu 18.04
- { target: mipsisa32r6-unknown-linux-gnu, container: 'ubuntu:18.04' }
- { target: mipsisa32r6el-unknown-linux-gnu, container: 'ubuntu:18.04' }
- { target: mipsisa64r6-unknown-linux-gnuabi64, container: 'ubuntu:18.04' }
- { target: mipsisa64r6el-unknown-linux-gnuabi64, container: 'ubuntu:18.04' }
# The latest Wine not available
- { target: x86_64-pc-windows-gnu, container: 'ubuntu:18.04' }
- { target: x86_64-pc-windows-gnu, container: 'debian:10-slim' }
- { target: x86_64-pc-windows-gnullvm, container: 'ubuntu:18.04' }
- { target: x86_64-pc-windows-gnullvm, container: 'debian:10-slim' }
# winehq now supports noble but 9.0.0 is not available in it
# https://dl.winehq.org/wine-builds/ubuntu/dists/noble/main/binary-amd64
# TODO: ubuntu repository's wine is 9.0.0, so we can use it
# https://packages.ubuntu.com/en/noble/wine
- { target: x86_64-pc-windows-gnu, container: 'ubuntu:24.04' }
- { target: x86_64-pc-windows-gnullvm, container: 'ubuntu:24.04' }
# Linker error "unsupported ISA subset `z'" since nightly-2023-08-09 (LLVM 17)
- { target: riscv64gc-unknown-linux-gnu, container: 'ubuntu:20.04' }
# sparc64-linux-gnu-gcc: error: 20210110/32: No such file or directory
- { target: sparc-unknown-linux-gnu, container: 'debian:11-slim' }
# precompiled binary of latest wasmtime requires glibc 2.28+
- { target: wasm32-wasip1, container: 'ubuntu:18.04' }
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ${{ matrix.container }}
options: --privileged
steps:
- name: Install requirements (ubuntu/debian)
run: |
set -eEuxo pipefail
apt-get -o Acquire::Retries=10 -qq update
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends ca-certificates curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain nightly
echo "$HOME/.cargo/bin" >>"${GITHUB_PATH}"
apt-get -qq -o Dpkg::Use-Pty=0 remove -y curl
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
- uses: taiki-e/checkout-action@v1
- uses: ./
with:
target: ${{ matrix.target }}
- name: Install requirements for test (ubuntu/debian)
run: |
set -eEuxo pipefail
apt-get -o Acquire::Retries=10 -qq update
apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y --no-install-recommends gcc libc6-dev jq make cmake
if: startsWith(matrix.container, 'ubuntu') || startsWith(matrix.container, 'debian')
- run: git clone --depth 1 https://github.com/taiki-e/rust-cross-toolchain.git
- run: tools/ci/test.sh ${{ matrix.target }} rust-cross-toolchain/docker/test/fixtures/rust
id: test
# TODO: we should replace ':' from matrix.container: "Error: The artifact name is not valid"
# # For debugging
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.target }}-${{ matrix.container }}
# path: /tmp/artifacts/