ci: run the Makefile check gates on pull requests - #396
Open
kevin9327 wants to merge 1 commit into
Open
Conversation
`release.yml` only runs on `v*` tags, so nothing verifies a commit
before it lands on `main`. `main` is currently red on three of the five
gates `make check` defines, which is the drift this is meant to catch.
Adds a single job running the three Rust gates verbatim as the Makefile
spells them:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets
Conventions follow release.yml so the two workflows stay consistent:
ubuntu-22.04, the same apt packages (the workspace includes
apps/desktop/src-tauri, so even `cargo check` needs webkit2gtk),
dtolnay/rust-toolchain@stable and Swatinem/rust-cache@v2 with the same
`. -> target` workspace key.
Co-Authored-By: Claude Opus 4.8 <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.
Motivation
This one is a proposal rather than a fix, so please treat it as a
suggestion — I am happy to adjust the shape or just close it if you
would rather set CI up differently.
release.ymlis the only workflow, and it triggers onv*tags only.Nothing checks a commit before it reaches
main. The observableconsequence is that
maindoes not currently pass its ownmake check:None of those are dramatic on their own, and that is rather the point —
they are exactly the class of thing a PR gate catches for free and that
otherwise accumulates quietly.
What this adds
One job, running the three Rust gates exactly as the
Makefilealreadyspells them — no new lint set, no new configuration, nothing you are not
already running locally:
on
pull_requestand onpushtomain.Everything else copies
release.ymlso the two stay consistent ratherthan drifting apart:
ubuntu-22.04and the same four apt packages. These are needed evenfor
cargo check, becauseapps/desktop/src-tauriis a workspacemember and pulls in webkit2gtk.
dtolnay/rust-toolchain@stable(there is norust-toolchain.tomlpinning anything, so I followed release.yml's
stable; happy to pinif you would prefer that).
Swatinem/rust-cache@v2with the same. -> targetworkspace key.permissions: contents: read, and aconcurrencygroup so pushes toa PR cancel the superseded run.
protocis vendored viaprotoc-bin-vendoredinserver/build.rs, sothere is nothing extra to install for the proto codegen.
What I deliberately left out
make checkalso runsnpm --prefix apps/desktop run checkandnpm --prefix apps/docs run check. I left both out to keep this smalland because I have not verified them, not because I think they do not
belong. Say the word and I will add a second job for them.
Please read this before merging
On today's
mainthis workflow will be red, which is precisely thecondition it is reporting. It goes green once two things land:
make checkon main #395 fixes thefmtdiff and the fourclippyerrors.local_rules_contexttest timeout.So the natural order is #395 and #390 first, then this. If you would
rather it not gate anything until the tree is clean, I can drop the
pull_requesttrigger, or splitcargo testinto a separatenon-required job — just tell me which you prefer.
I have verified the three commands locally on Windows with the fixes
from #395 and #390 applied; I cannot exercise the Ubuntu runner from
here, so the apt/toolchain lines are mirrored from
release.ymlratherthan independently tested.