Skip to content

ci: skip checks and captures for an already-tested tree - #10

Merged
farhan-syah merged 1 commit into
mainfrom
ci/skip-redundant-runs
Oct 24, 2026
Merged

farhan-syah merged 1 commit into
mainfrom
ci/skip-redundant-runs

Conversation

@farhan-syah

Copy link
Copy Markdown
Member

Summary

Stops CI from repeating work it has already done.

  • Branch-push trigger removed (ci.yml): each PR commit used to run CI twice, once for push and once for pull_request. Branch pushes without a PR now run nothing. "Run workflow" still runs on demand.
  • Content-keyed results:
    • CI uploads a marker artifact ci-pass-<tree> on success, where <tree> is the tree of the PR's merge commit.
    • Screenshots uploads screenshots-<key>. The key hashes only the files that decide the pixels.
  • Merges reuse PR results: on a push to main, a short gate job looks up the key first.
    • Merge leaves the tree or key unchanged: CI skips the checks, and Screenshots publishes the PR's artifact with no new capture.
    • main moved under the PR: both run in full.
  • Path filters:
    • CI ignores docs, licence files, label config, and the screenshot workflow and scripts.
    • Screenshots runs only when nodedb-studio/, Cargo.toml, Cargo.lock, its scripts, or its workflow change.
  • Concurrency: a newer push to the same PR, or to main, cancels the run it supersedes.

Notes

  • YAML anchors: path lists are shared between triggers. This PR's own run is the first check that GitHub accepts the files.
  • Marker retention: markers expire after 30 days. A PR merged after that runs CI once on main.
  • First merge recaptures: feat(screenshots): capture every screen to PNG in CI #9's artifact used the old name screenshots, so the first merge after this one recaptures once.

Test plan

  • On this PR, CI runs gate then check, and uploads ci-pass-<tree>.
  • On this PR, Screenshots runs key, capture, and report.
  • After merge, CI on main shows check skipped.
  • After merge, Screenshots on main skips capture and publish reuses the PR's artifact.

CI now runs on pull requests and on pushes to main only. A gate job
looks up a marker artifact keyed by the git tree. A merge whose tree a
pull request already tested skips fmt, clippy, and tests. Docs-only
changes run nothing.

The screenshot workflow keys each capture by a hash of the files that
decide the pixels. A source state is captured once, and the pull
request report and the main publish step reuse the artifact for that
key. Changes outside those files run nothing. Newer pushes cancel the
runs they supersede.
@farhan-syah
farhan-syah merged commit 8b37a4b into main Oct 24, 2026
6 checks passed
@farhan-syah
farhan-syah deleted the ci/skip-redundant-runs branch October 24, 2026 21:25
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