Skip to content

Commit 301461a

Browse files
committed
ci(rust): add build/test/clippy gate; make the crates clippy-clean
The only Rust CI was CodeQL in build-mode `none` (buildless), so nothing ever compiled or tested robot-repo-automaton / shared-context / dashboard — which is how the non-compiling content-match path reached `main` before it was fixed in the prior PR. Add `.github/workflows/rust.yml`: a per-crate matrix running `cargo build --all-targets`, `cargo test`, and `cargo clippy --all-targets -- -D warnings` (blocking), with `cargo fmt --check` informational (there is pre-existing formatting drift — ~180 hunks — that is intentionally not gated yet). To make the clippy gate pass, fix the existing findings: - fixer.rs: drop a no-op `.replace("hyperpolymath", "hyperpolymath")`. - registry_guard.rs: use `split_once('/')` instead of a manual `splitn(2)`. - exclusion_registry.rs: rename the inherent `from_str` -> `parse` (it is not a `FromStr` impl; matches `Catalog::parse`) and use `if let Ok(..)` instead of `.ok()` + `if let Some(..)`. - hypatia.rs / main.rs: accept `&Path` instead of `&PathBuf`. - Cargo.toml (robot-repo-automaton + shared-context): drop the ignored `+spec-1.1.0` build metadata from the `toml` version requirement (resolution-neutral; silences the cargo warning). - benches: import `std::hint::black_box` (criterion's re-export is deprecated). All three crates are clippy `-D warnings` clean; 101 + 84 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RozeeLxpJsd3WWFngaZWz3
1 parent 4a10dde commit 301461a

10 files changed

Lines changed: 71 additions & 284 deletions

File tree

.github/workflows/rust.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
name: Rust
3+
# Build + test + clippy gate for the three standalone Rust crates.
4+
# Added after a non-compiling crate (robot-repo-automaton) reached `main`
5+
# unnoticed: the only prior Rust CI was CodeQL in build-mode `none`
6+
# (buildless), so nothing actually compiled or tested these crates.
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
branches: ['**']
12+
permissions:
13+
contents: read
14+
env:
15+
CARGO_TERM_COLOR: always
16+
# reqwest=rustls-tls, git2=vendored-openssl, gix=rust-tls. OPENSSL_NO_VENDOR
17+
# makes openssl-sys link the runner's preinstalled system OpenSSL instead of
18+
# recompiling the vendored copy (matches the documented local build).
19+
OPENSSL_NO_VENDOR: '1'
20+
jobs:
21+
rust:
22+
name: build · test · clippy
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
crate: [robot-repo-automaton, shared-context, dashboard]
29+
defaults:
30+
run:
31+
working-directory: ${{ matrix.crate }}
32+
steps:
33+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
34+
- name: Ensure clippy + rustfmt components
35+
run: rustup component add clippy rustfmt
36+
- name: Build (all targets)
37+
run: cargo build --all-targets --verbose
38+
- name: Test
39+
run: cargo test --verbose
40+
- name: Clippy (deny warnings)
41+
run: cargo clippy --all-targets -- -D warnings
42+
- name: Rustfmt check (informational)
43+
# Pre-existing formatting drift is not yet gated; surfaced here so it
44+
# stays visible without blocking. Flip to a hard gate after a dedicated
45+
# `cargo fmt` pass lands.
46+
run: cargo fmt --check
47+
continue-on-error: true

0 commit comments

Comments
 (0)