tools/uos-boot-test/uos-kernel-coverage.py: - New coverage orchestration script (376 lines) - Integrates with existing uos-cover tools - Workflow: instrument → build → run → extract → parse → report - Supports --arch, --report, --timeout, --skip-build flags - Handles missing UMAP data gracefully (expected for initial integration) kernel/Makefile: - Add coverage targets: coverage, coverage-armv7, coverage-aarch64, etc. - Configurable COVERAGE_TOOL and COVERAGE_REPORT paths .github/workflows/ci.yml: - Add 'kernel-coverage' job for armv7 - Runs after kernel-build - Installs QEMU + cross-compiler + Python - Runs uos-kernel-coverage.py - Uploads coverage report as artifact Phase 3 of testing roadmap: Coverage analysis infrastructure operational. Note: Full coverage requires libuoscov runtime in kernel (future work).
215 lines
5.9 KiB
YAML
215 lines
5.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
|
|
|
|
kernel-coverage:
|
|
name: Kernel coverage (armv7)
|
|
runs-on: ubuntu-latest
|
|
needs: kernel-build
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install QEMU
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y qemu-system-arm
|
|
|
|
- name: Install cross-compiler
|
|
run: |
|
|
sudo apt-get install -y gcc-arm-none-eabi binutils-arm-none-eabi
|
|
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Download kernel ELF
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: universalisos-armv7-qemu-arm-virt
|
|
path: kernel/build/armv7/
|
|
|
|
- name: Run coverage analysis
|
|
run: |
|
|
python3 tools/uos-boot-test/uos-kernel-coverage.py \
|
|
--arch armv7 \
|
|
--report coverage \
|
|
--timeout 20
|
|
|
|
- name: Upload coverage report
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage-report
|
|
path: coverage/
|