Repository navigation
ci: cut Actions usage and move local checks to hk hooks - #24
Merged
Merged
Conversation
Pull requests now build only the x86_64 Linux binary with a Cargo cache. The three-target matrix and the install and packaging checks run only for a release. The cargo install check reuses the release build, and a new push to a pull request cancels the older run.
Pull request builds no longer share the pages concurrency group with deploys, and a new push cancels the older run.
Each job now has a timeout, so a hung job cannot use runner minutes without limit. .github/jactionlint.yaml accepts the global npm install in the docs build and the Homebrew tap deploy key, with the reasons.
hk.pkl runs gitleaks, typos, jactionlint, cargo fmt and whitespace checks before each commit, adds Clippy before each push, and checks commit messages with Cocogitto. mise install installs the tools and the hooks.
The hk commit-msg hook now runs the same Cocogitto check before each commit.
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.
Why
Every pull request push built release binaries on three runners (macOS included), twice per runner and with no cache, so Actions usage was high. Checks such as Conventional Commits also belong on the developer's machine.
What changes
cargo build+cargo installcompile, no cacheSwatinem/rust-cache,--helpcheckworkflow_dispatchcargo installreuses the build (--target-dir target)commitsjob (cog check)commit-msghook (cog verify)hk.pkl: gitleaks, private keys, merge markers, large files, typos, jactionlint,cargo fmt, whitespace and final newlines on commit; Clippy (-D warnings) on pushmise installinstalls the pinned tools and the hooks (postinstall)..github/jactionlint.yamlaccepts two findings with reasons: the global npm install in the docs build and the Homebrew tap deploy key.mix format. They report many existing findings today.Look at:
.github/workflows/release.yml. PRs now build one target only, so a macOS or arm64 build break shows up at release time.Evidence
hk check --all: all steps pass.jactionlint2.6.0 on both workflows: no findings.cargo clippy --workspace --all-targets -- -D warnings: passes.cog verifyrejectsbad messageand accepts a valid message. The hooks ran on every commit of this branch.Merge danger
Door: two-way
Blast radius: CI
Commits made outside a machine with hk installed (web UI, bots) no longer get a commit-message check before merge. A bad one makes
cog bumpfail at release time.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.