Repository navigation
478 lines (427 loc) · 15.8 KB
/
Copy pathrust.yml
File metadata and controls
478 lines (427 loc) · 15.8 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
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
name: seL4 smoke
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
MICROKIT_BOARDS: qemu_virt_aarch64,x86_64_generic,qemu_virt_riscv64
# GHA cache keys cannot contain commas; keep in sync with MICROKIT_BOARDS.
SDK_CACHE_SUFFIX: virt-aarch64-x86-riscv
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
# Release downloads answer unauthenticated clients with HTTP 504.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-04
components: rustfmt, clippy
targets: wasm32-unknown-unknown
- name: Install just
run: bash .github/scripts/install-just.sh
# q35_device_lines_match_help_types spawns qemu-system-x86_64.
- name: Install QEMU
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends qemu-system-x86
- name: Format and clippy
run: just check
# The repro is support/host-check.sh. It sets CARGO_TARGET_DIR to
# build/host and runs fmt, clippy -D warnings, and the host tests.
- name: Publish the host check repro script
if: always()
uses: actions/upload-artifact@v4
with:
name: host-check-repro
path: support/host-check.sh
verify-ring:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-04-04
components: rustfmt
- name: Cache the pinned Verus release
uses: actions/cache@v4
with:
path: deps/verus
key: verus-0.2026.10.18.7d82994-verusfmt-0.7.4
- name: Install just
run: bash .github/scripts/install-just.sh
- name: Prove the ring index crate
run: just verify-ring
sdk:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: ./.github/actions/setup-docker-buildx
- name: Build dev image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
tags: lerux-dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
github_token=${{ secrets.GITHUB_TOKEN }}
- name: Restore workspace cache
uses: actions/cache/restore@v4
id: workspace-cache
with:
path: deps/workspace
key: workspace-${{ hashFiles('deps/versions.toml', 'tools/lerux-cli/**') }}
restore-keys: |
workspace-
# The key prefix changed with the seL4 16 bump. A bare `sdk-` restore
# brought back a Microkit 2.2.0 kit, the directory check treated it as
# ready, and the job then saved that kit under the new key.
- name: Restore SDK cache
uses: actions/cache/restore@v4
id: sdk-cache
with:
path: deps/sdk-cache
key: sdk-v2-${{ hashFiles('deps/versions.toml', 'tools/lerux-cli/**') }}-${{ env.SDK_CACHE_SUFFIX }}
restore-keys: |
sdk-v2-${{ hashFiles('deps/versions.toml', 'tools/lerux-cli/**') }}-
- name: Fetch and build SDK
run: |
docker run --rm \
-e MICROKIT_BOARDS="${{ env.MICROKIT_BOARDS }}" \
-v "${{ github.workspace }}:/work" -w /work lerux-dev \
bash -c "$(cat <<'EOF'
set -euo pipefail
just fetch
LERUX_LIONSOS_LAYOUT=1 cargo test -p lerux-sddf --test layout
if [[ -d deps/sdk-cache/microkit-sdk ]]; then
mkdir -p deps/workspace/microkit/release
rm -rf deps/workspace/microkit/release/microkit-sdk*
cp -a deps/sdk-cache/microkit-sdk deps/workspace/microkit/release/
fi
sdk_ready() {
local sdk want got
sdk="$(find deps/workspace/microkit/release -maxdepth 1 -type d -name "microkit-sdk*" | sort | tail -1)"
[[ -n "${sdk}" ]] || return 1
[[ -d "${sdk}/board/qemu_virt_aarch64/debug/include" ]] || return 1
[[ -d "${sdk}/board/qemu_virt_riscv64/debug/include" ]] || return 1
[[ -f "${sdk}/board/x86_64_generic/debug/elf/sel4.elf" ]] || return 1
want="$(sed -n 's/.*microkit = {.*tag = "\([^"]*\)".*/\1/p' deps/versions.toml)"
[[ -n "${want}" && -f "${sdk}/VERSION" ]] || return 1
got="$(tr -d '[:space:]' < "${sdk}/VERSION")"
[[ "${got}" == "${want}" ]] || return 1
}
if sdk_ready; then
echo "==> SDK cache hit, skipping build-sdk"
else
echo "==> SDK missing or VERSION does not match deps/versions.toml; building"
just build-sdk
fi
EOF
)"
# Docker runs as root; host steps need write access under deps/.
sudo chown -R "$(id -u):$(id -g)" deps
- name: Normalize SDK path for host
run: |
set -euo pipefail
sdk="$(find deps/workspace/microkit/release -maxdepth 1 -type d -name 'microkit-sdk*' | sort | tail -1)"
if [[ -z "${sdk}" ]]; then
echo "error: SDK not found under deps/workspace/microkit/release" >&2
exit 1
fi
rm -f deps/.sdk-path
echo "$(realpath "${sdk}")" > deps/.sdk-path
- name: Save workspace cache
if: steps.workspace-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: deps/workspace
key: workspace-${{ hashFiles('deps/versions.toml', 'tools/lerux-cli/**') }}
- name: Stage SDK for cache
run: |
set -euo pipefail
sdk="$(cat deps/.sdk-path)"
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
mkdir -p deps/sdk-cache
rm -rf deps/sdk-cache/microkit-sdk
cp -a "${sdk}" deps/sdk-cache/microkit-sdk
- name: Save SDK cache
if: steps.sdk-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: deps/sdk-cache
key: sdk-v2-${{ hashFiles('deps/versions.toml', 'tools/lerux-cli/**') }}-${{ env.SDK_CACHE_SUFFIX }}
- name: Restore SP804 QEMU cache
uses: actions/cache/restore@v4
id: qemu-sp804-cache
with:
path: |
deps/toolchains/qemu-sp804
deps/toolchains/qemu-6.2.0-src
deps/toolchains/qemu-6.2.0.tar.xz
key: qemu-sp804-${{ hashFiles('support/qemu/arm-virt-sp804.patch', 'tools/lerux-cli/**') }}
restore-keys: |
qemu-sp804-
- name: Build SP804 QEMU
run: |
docker run --rm -v "${{ github.workspace }}:/work" -w /work lerux-dev \
bash -c 'set -euo pipefail
if [[ -x deps/toolchains/qemu-sp804/bin/qemu-system-aarch64 ]]; then
echo "==> SP804 QEMU cache hit"
else
cargo run -q -p lerux-cli -- install sp804-qemu >/dev/null
fi
'
sudo chown -R "$(id -u):$(id -g)" deps
chmod +x deps/toolchains/qemu-sp804/bin/qemu-system-aarch64
- name: Save SP804 QEMU cache
if: always() && steps.qemu-sp804-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
deps/toolchains/qemu-sp804
deps/toolchains/qemu-6.2.0-src
deps/toolchains/qemu-6.2.0.tar.xz
key: qemu-sp804-${{ hashFiles('support/qemu/arm-virt-sp804.patch', 'tools/lerux-cli/**') }}
# The Actions cache is shared with Docker layer caches and can be evicted
# before the smoke jobs restore it. The artifact is the copy those jobs use.
- uses: actions/upload-artifact@v4
with:
name: qemu-sp804
path: deps/toolchains/qemu-sp804/
retention-days: 1
if-no-files-found: error
- name: Upload SDK bundle
run: |
set -euo pipefail
sdk="$(cat deps/.sdk-path)"
if [[ ! -d "${sdk}" ]]; then
echo "error: SDK path from deps/.sdk-path does not exist: ${sdk}" >&2
exit 1
fi
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
mkdir -p sdk-bundle
cp deps/.sdk-path sdk-bundle/
cp -a "${sdk}" sdk-bundle/microkit-sdk
- uses: actions/upload-artifact@v4
with:
name: sdk
path: sdk-bundle/
retention-days: 1
check-pd:
needs: sdk
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: ./.github/actions/setup-docker-buildx
- name: Build dev image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
tags: lerux-dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
github_token=${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: sdk
path: sdk-bundle
- name: Install SDK from artifact
run: |
set -euo pipefail
mkdir -p deps/workspace/microkit/release
cp -a sdk-bundle/microkit-sdk deps/workspace/microkit/release/
sdk="deps/workspace/microkit/release/$(basename sdk-bundle/microkit-sdk)"
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
echo "/work/${sdk}" > deps/.sdk-path
- name: Restore clippy cache
uses: actions/cache/restore@v4
id: clippy-cache
with:
path: build/target
key: cargo-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
cargo-target-
- name: Cross-target clippy
id: clippy
run: |
docker run --rm -v "${{ github.workspace }}:/work" -w /work lerux-dev \
bash -c 'set -euo pipefail
sdk="$(tr -d "\n" < deps/.sdk-path)"
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
just check-pd
'
sudo chown -R "$(id -u):$(id -g)" build deps
- name: Save clippy cache
if: always() && steps.clippy-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build/target
key: cargo-target-${{ hashFiles('Cargo.lock') }}
smoke:
needs: sdk
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- id: aarch64
board: qemu_virt_aarch64
command: BOARD=qemu_virt_aarch64 just test
- id: x86_64
board: x86_64_generic
command: BOARD=x86_64_generic just test
- id: riscv64
board: qemu_virt_riscv64
command: just test-riscv
- id: virtio
board: qemu_virt_aarch64_virtio
command: just disk-img && just test-virtio
- id: cothread
board: qemu_virt_aarch64_cothread
command: just test-cothread
- id: serial-sddf
board: qemu_virt_aarch64_serial_sddf
command: just test-serial-sddf
- id: fs-sddf
board: qemu_virt_aarch64_fs_sddf
command: just test-fs-sddf
- id: net-sddf
board: qemu_virt_aarch64_net_sddf
command: just test-net-sddf
- id: fetch-sddf
board: qemu_virt_aarch64_fetch_sddf
command: just test-fetch-sddf
- id: web-sddf
board: qemu_virt_aarch64_web_sddf
command: just test-web-sddf
- id: browser-sddf
board: qemu_virt_aarch64_browser_sddf
command: just test
- id: agent-sddf
board: qemu_virt_aarch64_agent_sddf
command: just test-agent-sddf
- id: program-sddf
board: qemu_virt_aarch64_program_sddf
command: just test-program-sddf
- id: html
board: qemu_virt_aarch64_html
command: just test-html
- id: riscv-virtio
board: qemu_virt_riscv64_virtio
command: just disk-img && just test-riscv-virtio
- id: http
board: qemu_virt_aarch64_http
command: just test-http
- id: x86-http
board: x86_64_generic_http
command: just test-x86-http
- id: x86-console
board: x86_64_generic_console
command: just test-x86-console
- id: riscv-http
board: qemu_virt_riscv64_http
command: just test-riscv-http
- id: x86-virtio
board: x86_64_generic_virtio
command: just disk-img && just test-x86-virtio
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: ./.github/actions/setup-docker-buildx
- name: Build dev image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
tags: lerux-dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
github_token=${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: sdk
path: sdk-bundle
- name: Install SDK from artifact
run: |
set -euo pipefail
mkdir -p deps/workspace/microkit/release
cp -a sdk-bundle/microkit-sdk deps/workspace/microkit/release/
sdk="deps/workspace/microkit/release/$(basename sdk-bundle/microkit-sdk)"
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
echo "/work/${sdk}" > deps/.sdk-path
- name: Restore shared Cargo target cache
uses: actions/cache/restore@v4
with:
path: build/target
key: cargo-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
cargo-target-
- name: Restore board build cache
uses: actions/cache/restore@v4
id: board-cache
with:
path: build/${{ matrix.board }}
key: board-${{ matrix.id }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
board-${{ matrix.id }}-
- name: Smoke test (${{ matrix.id }})
id: smoke
run: |
docker run --rm -v "${{ github.workspace }}:/work" -w /work lerux-dev \
bash -c 'set -euo pipefail
sdk="$(tr -d "\n" < deps/.sdk-path)"
chmod -R a+rX "${sdk}"
find "${sdk}/bin" -type f -exec chmod a+x {} +
${{ matrix.command }}
'
sudo chown -R "$(id -u):$(id -g)" build deps
- name: Upload serial capture (Phase 57)
if: always()
uses: actions/upload-artifact@v4
with:
name: smoke-serial-${{ matrix.id }}
path: build/smoke-logs/
if-no-files-found: ignore
retention-days: 14
- name: Save shared Cargo target cache
if: always()
uses: actions/cache/save@v4
with:
path: build/target
key: cargo-target-${{ hashFiles('Cargo.lock') }}
- name: Save board build cache
if: always() && steps.board-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build/${{ matrix.board }}
key: board-${{ matrix.id }}-${{ hashFiles('Cargo.lock') }}