-
-
Notifications
You must be signed in to change notification settings - Fork 7
187 lines (177 loc) · 7.85 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
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
- cron: '0 0 * * 0' # at midnight of each sunday
name: CI
jobs:
develop:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- 1.63.0 # MSRV
- stable
- nightly
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- run: cargo fmt --all -- --check
- run: |
if [ ${{ matrix.toolchain }} == "nightly" ]; then
cargo clippy -- -D warnings
else
cargo clippy -- -D warnings -A unknown-lints
fi
- run: cargo test --all-features
cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
# copied from `rustup target list`
# - aarch64-apple-darwin # (build error)
# - aarch64-apple-ios # (build error)
# - aarch64-apple-ios-sim # (build error)
# - aarch64-fuchsia # (fuchsia does not have [sg]etrlimit)
- aarch64-linux-android
# - aarch64-pc-windows-msvc # (missing docker image)
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
# - aarch64-unknown-none # (no std)
# - aarch64-unknown-none-softfloat # (no std)
- arm-linux-androideabi
- arm-unknown-linux-gnueabi # (libc mismatch)
- arm-unknown-linux-gnueabihf # (libc mismatch)
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
# - armebv7r-none-eabi # (no std)
# - armebv7r-none-eabihf # (no std)
- armv5te-unknown-linux-gnueabi # (libc mismatch)
- armv5te-unknown-linux-musleabi
- armv7-linux-androideabi
# - armv7-unknown-linux-gnueabi # (missing docker image)
- armv7-unknown-linux-gnueabihf # (libc mismatch)
# - armv7-unknown-linux-musleabi # (missing docker image)
- armv7-unknown-linux-musleabihf
# - armv7a-none-eabi # (no std)
# - armv7r-none-eabi # (no std)
# - armv7r-none-eabihf # (no std)
# - asmjs-unknown-emscripten # (build error)
# - i586-pc-windows-msvc # (missing docker image)
- i586-unknown-linux-gnu # (libc mismatch)
- i586-unknown-linux-musl
- i686-linux-android
# - i686-pc-windows-gnu # (missing docker image)
# - i686-pc-windows-msvc # (missing docker image)
# - i686-unknown-freebsd # (missing docker image)
- i686-unknown-linux-gnu # (libc mismatch)
- i686-unknown-linux-musl
# - mips-unknown-linux-gnu # (rust-std unavailable)
# - mips-unknown-linux-musl # (rust-std unavailable)
# - mips64-unknown-linux-gnuabi64 # (rust-std unavailable)
# - mips64-unknown-linux-muslabi64 # (missing docker image)
# - mips64el-unknown-linux-gnuabi64 # (rust-std unavailable)
# - mips64el-unknown-linux-muslabi64 # (missing docker image)
# - mipsel-unknown-linux-gnu # (rust-std unavailable)
# - mipsel-unknown-linux-musl # (rust-std unavailable)
# - nvptx64-nvidia-cuda # (no std)
- powerpc-unknown-linux-gnu # (libc mismatch)
# - powerpc64-unknown-linux-gnu # (missing docker image)
- powerpc64le-unknown-linux-gnu
# - riscv32i-unknown-none-elf # (no std)
# - riscv32imac-unknown-none-elf # (no std)
# - riscv32imc-unknown-none-elf # (no std)
- riscv64gc-unknown-linux-gnu
# - riscv64gc-unknown-none-elf # (no std)
# - riscv64imac-unknown-none-elf # (no std)
- s390x-unknown-linux-gnu
# - sparc64-unknown-linux-gnu # (missing docker image)
# - sparcv9-sun-solaris # (build error)
# - thumbv6m-none-eabi # (no std)
# - thumbv7em-none-eabi # (no std)
# - thumbv7em-none-eabihf # (no std)
# - thumbv7m-none-eabi # (no std)
# - thumbv7neon-linux-androideabi # (missing docker image)
# - thumbv7neon-unknown-linux-gnueabihf # (missing docker image)
# - thumbv8m.base-none-eabi # (no std)
# - thumbv8m.main-none-eabi # (no std)
# - thumbv8m.main-none-eabihf # (no std)
# - wasm32-unknown-emscripten # (build error)
# - wasm32-unknown-unknown # (tester error)
# - wasm32-wasi # (tester error)
# - x86_64-apple-darwin # (build error)
# - x86_64-apple-ios # (build error)
# - x86_64-fortanix-unknown-sgx # (tester error)
# - x86_64-fuchsia # (fuchsia does not have [sg]etrlimit)
- x86_64-linux-android
# - x86_64-pc-solaris # (missing docker image)
# - x86_64-pc-windows-gnu # (other)
# - x86_64-pc-windows-msvc # (missing docker image)
# - x86_64-sun-solaris # (build error)
# - x86_64-unknown-freebsd # (missing docker image)
# - x86_64-unknown-illumos # (build error)
- x86_64-unknown-linux-gnu
# - x86_64-unknown-linux-gnux32 # (missing docker image)
- x86_64-unknown-linux-musl
# - x86_64-unknown-netbsd # (tester error)
# - x86_64-unknown-redox # (nightly)
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: cross test
run: |
# TODO: remove this when `cross` updates
# See https://github.com/cross-rs/cross/issues/1217
export CROSS_TARGET_AARCH64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/aarch64-linux-android:main"
export CROSS_TARGET_I686_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/i686-linux-android:main"
export CROSS_TARGET_X86_64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/x86_64-linux-android:main"
cross test --all-features --target=${{ matrix.target }}
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo test --all-features
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo test --all-features
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
- run: |
cargo test --all-features
- run: |
cargo check --target x86_64-apple-darwin
diff-codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: diff
run: |
./scripts/codegen.sh
[[ -z $(git status -s) ]] # Fail if changed. See https://stackoverflow.com/a/9393642