-
-
Notifications
You must be signed in to change notification settings - Fork 111
311 lines (285 loc) · 9.82 KB
/
ci.yml
File metadata and controls
311 lines (285 loc) · 9.82 KB
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
name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['**']
workflow_dispatch:
permissions: {}
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'
jobs:
test-nightly:
name: Test (${{ contains(matrix.runs-on, 'arm') && 'AArch64' || 'x86_64'}}, ${{ matrix.container }}${{ matrix.test-qemu && ', QEMU' || ''}})
strategy:
matrix:
runs-on:
- ubuntu-24.04
- ubuntu-24.04-arm
container:
- 'ubuntu:24.04'
- 'opensuse/tumbleweed:latest'
- 'rust:1.94-alpine'
test-qemu:
- false
test-plugins:
- false
include:
- runs-on: ubuntu-24.04
container: 'ubuntu:25.10'
test-qemu: true
- runs-on: ubuntu-24.04-arm
container: 'ubuntu:25.10'
test-qemu: false
test-plugins: true
- runs-on: ubuntu-24.04
container: 'ubuntu:26.04'
test-qemu: true
- runs-on: ubuntu-24.04-arm
container: 'ubuntu:26.04'
test-qemu: false
exclude: # TODO: https://github.com/actions/runner/issues/1637
- runs-on: ubuntu-24.04-arm
container: 'rust:1.94-alpine'
fail-fast: false
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 10
container:
image: ${{ matrix.container }}
steps:
- run: echo "WILD_TEST_CONFIG=test-config-ci.toml" >> $GITHUB_ENV
- run: echo "WILD_TEST_CROSS=all" >> $GITHUB_ENV
if: ${{ matrix.test-qemu }}
- run: apt-get update && apt-get -y install gcc g++ clang clang-format lld curl bubblewrap
if: ${{ contains(matrix.container, 'ubuntu') }}
- run: apt-get update && apt-get -y install qemu-user gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu binutils-aarch64-linux-gnu binutils-riscv64-linux-gnu binutils-loongarch64-linux-gnu
if: ${{ matrix.test-qemu }}
- run: zypper refresh && zypper in -y gcc gcc-c++ glibc-devel-static clang lld curl rustup bubblewrap
if: ${{ contains(matrix.container, 'opensuse') }}
- run: apk add build-base lld clang clang-extra-tools bash curl
if: ${{ contains(matrix.container, 'alpine') }}
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
id: rust-toolchain
with:
targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,aarch64-unknown-linux-musl,riscv64gc-unknown-linux-gnu,riscv64gc-unknown-linux-musl,loongarch64-unknown-linux-gnu,loongarch64-unknown-linux-musl
components: rustc-codegen-cranelift-preview
- uses: wild-linker/action@latest
with:
wild-version: "0.8.0"
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ matrix.container }}-${{ matrix.runs-on }}
- run: cargo build --profile ci --workspace --no-default-features
- run: cargo test --profile ci --features plugins
if: ${{ matrix.test-plugins }}
- run: WILD_TEST_CROSS=$WILD_TEST_CROSS cargo test --profile ci --workspace
windows-build:
name: Windows build
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
- uses: Swatinem/rust-cache@v2
- run: cargo build --profile ci --workspace --no-default-features
macos-build:
name: macOS build
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
- uses: Swatinem/rust-cache@v2
- run: cargo build --profile ci --workspace --no-default-features
minimal-versions:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- run: sudo apt-get update && sudo apt-get -y install gcc g++ clang clang-format lld curl
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack,cargo-minimal-versions
- uses: Swatinem/rust-cache@v2
- run: cargo minimal-versions --direct test --profile ci
clippy:
name: Clippy
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# This is where we check that we're not using features from a more recent rust version. When
# updating this, please also update workspace.package.rust-version in `Cargo.toml`.
- uses: dtolnay/rust-toolchain@1.94.0
id: rust-toolchain
with:
components: clippy
- uses: wild-linker/action@latest
with:
wild-version: "0.8.0"
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --target x86_64-unknown-linux-gnu
rustfmt:
name: Check formatting
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
yamlfmt:
name: yamlfmt
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: '1.26.0'
cache: false
- run: go install github.com/google/yamlfmt/cmd/yamlfmt@v0.21.0
- run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- run: yamlfmt -lint .
riscv-build:
name: RISC-V build
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: riscv64gc-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update && sudo apt-get install build-essential lld gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- run: cp -f .cargo/config.toml.cross-riscv .cargo/config.toml
- run: cargo build --target riscv64gc-unknown-linux-gnu
loongarch64-build:
name: LoongArch64 build
runs-on: ubuntu-24.04
timeout-minutes: 10
container:
image: ubuntu:25.10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: apt-get update && apt-get install -y build-essential lld gcc gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu curl
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: loongarch64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- run: cp -f .cargo/config.toml.cross-loongarch64 .cargo/config.toml
- run: cargo build --target loongarch64-unknown-linux-gnu
wasip1-build:
name: wasip1 build
runs-on: ubuntu-24.04
timeout-minutes: 10
container:
image: ubuntu:25.10
steps:
- name: Install xz-utils
run: apt-get update && apt-get install -y xz-utils
- name: Setup Wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: '43.0.0'
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: apt-get install --update -y build-essential gcc gcc-multilib clang curl
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@v2
- run: cargo build --target wasm32-wasip1
- run: cp -f .cargo/config.toml.cross-wasm32p1 .cargo/config.toml
# -p libwild prevents integration tests from running. they depend on
# spawning processes, which isn't supported on wasi.
- run: cargo test --profile ci -p libwild --target wasm32-wasip1
spelling:
name: Spell Check with Typos
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Spell Check Repo
uses: crate-ci/typos@v1.45.0
calc-matrix:
name: Find Nix checks
runs-on: ubuntu-24.04
timeout-minutes: 10
outputs:
matrix: ${{ steps.calc-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v34
with:
nix_on_tmpfs: true
- name: Calculate check
id: calc-matrix
run: |
set -euo pipefail
matrix=$(nix flake show --json | jq -c '.checks."x86_64-linux"|keys_unsorted')
echo "Matrix: $matrix"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-checks:
needs:
- calc-matrix
strategy:
fail-fast: false
matrix:
check: ${{ fromJson(needs.calc-matrix.outputs.matrix) }}
runs-on: ubuntu-24.04
timeout-minutes: 10
name: Nix/${{ matrix.check }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v34
- name: Restore Nix store
uses: nix-community/cache-nix-action/restore@v7
id: cache
with:
primary-key: ${{ runner.os }}-${{ hashFiles( 'flake.lock', 'Cargo.lock') }}
- name: Run ${{ matrix.check }}
run: nix build .#checks.x86_64-linux.${MATRIX_CHECK} -L --show-trace
env:
MATRIX_CHECK: ${{ matrix.check }}