ci: add Rust tests workflow (build + nextest + clippy)#33
Open
indyjonesnl wants to merge 1 commit into
Open
Conversation
The existing fmt.yml only verified formatting. This adds a parallel `Rust tests` workflow that proves every PR (a) builds the workspace, (b) passes the test suite, and (c) surfaces clippy findings — catching regressions before merge. Key choices: - protoc installed via apt (api-server build.rs needs it for the gnostic openapi proto). - rhino cloned adjacent at `../rhino` because crates/storage resolves the optional rhino dep via `path = "../../../rhino"`. The default `sqlite` feature activates it, so rhino has to exist on disk for cargo metadata + build to work. The fmt workflow needs the same treatment. - cargo-nextest replaces cargo test (2-4x faster scheduling). - Swatinem/rust-cache@v2 instead of plain actions/cache — Rust-aware pruning and hashing. - Clippy runs without `-D warnings` while the baseline has ~30 pre-existing warnings; ratchet to deny mode once that backlog is cleaned. - Triggers: push to main + pull_request. Without the branch filter on push, every PR update would fire two duplicate runs. - fmt step now uses `cargo metadata` to enumerate workspace members rather than `cargo fmt --all`, because the latter would recurse into rhino and apply our rustfmt config to a vendored sibling repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
The existing
fmt.ymlonly checks formatting. Add a parallel Rust tests workflow that proves every PR (a) builds the workspace, (b) passes the test suite viacargo nextest, and (c) surfaces clippy findings. Catches regressions before merge.Workflow design
main+ everypull_request. Thebranches: [main]filter on push prevents duplicate runs when a feature-branch push also has an open PR (PRsynchronizefires the same job).api-server/build.rsneeds it for the gnostic openapi proto.../rhinobecausecrates/storage/Cargo.tomlresolves the optional rhino dep viapath = "../../../rhino". The defaultsqlitefeature pulls it in, so it has to exist on disk forcargo metadata+ build to work. Thefmt.ymlworkflow needs the same treatment.cargo test(2-4× faster scheduling, better parallelism). Installed as a prebuilt binary viataiki-e/install-action.actions/cache— Rust-aware pruning + Cargo.lock + rustc hash for higher hit rates.-D warningswhile the baseline has ~30 pre-existing warnings (deprecated rand APIs after the 0.9 bump, unused-method warnings, const-is-empty etc.). Ratchet to deny mode once that backlog is cleaned up in a follow-up.cargo metadata --no-deps | jqrather thancargo fmt --all.--allrecurses into rhino (a vendored sibling repo with its own rustfmt config) — we should only enforce style on our own crates.Dependency
PR #32 ("bring test suite to green baseline") should land first so the very first run of the new workflow shows green. Without it, 9 pre-existing test failures + the daemonset assertion drift will keep this red.
Verification
Local on this branch (after merging #32):