Skip to content

ci: only build substrate when substrate changed, and supersede stale runs - #1108

Merged
sameh-farouk merged 1 commit into
developmentfrom
ci/scope-substrate-build
Jul 26, 2026
Merged

ci: only build substrate when substrate changed, and supersede stale runs#1108
sameh-farouk merged 1 commit into
developmentfrom
ci/scope-substrate-build

Conversation

@sameh-farouk

Copy link
Copy Markdown
Member

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 inside substrate-node:

cargo clean && cargo build --release          # substrate-node
cargo test --features runtime-benchmarks      # substrate-node
robot -d _output_tests/ .                     # substrate-node/tests

So a change to activation-service or clients/tfchain-client-js queued a full Rust build that could not report anything about it. Filtered to substrate-node/** plus the workflow file.

No concurrency group

One self-hosted runner (tfchainrunner01) serves this, and the build opens with cargo 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 with cancel-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 clean before cargo build --release discards what the actions/cache step 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.

development has 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

…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.
@sameh-farouk
sameh-farouk requested a review from LeeSmet as a code owner July 26, 2026 15:25
@sameh-farouk
sameh-farouk merged commit 0b89f07 into development Jul 26, 2026
1 check failed
@sameh-farouk
sameh-farouk deleted the ci/scope-substrate-build branch July 26, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant