ci: only build substrate when substrate changed, and supersede stale runs - #1108
Merged
Conversation
…runs This workflow runs on every pull request with no path filter, and every step of it works inside substrate-node: `cargo clean && cargo build --release`, `cargo test`, and the robot suite in substrate-node/tests. So a JS-only change queued a full Rust build that could not tell it anything. It also has one self-hosted runner and no concurrency group, so runs are strictly serial and every push adds another. Three JS-only branches with a few pushes each put thirteen runs in flight, most of them for commits that had already been superseded. Adds path filters and a per-ref concurrency group that cancels in-progress runs. Cancelling is safe here: a pull request is judged on its newest commit, and the older build's result was going to be discarded anyway. Note for later: `development` currently has no required status checks, so a path-filtered skip cannot block anything. If this job is ever made required, GitHub reports a skipped workflow as no status rather than success, and these filters would need revisiting.
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.
Three JS-only branches put thirteen CI runs in flight, most for commits that had already been superseded. Two causes, both in
010_build_and_test.yaml.No path filter
It triggers on every
pull_request, but every step works insidesubstrate-node:So a change to
activation-serviceorclients/tfchain-client-jsqueued a full Rust build that could not report anything about it. Filtered tosubstrate-node/**plus the workflow file.No concurrency group
One self-hosted runner (
tfchainrunner01) serves this, and the build opens withcargo clean, so runs are long and strictly serial. Every push added another to the queue while the earlier one was already irrelevant. Added a per-ref group withcancel-in-progress: true— safe, because a PR is judged on its newest commit and the older build's result was going to be thrown away.Two things I did not change
cargo cleanbeforecargo build --releasediscards what theactions/cachestep just restored, which is most of why each run is so long. Removing it would speed things up considerably, but it may be deliberate insurance against stale artifacts, so that is a call for whoever owns this pipeline.developmenthas no required status checks today, so a path-filtered skip cannot block a merge. Worth knowing that if this job is ever made required, GitHub reports a skipped workflow as no status rather than success, and these filters would need revisiting.🤖 Generated with Claude Code
https://claude.ai/code/session_011YKJm3zuWdSepriT9KL9zy