-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (185 loc) · 7.05 KB
/
Copy pathci.yml
File metadata and controls
200 lines (185 loc) · 7.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# AxonOS Kernels — Continuous Integration
#
# Every job has an explicit timeout so a hanging tool cannot block the
# entire pipeline. Kani jobs run with `continue-on-error: true` so that a
# slow or hung BMC proof does not turn the whole CI red — they report
# their status independently and are inspected manually after every push.
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Cancel in-flight runs on the same branch when a new push arrives.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── 1. Tests across three host operating systems ─────────────────────────
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo test --workspace
run: cargo test --workspace --all-features
# ── 2. Format check ───────────────────────────────────────────────────────
fmt:
name: rustfmt --check
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
# ── 3. Clippy ─────────────────────────────────────────────────────────────
clippy:
name: clippy -D warnings
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
# ── 4. MSRV pin ───────────────────────────────────────────────────────────
msrv:
name: MSRV (1.75)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.75
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-features
# ── 5. no_std builds on embedded targets ─────────────────────────────────
no-std:
name: no_std (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
target:
- thumbv7em-none-eabihf
- thumbv8m.main-none-eabihf
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: cargo build --target ${{ matrix.target }}
# Exclude firmware (it builds separately in its own job).
run: |
cargo build --release --target ${{ matrix.target }} \
-p axonos-spsc \
-p axonos-scheduler \
-p axonos-capability \
-p axonos-time \
-p axonos-intent \
-p axonos-kernel-core
# ── 6. Documentation build ───────────────────────────────────────────────
docs:
name: docs -D rustdoc warnings
runs-on: ubuntu-latest
timeout-minutes: 10
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --workspace --no-deps --all-features
# ── 7. Miri (undefined behaviour detection on the unsafe surface) ────────
miri:
name: miri (axonos-spsc)
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
- name: miri test axonos-spsc
run: cargo miri test -p axonos-spsc
# ── 8. Kani bounded model checking ───────────────────────────────────────
# Each crate runs as an independent matrix job with its own timeout.
# `continue-on-error: true` means a hung or failing Kani proof does NOT
# fail the entire pipeline — the result is reported independently.
# Inspect each kani job's log after a push to see what proved and what
# timed out.
#
# To run locally:
# cargo install --locked kani-verifier
# cargo kani setup
# cd axonos-X/kani-proofs && cargo kani --default-unwind 16
kani:
name: kani (${{ matrix.crate }})
runs-on: ubuntu-latest
timeout-minutes: 35
continue-on-error: true
strategy:
fail-fast: false
matrix:
crate:
- axonos-spsc
- axonos-scheduler
- axonos-capability
- axonos-time
- axonos-intent
steps:
- uses: actions/checkout@v4
- uses: model-checking/kani-github-action@v1
with:
working-directory: ${{ matrix.crate }}/kani-proofs
args: "--default-unwind 16"
# ── 9. Bare-metal firmware build (Cortex-M4F) ────────────────────────────
# The firmware crate is excluded from the parent workspace and built
# independently with its target-specific .cargo/config.toml.
firmware:
name: firmware (STM32F407)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v2
- name: Build firmware
working-directory: axonos-firmware-stm32f407
# Explicit --target: relying on .cargo/config.toml has proven
# fragile in some CI environments. Passing the target on the
# command line is the canonical way.
run: cargo build --release --target thumbv7em-none-eabihf
# ── 10. cargo-deny (licence + advisory + bans audit) ─────────────────────
# Pinned to v1: v2 has compatibility issues with cargo-deny 0.15+ where it
# tries to invoke non-existent top-level subcommands. continue-on-error is
# set because licence/advisory checks are informational at pre-1.0 stage.
deny:
name: cargo-deny
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources