|
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 2 | +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | +# |
| 4 | +# rust-ci.yml — Build and test the Aletheia microkernel (Rust). |
| 5 | +# |
| 6 | +# WHY THIS LIVES AT THE REPOSITORY ROOT |
| 7 | +# ------------------------------------ |
| 8 | +# `aletheia/` is vendored as plain tracked files, not a submodule. GitHub Actions |
| 9 | +# only reads workflows from `.github/workflows/` at the repository root, so the 16 |
| 10 | +# workflow files under `aletheia/.github/workflows/` have never executed — see |
| 11 | +# `aletheia/.github/workflows/README.md`. Until this file landed, ~962 lines of Rust |
| 12 | +# had no build, test, or format gate of any kind, and `main` sat uncompilable for |
| 13 | +# over a month (broken 2026-06-17 by b5322c2, fixed in this change). |
| 14 | +# |
| 15 | +# SCOPE OF THIS GATE — read before trusting a green tick |
| 16 | +# ----------------------------------------------------- |
| 17 | +# Gated here (all genuinely passing, all blocking): |
| 18 | +# * debug + release build |
| 19 | +# * the 26 unit tests |
| 20 | +# * `cargo fmt --check` |
| 21 | +# |
| 22 | +# NOT gated here, because they are genuinely red today and a passing-but-hollow |
| 23 | +# job is worse than no job: |
| 24 | +# * `tests/integration_tests.rs` — 27 of 29 fail; they exercise a CLI surface |
| 25 | +# (--help, --version, --format=, --badge, --html, --init-hook) that `src/main.rs` |
| 26 | +# does not implement. |
| 27 | +# * `cargo clippy -- -D warnings` — 25 findings, mostly dead code from modules |
| 28 | +# that `main.rs` never wires up. |
| 29 | +# Both are tracked as issues. Add them here as blocking jobs once they pass; do not |
| 30 | +# add them with `continue-on-error`. |
| 31 | +name: Rust CI |
| 32 | + |
| 33 | +on: |
| 34 | + pull_request: |
| 35 | + branches: ['**'] |
| 36 | + push: |
| 37 | + branches: [main, master] |
| 38 | + workflow_dispatch: |
| 39 | + |
| 40 | +permissions: |
| 41 | + contents: read |
| 42 | + |
| 43 | +concurrency: |
| 44 | + group: rust-ci-${{ github.ref }} |
| 45 | + cancel-in-progress: true |
| 46 | + |
| 47 | +defaults: |
| 48 | + run: |
| 49 | + working-directory: aletheia |
| 50 | + |
| 51 | +jobs: |
| 52 | + build: |
| 53 | + name: Build (debug + release) |
| 54 | + runs-on: ubuntu-latest |
| 55 | + timeout-minutes: 15 |
| 56 | + steps: |
| 57 | + - name: Checkout repository |
| 58 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 59 | + with: |
| 60 | + submodules: false |
| 61 | + |
| 62 | + - name: Show toolchain |
| 63 | + run: cargo --version && rustc --version |
| 64 | + |
| 65 | + - name: Verify zero dependencies (RSR Bronze constraint) |
| 66 | + run: | |
| 67 | + if cargo tree --depth 1 | tail -n +2 | grep -q '[a-z]'; then |
| 68 | + echo "::error::Aletheia must have zero dependencies (see aletheia/CLAUDE.md)" |
| 69 | + cargo tree --depth 1 |
| 70 | + exit 1 |
| 71 | + fi |
| 72 | + echo "Zero dependencies confirmed" |
| 73 | +
|
| 74 | + - name: Build (debug) |
| 75 | + run: cargo build --locked --verbose |
| 76 | + |
| 77 | + - name: Build (release) |
| 78 | + run: cargo build --locked --release --verbose |
| 79 | + |
| 80 | + test: |
| 81 | + name: Unit tests |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 15 |
| 84 | + steps: |
| 85 | + - name: Checkout repository |
| 86 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 87 | + with: |
| 88 | + submodules: false |
| 89 | + |
| 90 | + - name: Run unit tests |
| 91 | + run: cargo test --locked --bins --verbose |
| 92 | + |
| 93 | + format: |
| 94 | + name: Formatting |
| 95 | + runs-on: ubuntu-latest |
| 96 | + timeout-minutes: 10 |
| 97 | + steps: |
| 98 | + - name: Checkout repository |
| 99 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 100 | + with: |
| 101 | + submodules: false |
| 102 | + |
| 103 | + - name: cargo fmt --check |
| 104 | + run: cargo fmt --all --check |
0 commit comments