ci: add cargo fmt + clippy + test workflow#3
Merged
Conversation
maya has 42 inline unit tests but no CI to gate them. Every PR has relied on the author running `cargo test` locally; a regression would only be caught at the next manual run. Adds .github/workflows/ci.yml with three jobs: - cargo fmt --all -- --check - cargo clippy --all-targets -- -D warnings - cargo test --all-targets clippy and test both `needs: fmt` so a fmt drift fails one cheap job rather than four expensive ones. Drive-by hygiene fixes so the first CI run is green: - cargo fmt applied (whitespace only). - cargo clippy --fix where applicable (behaviour-equivalent, mostly assign-op-pattern and similar idiomatic-modernisation lints). Verified locally: 42/42 tests pass, fmt clean, clippy clean under -D warnings.
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.
Summary
mayahas 42 inline unit tests but no CI to gate them. Every PR has relied on the author runningcargo testlocally.This wires the three standard cargo gates plus the drive-by fixes needed for the first run to be green.
What landed
.github/workflows/ci.yml— three jobs:cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings,cargo test --all-targets.clippy/testneeds: fmtso fmt drift fails the cheap job first. Toolchain pinned to stable; cache viaSwatinem/rust-cache@v2.Drive-by hygiene so the first run is green:
cargo fmtapplied (whitespace only),cargo clippy --fixwhere applicable (behaviour-equivalent idiomatic-modernisation lints).Verification
cargo test --release→ 42 passedcargo fmt --all -- --check→ cleancargo clippy --all-targets -- -D warnings→ cleanTest plan
cargo test