-
-
Notifications
You must be signed in to change notification settings - Fork 4
130 lines (124 loc) · 5.06 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
name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
QEMU_STRACE: 1
RUST_BACKTRACE: full
RUST_TEST_THREADS: 1
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
test:
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
- 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
# - 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
# - m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498
- mips-unknown-linux-gnu
- mips64-unknown-linux-gnuabi64
- mips64el-unknown-linux-gnuabi64
- mipsel-unknown-linux-gnu
- 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
# - sparc-unknown-linux-gnu # tier3, supported in rust-cross-toolchain but not ported to this action
- sparc64-unknown-linux-gnu
- thumbv7neon-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
# - x86_64-unknown-linux-gnux32 # tier3, run-fail
os:
- ubuntu-22.04
- ubuntu-20.04
- ubuntu-18.04
exclude:
# Segmentation fault on ubuntu 20.04
- { target: aarch64_be-unknown-linux-gnu, 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: sparc64-unknown-linux-gnu, os: ubuntu-20.04 }
# Hang on ubuntu 18.04
- { target: riscv64gc-unknown-linux-gnu, os: ubuntu-18.04 }
# Toolchains not available on ubuntu 18.04
- { target: mipsisa32r6-unknown-linux-gnu, os: ubuntu-18.04 }
- { target: mipsisa32r6el-unknown-linux-gnu, os: ubuntu-18.04 }
- { target: mipsisa64r6-unknown-linux-gnuabi64, os: ubuntu-18.04 }
- { target: mipsisa64r6el-unknown-linux-gnuabi64, os: ubuntu-18.04 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: taiki-e/github-actions/install-rust@main
- uses: ./
with:
target: ${{ matrix.target }}
- run: git clone https://github.com/taiki-e/rust-cross-toolchain.git
- run: cargo $BUILD_STD build --verbose --target ${{ matrix.target }}
working-directory: rust-cross-toolchain/docker/test/fixtures/rust
- run: cargo $BUILD_STD run --verbose --target ${{ matrix.target }}
working-directory: rust-cross-toolchain/docker/test/fixtures/rust
- run: cargo $BUILD_STD test --verbose --target ${{ matrix.target }} $DOCTEST_XCOMPILE
working-directory: rust-cross-toolchain/docker/test/fixtures/rust
- run: ./target/${{ matrix.target }}/debug/rust-test
working-directory: rust-cross-toolchain
if: matrix.target != 'mipsisa32r6-unknown-linux-gnu' && matrix.target != 'mipsisa32r6el-unknown-linux-gnu'
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: taiki-e/install-action@shellcheck
- uses: taiki-e/install-action@shfmt
- run: npm install prettier
- run: shfmt -d $(git ls-files '*.sh')
if: always()
- run: npx prettier -c $(git ls-files '*.yml')
if: always()
- run: npx prettier -c $(git ls-files '*.js')
if: always()
- run: shellcheck $(git ls-files '*.sh')
if: always()