Repository navigation
ci: run only the jobs the changed paths can affect - #47
Merged
Merged
Conversation
A pull request that edits documentation, renovate.json, or a Rust tool CI never builds (row-vectors, vxbench-rs) ran the whole stack: three test suites, the package job and the cross-check, twenty minutes of runners for nothing they could catch. A first job sorts the changed paths into the jobs that read them: src/ and the tests run everything, README.md and NOTICE the package job that packs them, tools/conformance-gen and spec/ the cross-check, bench/ and samples/ the package job, documentation nothing. A path the table does not name runs everything, and so does any run other than a push or a pull request, the release run first. The trigger filters no path: the branch rule requires the checks job, and a workflow that never starts would leave it pending forever. The checks job now accepts a skipped job only when the first job said the change does not need it.
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.
Until now every pull request ran the whole stack: three test suites, the package job and the cross-check. That happened even when the PR only touched documentation,
renovate.json, or a Rust tool CI never builds. A new first job (choose the jobs the change needs) now sorts the changed paths into the jobs that read them:src/**(packed readmes and analyzer release notes included),tests/**, build config,build.yml, any path not listedREADME.md,NOTICE(packed into every package)tools/conformance-gen/**,spec/**bench/**,samples/**,tools/vxdump/**,tools/testimpact/**(in the solution, referenced by no test project)tools/native-ref/**(writes the Zstd test data)docs/**, other*.md,LICENSE,.gitignore,renovate.json, release-drafter config, issue templates,tools/row-vectors/**,tools/vxbench-rs/**,tools/pmu/**,tools/disasm.shgithub.event.before. Releases,workflow_dispatch, abeforethat cannot be fetched, or a failed diff all run everything.build, test and cross-check. A workflow that never starts never reports that check, so the PR would wait forever. The check still runs every time. It now accepts a skipped job only when the first job ran and said the change does not need it.fetch-depth: 2,filter: blob:noneand a sparse.github: two commits and their trees, no file contents.Tested locally against real history: #45 (renovate.json) and #41/#37 (vxbench-rs and row-vectors lockfiles) select no job. #38, #44 and #46 select only the cross-check, and #43 selects everything. The same holds for pull_request mode on
refs/pull/{44,46}/merge. The fallbacks (zerobefore, unfetchablebefore, release, dispatch) run everything.actionlintandzizmorpass.This PR touches
build.yml, so its own run takes every job.