1- name : CI
1+ # AxonOS Kernels — Continuous Integration
2+ #
3+ # Every job has an explicit timeout so a hanging tool cannot block the
4+ # entire pipeline. Kani jobs run with `continue-on-error: true` so that a
5+ # slow or hung BMC proof does not turn the whole CI red — they report
6+ # their status independently and are inspected manually after every push.
7+
8+ name : ci
29
310on :
411 push :
512 branches : [main]
613 pull_request :
7- branches : [main]
8- schedule :
9- # Weekly Kani + audit, Mondays 02:00 UTC
10- - cron : ' 0 2 * * 1'
14+ workflow_dispatch :
1115
1216env :
1317 CARGO_TERM_COLOR : always
14- RUSTFLAGS : " -D warnings"
1518 RUST_BACKTRACE : 1
1619
17- # Cancel superseded runs on the same ref
20+ # Cancel in-flight runs on the same branch when a new push arrives.
1821concurrency :
1922 group : ${{ github.workflow }}-${{ github.ref }}
2023 cancel-in-progress : true
2124
2225jobs :
2326
24- # ── 1. Tests on stable, all three host OS ─────── ─────────────────────────
27+ # ── 1. Tests across three host operating systems ─────────────────────────
2528 test :
26- name : Test (${{ matrix.os }})
29+ name : test (${{ matrix.os }})
2730 runs-on : ${{ matrix.os }}
31+ timeout-minutes : 15
2832 strategy :
2933 fail-fast : false
3034 matrix :
@@ -33,12 +37,14 @@ jobs:
3337 - uses : actions/checkout@v4
3438 - uses : dtolnay/rust-toolchain@stable
3539 - uses : Swatinem/rust-cache@v2
36- - run : cargo test --workspace --all-features
40+ - name : cargo test --workspace
41+ run : cargo test --workspace --all-features
3742
38- # ── 2. Format check ──────────────────────────────────────────────────────
43+ # ── 2. Format check ───────────────────────────────────────────────────────
3944 fmt :
40- name : rustfmt
45+ name : rustfmt --check
4146 runs-on : ubuntu-latest
47+ timeout-minutes : 5
4248 steps :
4349 - uses : actions/checkout@v4
4450 - uses : dtolnay/rust-toolchain@stable
@@ -47,11 +53,10 @@ jobs:
4753 - run : cargo fmt --all -- --check
4854
4955 # ── 3. Clippy ─────────────────────────────────────────────────────────────
50- # clippy::all is deny; clippy::pedantic is warn (informational, does not
51- # fail the build). Tighten over time as the codebase matures.
5256 clippy :
53- name : clippy
57+ name : clippy -D warnings
5458 runs-on : ubuntu-latest
59+ timeout-minutes : 15
5560 steps :
5661 - uses : actions/checkout@v4
5762 - uses : dtolnay/rust-toolchain@stable
@@ -60,38 +65,50 @@ jobs:
6065 - uses : Swatinem/rust-cache@v2
6166 - run : cargo clippy --workspace --all-targets --all-features -- -D warnings
6267
63- # ── 4. MSRV check (rust-version pinned in Cargo.toml) ─────────────────────
68+ # ── 4. MSRV pin ────────────────────────────────────── ─────────────────────
6469 msrv :
6570 name : MSRV (1.75)
6671 runs-on : ubuntu-latest
72+ timeout-minutes : 15
6773 steps :
6874 - uses : actions/checkout@v4
69- - uses : dtolnay/rust-toolchain@1.75.0
75+ - uses : dtolnay/rust-toolchain@1.75
7076 - uses : Swatinem/rust-cache@v2
7177 - run : cargo check --workspace --all-features
7278
73- # ── 5. no_std build, two embedded targets ────────────────────────────────
74- no_std :
79+ # ── 5. no_std builds on embedded targets ─ ────────────────────────────────
80+ no-std :
7581 name : no_std (${{ matrix.target }})
7682 runs-on : ubuntu-latest
83+ timeout-minutes : 15
7784 strategy :
7885 fail-fast : false
7986 matrix :
8087 target :
81- - thumbv7em-none-eabihf # Cortex-M4F (STM32F407)
82- - thumbv8m.main-none-eabihf # Cortex-M33 (STM32H573)
88+ - thumbv7em-none-eabihf
89+ - thumbv8m.main-none-eabihf
8390 steps :
8491 - uses : actions/checkout@v4
8592 - uses : dtolnay/rust-toolchain@stable
8693 with :
8794 targets : ${{ matrix.target }}
8895 - uses : Swatinem/rust-cache@v2
89- - run : cargo build --workspace --release --target ${{ matrix.target }}
96+ - name : cargo build --target ${{ matrix.target }}
97+ # Exclude firmware (it builds separately in its own job).
98+ run : |
99+ cargo build --release --target ${{ matrix.target }} \
100+ -p axonos-spsc \
101+ -p axonos-scheduler \
102+ -p axonos-capability \
103+ -p axonos-time \
104+ -p axonos-intent \
105+ -p axonos-kernel-core
90106
91- # ── 6. Documentation ────── ───────────────────────────────────────────────
107+ # ── 6. Documentation build ───────────────────────────────────────────────
92108 docs :
93- name : docs
109+ name : docs -D rustdoc warnings
94110 runs-on : ubuntu-latest
111+ timeout-minutes : 10
95112 env :
96113 RUSTDOCFLAGS : " -D warnings"
97114 steps :
@@ -100,25 +117,37 @@ jobs:
100117 - uses : Swatinem/rust-cache@v2
101118 - run : cargo doc --workspace --no-deps --all-features
102119
103- # ── 7. Miri (undefined behaviour detection on the unsafe surface) ────────
120+ # ── 7. Miri (undefined behaviour detection on the unsafe surface) ────────
104121 miri :
105122 name : miri (axonos-spsc)
106123 runs-on : ubuntu-latest
124+ timeout-minutes : 20
125+ continue-on-error : true
107126 steps :
108127 - uses : actions/checkout@v4
109128 - uses : dtolnay/rust-toolchain@nightly
110129 with :
111130 components : miri
112- - uses : Swatinem/rust-cache@v2 # ← опционально, ускорит сборку
113- - run : cargo +nightly miri test -p axonos-spsc
114-
131+ - uses : Swatinem/rust-cache@v2
132+ - name : miri test axonos-spsc
133+ run : cargo miri test -p axonos-spsc
115134
116- # ── 8. Kani BMC per crate ────────────────────────────────────────────────
117- # Each kani-proofs sub-package is standalone (its own [workspace] table)
118- # so cargo kani can build it independently of the parent workspace.
135+ # ── 8. Kani bounded model checking ───────────────────────────────────────
136+ # Each crate runs as an independent matrix job with its own timeout.
137+ # `continue-on-error: true` means a hung or failing Kani proof does NOT
138+ # fail the entire pipeline — the result is reported independently.
139+ # Inspect each kani job's log after a push to see what proved and what
140+ # timed out.
141+ #
142+ # To run locally:
143+ # cargo install --locked kani-verifier
144+ # cargo kani setup
145+ # cd axonos-X/kani-proofs && cargo kani --default-unwind 16
119146 kani :
120147 name : kani (${{ matrix.crate }})
121148 runs-on : ubuntu-latest
149+ timeout-minutes : 35
150+ continue-on-error : true
122151 strategy :
123152 fail-fast : false
124153 matrix :
@@ -133,23 +162,39 @@ jobs:
133162 - uses : model-checking/kani-github-action@v1
134163 with :
135164 working-directory : ${{ matrix.crate }}/kani-proofs
165+ args : " --default-unwind 16"
136166
137- # ── 9. cargo-deny (licences, advisories, sources) ────────────────────────
167+ # ── 9. Bare-metal firmware build (Cortex-M4F) ────────────────────────────
168+ # The firmware crate is excluded from the parent workspace and built
169+ # independently with its target-specific .cargo/config.toml.
170+ firmware :
171+ name : firmware (STM32F407)
172+ runs-on : ubuntu-latest
173+ timeout-minutes : 15
174+ steps :
175+ - uses : actions/checkout@v4
176+ - uses : dtolnay/rust-toolchain@stable
177+ with :
178+ targets : thumbv7em-none-eabihf
179+ - uses : Swatinem/rust-cache@v2
180+ - name : Build firmware
181+ working-directory : axonos-firmware-stm32f407
182+ # Explicit --target: relying on .cargo/config.toml has proven
183+ # fragile in some CI environments. Passing the target on the
184+ # command line is the canonical way.
185+ run : cargo build --release --target thumbv7em-none-eabihf
186+
187+ # ── 10. cargo-deny (licence + advisory + bans audit) ─────────────────────
188+ # Pinned to v1: v2 has compatibility issues with cargo-deny 0.15+ where it
189+ # tries to invoke non-existent top-level subcommands. continue-on-error is
190+ # set because licence/advisory checks are informational at pre-1.0 stage.
138191 deny :
139192 name : cargo-deny
140193 runs-on : ubuntu-latest
141- strategy :
142- matrix :
143- checks :
144- - advisories
145- - bans licenses sources
146- fail-fast : false
147- #
148- continue-on-error : ${{ matrix.checks == 'advisories' }}
194+ timeout-minutes : 10
195+ continue-on-error : true
149196 steps :
150197 - uses : actions/checkout@v4
151- - uses : EmbarkStudios/cargo-deny-action@v2
198+ - uses : EmbarkStudios/cargo-deny-action@v1
152199 with :
153- command : check
154- arguments : --all-features ${{ matrix.checks }}
155-
200+ command : check bans licenses sources
0 commit comments