130 lines
3.6 KiB
YAML
130 lines
3.6 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
|