-
Notifications
You must be signed in to change notification settings - Fork 0
271 lines (231 loc) · 8.58 KB
/
boot-tests.yml
File metadata and controls
271 lines (231 loc) · 8.58 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
name: Boot Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
x86_64-boot-stages:
name: x86_64 Boot Stages (252 tests)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init rust-fork submodule (shallow)
run: |
git submodule update --init --depth 1 rust-fork
cd rust-fork && git submodule update --init --depth 1 library/stdarch library/backtrace
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-06-24
components: rust-src, llvm-tools-preview
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
qemu-system-x86 \
qemu-utils \
ovmf \
nasm
qemu-system-x86_64 --version
nasm --version
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-x86-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-x86-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-x86-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-x86-cargo-build-
- name: Build userspace tests
run: |
export PATH="$PATH:$(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/bin"
cd userspace/programs
./build.sh
- name: Pre-build kernel to avoid timeout during QEMU wait
run: |
cargo build --release -p breenix --features testing,external_test_bins --bin qemu-uefi
- name: Run boot-stages test
run: cargo run -p xtask -- boot-stages
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: x86-boot-stages-output-${{ github.run_number }}
path: |
target/xtask_boot_stages_output.txt
target/xtask_user_output.txt
logs/*.log
if-no-files-found: warn
x86_64-kthread-stress:
name: x86_64 Kthread Stress Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init rust-fork submodule (shallow)
run: |
git submodule update --init --depth 1 rust-fork
cd rust-fork && git submodule update --init --depth 1 library/stdarch library/backtrace
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-06-24
components: rust-src, llvm-tools-preview
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
qemu-system-x86 \
qemu-utils \
ovmf \
nasm
qemu-system-x86_64 --version
nasm --version
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-x86-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-x86-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-x86-cargo-build-stress-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-x86-cargo-build-stress-
- name: Pre-build kernel to avoid timeout during QEMU wait
run: |
cargo build --release -p breenix --features kthread_stress_test --bin qemu-uefi
- name: Run kthread stress test
run: cargo run -p xtask -- kthread-stress
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: x86-kthread-stress-output-${{ github.run_number }}
path: |
target/kthread_stress_output.txt
logs/*.log
if-no-files-found: warn
ecosystem-tests:
name: Ecosystem Library Tests (breenish-js)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-06-24
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-ecosystem-cargo-registry-${{ hashFiles('libs/breenish-js/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-ecosystem-cargo-registry-
- name: Run breenish-js tests
run: cargo test --manifest-path libs/breenish-js/Cargo.toml --features std
- name: Verify breenish-js builds without std (no_std + alloc)
run: cargo build --manifest-path libs/breenish-js/Cargo.toml
arm64-boot:
name: ARM64 Boot Stages Test
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Init rust-fork submodule (shallow)
run: |
git submodule update --init --depth 1 rust-fork
cd rust-fork && git submodule update --init --depth 1 library/stdarch library/backtrace
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-06-24
components: rust-src, llvm-tools-preview
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
qemu-system-arm \
e2fsprogs
qemu-system-aarch64 --version
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-cargo-build-
- name: Build userspace for aarch64
run: |
# build.sh copies .elf files to this directory; it must exist
mkdir -p userspace/programs/aarch64
export PATH="$PATH:$(rustc --print sysroot)/lib/rustlib/aarch64-unknown-linux-gnu/bin"
cd userspace/programs
./build.sh --arch aarch64
- name: Create ext2 disk image
run: |
# Pre-create target/ as runner user so sudo doesn't own it
mkdir -p target testdata
sudo ./scripts/create_ext2_disk.sh --arch aarch64
# Fix ownership of files created by sudo
sudo chown -R $(id -u):$(id -g) target/ testdata/
- name: Verify ext2 disk was populated
run: |
IMG="target/ext2-aarch64.img"
if [ ! -f "$IMG" ]; then
echo "FAIL: ext2 image not found at $IMG"
exit 1
fi
SIZE=$(stat -c%s "$IMG")
echo "ext2 image: $IMG ($SIZE bytes)"
# Verify actual binaries were installed (not just an empty filesystem)
ELF_COUNT=$(ls -1 userspace/programs/aarch64/*.elf 2>/dev/null | wc -l | tr -d ' ')
echo "ELF binaries staged: $ELF_COUNT"
if [ "$ELF_COUNT" -lt 10 ]; then
echo "FAIL: Only $ELF_COUNT .elf files in userspace/programs/aarch64/ (expected 100+)"
echo "build.sh may have skipped the copy step"
exit 1
fi
# Spot-check critical binaries
for bin in init.elf init_shell.elf ls.elf cat.elf; do
if [ ! -f "userspace/programs/aarch64/$bin" ]; then
echo "FAIL: Missing critical binary: $bin"
exit 1
fi
done
echo "Critical binaries verified: init, init_shell, ls, cat"
- name: Run ARM64 boot stages validation
run: |
cargo run -p xtask -- arm64-boot-stages
- name: Upload serial log on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: arm64-boot-stages-log-${{ github.run_number }}
path: target/arm64_boot_stages_output.txt
if-no-files-found: warn
retention-days: 7