Skip to content

Merge pull request #199 from ryanbreen/feat/breenish-phase5-completion #56

Merge pull request #199 from ryanbreen/feat/breenish-phase5-completion

Merge pull request #199 from ryanbreen/feat/breenish-phase5-completion #56

Workflow file for this run

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
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