Skip to content

CI runs the jobs a pull request's files need - #368

Draft
berkgeveci wants to merge 1 commit into
Kitware:mainfrom
berkgeveci:ci/path-filter
Draft

berkgeveci wants to merge 1 commit into
Kitware:mainfrom
berkgeveci:ci/path-filter

Conversation

@berkgeveci

Copy link
Copy Markdown
Collaborator

An experiment. Not to merge before the 0.7 release.

A changes job sorts the pull request's changed files into groups (tools/ci_changes.py, first match wins). Each job then runs only if its group is needed; the others report "skipping". Pushes to main and runs started by hand run everything.

What the PR changes Jobs that run
docs/, mkdocs.yml, overrides/, Markdown outside the packages lint, docs
packages/*/examples/ lint, examples
tools/, changelog.d/, archive/, LICENSE lint only
package code or tests, pyproject.toml, uv.lock, conftest.py, test-durations.json, .github/, benchmarks/ everything, Metal included
anything not listed everything
  • Docs-only changes still run the package tests that read the docs pages. Those are test_reference_pages.py and test_every_algorithm_has_a_wrapper, and the docs job now runs them too.
  • benchmarks/ counts as code because test_threading_benchmark.py runs a script from it.
  • How the changed files are found: the job checks out the PR's merge commit at depth 2 and diffs it against its first parent, the base. No third-party action is involved.
  • Documented in CONTRIBUTING.md and CLAUDE.md.
  • This PR's own run will run everything, because it changes ci.yml. Seeing the filter skip anything needs a docs-only PR stacked on this one.

Checked locally: actionlint, ruff, the tools tests (including the new test_ci_changes.py) and the docs-reading tests.

🤖 Generated with Claude Code

A `changes` job classifies the changed files (tools/ci_changes.py):
docs alone run lint and the docs build, which now also runs the package
tests that read its pages; an example, lint and the examples; anything
in the packages, the build or the workflows, everything. A path no rule
names counts as code. Pushes to main and runs by hand run everything.

This branch has not been deployed

No deployments
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