universalisos/.github/workflows/ci.yml
Fábio Coutada 793069c915 feat(testing): add boot test infrastructure — Phase 1 complete
kernel/Makefile:
- Add 'test' target that builds + boots all architectures
- Add 'test-armv7', 'test-aarch64', 'test-riscv' per-arch targets
- Configurable timeout (BOOT_TIMEOUT=15s) and banner string
- Architecture matrix: armv7, aarch64, riscv

tools/uos-boot-test/:
- New QEMU orchestrator (356 lines Python)
- Spawns QEMU, captures UART, checks for boot banner
- JUnit XML output for CI integration
- Supports --arch, --timeout, --junit, --verbose flags
- Per-arch configs with correct QEMU binaries and flags

.github/workflows/ci.yml:
- Add 'boot-test' job that runs after kernel-build
- Matrix strategy: armv7, aarch64, riscv
- Downloads ELF artifacts from kernel-build job
- Installs QEMU + cross-compilers
- Runs uos-boot-test.py with JUnit XML output
- Uploads test results as artifacts

Phase 1 of testing roadmap: CI boot testing now operational.
2026-07-12 16:42:23 +01:00

173 lines
4.9 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
kernel-build:
name: Kernel ${{ matrix.arch }}/${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: armv7
platform: qemu-arm-virt
cross: arm-none-eabi-
packages: gcc-arm-none-eabi binutils-arm-none-eabi
- arch: aarch64
platform: qemu-aarch64-virt
cross: aarch64-none-elf-
packages: gcc-aarch64-none-elf binutils-aarch64-none-elf
- arch: riscv
platform: polarfire
cross: riscv64-unknown-elf-
packages: gcc-riscv64-unknown-elf binutils-riscv64-unknown-elf
steps:
- uses: actions/checkout@v4
- name: Install cross-compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.packages }}
- name: Build kernel
working-directory: kernel
run: make ARCH=${{ matrix.arch }} PLATFORM=${{ matrix.platform }}
- name: Upload ELF artifact
uses: actions/upload-artifact@v4
with:
name: universalisos-${{ matrix.arch }}-${{ matrix.platform }}
path: kernel/build/${{ matrix.arch }}/${{ matrix.platform }}/universalisos.elf
mycelium-test:
name: Mycelium CLI tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
working-directory: mycelium-tfw-extension
run: cargo test
uos-cover-test:
name: uos-cover tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run pytest
run: python -m pytest tools/uos-cover/test/ -v
uos-pkg-test:
name: uos-pkg tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run pytest
run: python -m pytest tools/uos-pkg/test/ -v
requirements-coverage:
name: Requirements coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Check requirements traceability
run: |
# Verify all requirements have linked files
python3 -c "
import sys, os
sys.path.insert(0, 'tools/doorstop-integration')
from doorstop_config import validate_requirements
reqs_dir = 'tools/doorstop-integration/reqs'
if os.path.isdir(reqs_dir):
errors = validate_requirements(reqs_dir)
if errors:
for e in errors:
print(f'ERROR: {e}', file=sys.stderr)
sys.exit(1)
print(f'All requirements valid')
else:
print('No requirements directory found, skipping')
"
- name: Generate traceability matrix
run: |
python3 tools/uos-cover/uos_trace.py generate \
--doorstop tools/doorstop-integration/reqs \
--format html \
-o traceability.html || true
- name: Upload traceability matrix
uses: actions/upload-artifact@v4
with:
name: traceability-matrix
path: traceability.html
boot-test:
name: Boot test ${{ matrix.arch }}
runs-on: ubuntu-latest
needs: kernel-build
strategy:
fail-fast: false
matrix:
arch: [armv7, aarch64, riscv]
steps:
- uses: actions/checkout@v4
- name: Install QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-system-aarch64 qemu-system-misc
- name: Install cross-compiler
run: |
sudo apt-get install -y gcc-arm-none-eabi binutils-arm-none-eabi \
gcc-aarch64-none-elf binutils-aarch64-none-elf \
gcc-riscv64-unknown-elf binutils-riscv64-unknown-elf
- name: Download kernel ELF
uses: actions/download-artifact@v4
with:
name: universalisos-${{ matrix.arch }}-${{ matrix.arch == 'riscv' && 'polarfire' || format('qemu-{0}-virt', matrix.arch) }}
path: kernel/build/${{ matrix.arch }}/
- name: Run boot test
run: |
python3 tools/uos-boot-test/uos-boot-test.py \
--arch ${{ matrix.arch }} \
--timeout 20 \
--junit boot-test-results.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: boot-test-${{ matrix.arch }}
path: boot-test-results.xml