@@ -3,12 +3,11 @@ name: CI
33
44on :
55 push :
6- branches : [main, master, develop ]
6+ branches : [main, master]
77 pull_request :
8- branches : [main, master, develop ]
8+ branches : [main, master]
99 workflow_dispatch :
1010
11- # Cancel in-progress runs for the same branch/PR
1211concurrency :
1312 group : ${{ github.workflow }}-${{ github.ref }}
1413 cancel-in-progress : true
1918 CARGO_NET_RETRY : 10
2019 RUSTUP_MAX_RETRIES : 10
2120 RUST_BACKTRACE : short
22- # Faster compilation via sccache
2321 SCCACHE_GHA_ENABLED : " true"
2422 RUSTC_WRAPPER : " sccache"
2523
2624jobs :
27- # ──────────────────────────────────────────────
28- # 1. Code Quality (runs once, fast feedback)
29- # ──────────────────────────────────────────────
25+
26+ # ── Code Quality ──
27+
3028 fmt :
3129 name : Rustfmt
3230 runs-on : ubuntu-latest
4644 with :
4745 components : clippy
4846 - uses : mozilla-actions/sccache-action@v0.0.6
49- - uses : taiki-e/install-action@cargo-hack
50- - name : Clippy (all feature combinations)
51- run : cargo hack clippy --feature-powerset --no-dev-deps -- -D warnings
52- - name : Clippy (tests)
53- run : cargo clippy --all-targets -- -D warnings
47+ - run : cargo clippy --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery
5448
5549 docs :
5650 name : Documentation
6357 - uses : mozilla-actions/sccache-action@v0.0.6
6458 - run : cargo doc --no-deps --all-features
6559
66- # ──────────────────────────────────────────────
67- # 2. Security & Dependency Audit
68- # ──────────────────────────────────────────────
60+ # ── Security ──
61+
6962 audit :
7063 name : Security Audit
7164 runs-on : ubuntu-latest
@@ -74,46 +67,35 @@ jobs:
7467 - uses : taiki-e/install-action@cargo-deny
7568 - run : cargo deny check
7669
77- # ──────────────────────────────────────────────
78- # 3. Tests — Native (all target platforms)
79- # ──────────────────────────────────────────────
70+ # ── Tests ──
71+
8072 test :
8173 name : Test (${{ matrix.name }})
8274 needs : [fmt, clippy]
8375 strategy :
8476 fail-fast : false
8577 matrix :
8678 include :
87- # ── Linux x86_64 ──
8879 - name : Linux x86_64
8980 os : ubuntu-latest
9081 target : x86_64-unknown-linux-gnu
9182 cross : false
9283
93- # ── Linux ARM64 ──
9484 - name : Linux ARM64
9585 os : ubuntu-latest
9686 target : aarch64-unknown-linux-gnu
9787 cross : true
9888
99- # ── macOS ARM64 (Apple Silicon) ──
10089 - name : macOS ARM64
10190 os : macos-14
10291 target : aarch64-apple-darwin
10392 cross : false
10493
105- # ── macOS x86_64 ──
10694 - name : macOS x86_64
10795 os : macos-13
10896 target : x86_64-apple-darwin
10997 cross : false
11098
111- # ── Windows x86_64 ──
112- - name : Windows x86_64
113- os : windows-latest
114- target : x86_64-pc-windows-msvc
115- cross : false
116-
11799 runs-on : ${{ matrix.os }}
118100 steps :
119101 - uses : actions/checkout@v4
@@ -136,12 +118,11 @@ jobs:
136118 if : matrix.cross
137119 run : cross test --all-features --target ${{ matrix.target }}
138120
139- # ──────────────────────────────────────────────
140- # 4. Build Release Binaries (all platforms)
141- # ──────────────────────────────────────────────
121+ # ── Release Builds ──
122+
142123 build :
143124 name : Build (${{ matrix.name }})
144- needs : [fmt, clippy ]
125+ needs : [test ]
145126 strategy :
146127 fail-fast : false
147128 matrix :
@@ -150,31 +131,21 @@ jobs:
150131 os : ubuntu-latest
151132 target : x86_64-unknown-linux-gnu
152133 cross : false
153- artifact : target/x86_64-unknown-linux-gnu/release
154134
155135 - name : Linux ARM64
156136 os : ubuntu-latest
157137 target : aarch64-unknown-linux-gnu
158138 cross : true
159- artifact : target/aarch64-unknown-linux-gnu/release
160139
161140 - name : macOS ARM64
162141 os : macos-14
163142 target : aarch64-apple-darwin
164143 cross : false
165- artifact : target/aarch64-apple-darwin/release
166144
167145 - name : macOS x86_64
168146 os : macos-13
169147 target : x86_64-apple-darwin
170148 cross : false
171- artifact : target/x86_64-apple-darwin/release
172-
173- - name : Windows x86_64
174- os : windows-latest
175- target : x86_64-pc-windows-msvc
176- cross : false
177- artifact : target/x86_64-pc-windows-msvc/release
178149
179150 runs-on : ${{ matrix.os }}
180151 steps :
@@ -198,119 +169,113 @@ jobs:
198169 if : matrix.cross
199170 run : cross build --release --all-features --target ${{ matrix.target }}
200171
201- - name : Upload artifacts
172+ - name : Upload binary
202173 uses : actions/upload-artifact@v4
203174 with :
204- name : build-${{ matrix.target }}
205- path : |
206- ${{ matrix.artifact }}/*
207- !${{ matrix.artifact }}/.fingerprint
208- !${{ matrix.artifact }}/build
209- !${{ matrix.artifact }}/deps
210- !${{ matrix.artifact }}/examples
211- !${{ matrix.artifact }}/incremental
212- !${{ matrix.artifact }}/.cargo-lock
175+ name : rustwave-${{ matrix.target }}
176+ path : target/${{ matrix.target }}/release/rustwave-cli
213177 if-no-files-found : error
214- retention-days : 7
178+ retention-days : 14
215179
216- # ──────────────────────────────────────────────
217- # 5. Code Coverage
218- # ──────────────────────────────────────────────
219- coverage :
220- name : Code Coverage
221- needs : [fmt, clippy]
222- runs-on : ubuntu-latest
223- steps :
224- - uses : actions/checkout@v4
225- - uses : dtolnay/rust-toolchain@stable
226- - uses : mozilla-actions/sccache-action@v0.0.6
227- - uses : taiki-e/install-action@cargo-llvm-cov
180+ # ── Encode/Decode Smoke Test ──
228181
229- - name : Generate coverage
230- run : cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
182+ smoke-test :
183+ name : Smoke Test (encode → decode)
184+ needs : [build]
185+ strategy :
186+ fail-fast : false
187+ matrix :
188+ include :
189+ - name : Linux x86_64
190+ os : ubuntu-latest
191+ target : x86_64-unknown-linux-gnu
231192
232- - name : Upload to Codecov
233- uses : codecov/codecov-action@v4
193+ - name : macOS ARM64
194+ os : macos-14
195+ target : aarch64-apple-darwin
196+
197+ runs-on : ${{ matrix.os }}
198+ steps :
199+ - name : Download binary
200+ uses : actions/download-artifact@v4
234201 with :
235- files : lcov.info
236- fail_ci_if_error : false
237- env :
238- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
239-
240- # ──────────────────────────────────────────────
241- # 6. MSRV (Minimum Supported Rust Version)
242- # ──────────────────────────────────────────────
202+ name : rustwave-${{ matrix.target }}
203+ path : bin/
204+
205+ - name : Make executable
206+ run : chmod +x bin/rustwave-cli
207+
208+ - name : Create test payload
209+ run : echo "RustWave smoke test payload 1234567890" > test_input.bin
210+
211+ - name : Encode
212+ run : bin/rustwave-cli encode -i test_input.bin -o signal.wav
213+
214+ - name : Decode
215+ run : bin/rustwave-cli decode -i signal.wav -o test_output.bin
216+
217+ - name : Verify lossless round-trip
218+ run : |
219+ if diff test_input.bin test_output.bin; then
220+ echo "✅ Round-trip successful — output matches input byte-for-byte"
221+ else
222+ echo "❌ Round-trip FAILED — output differs from input"
223+ exit 1
224+ fi
225+
226+ # ── MSRV ──
227+
243228 msrv :
244- name : MSRV Check
245- runs-on : ubuntu-latest
246- steps :
247- - uses : actions/checkout@v4
248- - uses : taiki-e/install-action@cargo-hack
249- - name : Check MSRV
250- run : cargo hack check --rust-version --workspace --all-targets --ignore-private
251-
252- # ──────────────────────────────────────────────
253- # 7. Miri (Undefined Behavior Detection)
254- # ──────────────────────────────────────────────
255- miri :
256- name : Miri
229+ name : MSRV (Rust 1.75)
257230 runs-on : ubuntu-latest
258231 steps :
259232 - uses : actions/checkout@v4
260- - uses : dtolnay/rust-toolchain@nightly
261- with :
262- components : miri
263- - name : Run Miri
264- run : cargo miri test --all-features
265- env :
266- MIRIFLAGS : -Zmiri-strict-provenance
267-
268- # ──────────────────────────────────────────────
269- # 8. Gate — all checks must pass
270- # ──────────────────────────────────────────────
233+ - uses : dtolnay/rust-toolchain@1.75
234+ - uses : mozilla-actions/sccache-action@v0.0.6
235+ - run : cargo check --all-features
236+
237+ # ── Gate ──
238+
271239 ci-pass :
272240 name : CI Pass ✅
273241 if : always()
274- needs : [fmt, clippy, docs, audit, test, build, coverage , msrv, miri ]
242+ needs : [fmt, clippy, docs, audit, test, build, smoke-test , msrv]
275243 runs-on : ubuntu-latest
276244 steps :
277245 - name : Evaluate results
278246 run : |
279247 echo "Results:"
280- echo " fmt: ${{ needs.fmt.result }}"
281- echo " clippy: ${{ needs.clippy.result }}"
282- echo " docs: ${{ needs.docs.result }}"
283- echo " audit: ${{ needs.audit.result }}"
284- echo " test: ${{ needs.test.result }}"
285- echo " build: ${{ needs.build.result }}"
286- echo " coverage: ${{ needs.coverage.result }}"
287- echo " msrv: ${{ needs.msrv.result }}"
288- echo " miri: ${{ needs.miri.result }}"
248+ echo " fmt: ${{ needs.fmt.result }}"
249+ echo " clippy: ${{ needs.clippy.result }}"
250+ echo " docs: ${{ needs.docs.result }}"
251+ echo " audit: ${{ needs.audit.result }}"
252+ echo " test: ${{ needs.test.result }}"
253+ echo " build: ${{ needs.build.result }}"
254+ echo " smoke-test: ${{ needs.smoke-test.result }}"
255+ echo " msrv: ${{ needs.msrv.result }}"
289256
290257 - name : All checks passed
291258 if : >-
292- needs.fmt.result == 'success' &&
293- needs.clippy.result == 'success' &&
294- needs.docs.result == 'success' &&
295- needs.audit.result == 'success' &&
296- needs.test.result == 'success' &&
297- needs.build.result == 'success' &&
298- needs.coverage.result == 'success' &&
299- needs.msrv.result == 'success' &&
300- needs.miri.result == 'success'
259+ needs.fmt.result == 'success' &&
260+ needs.clippy.result == 'success' &&
261+ needs.docs.result == 'success' &&
262+ needs.audit.result == 'success' &&
263+ needs.test.result == 'success' &&
264+ needs.build.result == 'success' &&
265+ needs.smoke-test.result == 'success' &&
266+ needs.msrv.result == 'success'
301267 run : echo "🎉 All CI checks passed!"
302268
303269 - name : Some checks failed
304270 if : >-
305- needs.fmt.result != 'success' ||
306- needs.clippy.result != 'success' ||
307- needs.docs.result != 'success' ||
308- needs.audit.result != 'success' ||
309- needs.test.result != 'success' ||
310- needs.build.result != 'success' ||
311- needs.coverage.result != 'success' ||
312- needs.msrv.result != 'success' ||
313- needs.miri.result != 'success'
271+ needs.fmt.result != 'success' ||
272+ needs.clippy.result != 'success' ||
273+ needs.docs.result != 'success' ||
274+ needs.audit.result != 'success' ||
275+ needs.test.result != 'success' ||
276+ needs.build.result != 'success' ||
277+ needs.smoke-test.result != 'success' ||
278+ needs.msrv.result != 'success'
314279 run : |
315280 echo "❌ Some CI checks failed!"
316281 exit 1
0 commit comments