-
Notifications
You must be signed in to change notification settings - Fork 0
224 lines (208 loc) · 8.18 KB
/
ci.yml
File metadata and controls
224 lines (208 loc) · 8.18 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
# ── Basic compilation check ───────────────────────────────────────────
check:
name: cargo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check
# ── Test suite (unit + integration + doc-tests) ───────────────────────
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: >
cargo test --lib --tests --
--skip mpmc_stress
--skip stress_1m
--skip arbitrary_capacity_mpmc_stress
--skip arbitrary_capacity_stress
timeout-minutes: 5
- run: cargo test --doc
- run: >
cargo test --workspace --all-features --
--skip mpmc_stress
--skip stress_1m
--skip bounded_cross_thread
--skip mpmc_two_publishers
timeout-minutes: 5
# ── Lint with Clippy ──────────────────────────────────────────────────
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings
# ── Formatting check ─────────────────────────────────────────────────
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
# ── MSRV verification ─────────────────────────────────────────────
msrv:
name: MSRV 1.94
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.94
- uses: Swatinem/rust-cache@v2
- run: cargo check
# ── Miri (undefined-behavior detector) ────────────────────────────────
miri:
name: miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
# Run single-threaded correctness tests under Miri.
# Multi-threaded tests are excluded because the seqlock protocol
# involves deliberate optimistic data races that Miri flags as UB
# (see README "Seqlock Memory Model Question").
- run: >
cargo +nightly miri test --test correctness -- --test-threads=1
--skip cross_thread
--skip blocking_recv
--skip stress_1m
--skip bounded_publish_blocks
--skip bounded_publish_batch_blocks
--skip subscriber_drop_unblocks
--skip subscriber_group_bounded_cross
--skip bounded_cross_thread
--skip mpmc_two_publishers
--skip mpmc_stress
--skip mpmc_blocking_recv
--skip mpmc_clone
--skip arbitrary_capacity_stress
--skip arbitrary_capacity_bounded_cross
--skip arbitrary_capacity_mpmc
# ── Cross-platform matrix build ──────────────────────────────────────
cross-platform:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
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
- run: cargo check
- run: >
cargo test --lib --tests --
--skip mpmc_stress
--skip stress_1m
--skip arbitrary_capacity_mpmc_stress
--skip arbitrary_capacity_stress
timeout-minutes: 5
# ── WASM build (verify no_std / WASM compatibility) ──────────────────
wasm:
name: wasm32 check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- run: cargo check --target wasm32-unknown-unknown
# ── No default features (pure no_std) ────────────────────────────────
no-default-features:
name: no-default-features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --no-default-features
# ── Hugepages feature gate (Linux only) ──────────────────────────────
hugepages:
name: hugepages feature
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --features hugepages
# ── atomic-slots feature gate (formally sound slot implementation) ──
atomic-slots:
name: atomic-slots feature
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --features atomic-slots
- run: cargo test --features atomic-slots --test atomic_slots
timeout-minutes: 5
# Run correctness tests with atomic-slots, skipping heavy stress tests
# that exceed CI runner capacity in debug mode.
- run: >
cargo test --features atomic-slots --test correctness --
--skip mpmc_stress
--skip stress_1m
--skip bounded_cross_thread
--skip mpmc_two_publishers
timeout-minutes: 5
# ── photon-ring-async tests ────────────────────────────────────────
async-crate:
name: photon-ring-async
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test -p photon-ring-async
# ── photon-ring-metrics tests ──────────────────────────────────────
metrics-crate:
name: photon-ring-metrics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test -p photon-ring-metrics
# ── Publish to crates.io (only on tagged releases) ───────────────────
publish:
name: publish
needs: [check, test, clippy, fmt, miri, cross-platform, wasm, no-default-features, hugepages, atomic-slots, async-crate, metrics-crate]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# Publish order: derive → core → async + metrics.
# "|| true" skips already-published crates (idempotent re-runs).
- run: cargo publish -p photon-ring-derive --token ${{ secrets.CARGO_REGISTRY_TOKEN }} || true
- run: sleep 30
- run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} || true
- run: sleep 30
- run: cargo publish -p photon-ring-async --token ${{ secrets.CARGO_REGISTRY_TOKEN }} || true
- run: cargo publish -p photon-ring-metrics --token ${{ secrets.CARGO_REGISTRY_TOKEN }} || true