Skip to content

ci: only run test suites for solvers changed in a PR#302

Merged
joglekara merged 1 commit into
mainfrom
ci/gate-tests-by-changed-paths
Jul 9, 2026
Merged

ci: only run test suites for solvers changed in a PR#302
joglekara merged 1 commit into
mainfrom
ci/gate-tests-by-changed-paths

Conversation

@joglekara

Copy link
Copy Markdown
Member

What

Stop running every solver's test suite on every PR. A new changes gate job maps the PR's changed paths to per-solver booleans (via dorny/paths-filter), and each test-* job now runs only when its solver's source, tests, or shared code changed.

There are a lot of solvers now, and running all of them on every commit is wasteful — this scopes CI to what a PR actually touches.

How it decides

  • Per-solver mapping: test-lpse2d runs iff adept/_lpse2d/**, adept/lpse2d.py, or tests/test_lpse2d/** changed (and likewise for the other five).
  • Shared/core catch-all (the "dependency" safety net): a shared filter is folded into every solver filter via a YAML anchor, so touching cross-cutting code runs all suites. It covers _base_.py, utils.py, functions.py, electrostatic.py, normalization.py, driftdiffusion.py, mlflow_logging.py, patched_mlflow.py, __init__.py, plus pyproject.toml, uv.lock, run.py, tests/conftest.py, the setup action, and this workflow itself. (driftdiffusion.py is imported by base/vlasov1d/vfp1d, hence shared.)
  • Full coverage on main: pushes to main and manual dispatches force the full matrix (run_all), so nothing is skipped on the protected branch.

Compatibility

  • Job names are unchanged (test-base, test-lpse2d, …), so any required status checks keep matching.
  • Gating is done per-job with if: (not a workflow-level paths: filter), so the workflow always triggers and skipped jobs report as passing — a PR can't get stuck waiting on a check that never runs.

Notes

🤖 Generated with Claude Code

Add a `changes` gate job (dorny/paths-filter) that maps changed paths to
per-solver booleans; each test job now runs only when its solver's source,
tests, or shared/core code changed. A `shared` filter (base/utils/functions/
electrostatic/normalization/driftdiffusion/mlflow, pyproject, uv.lock, run.py,
conftest, this workflow, the setup action) is folded into every solver filter
via a YAML anchor, so touching cross-cutting code still runs all suites.

Pushes to main and manual dispatches force the full matrix (run_all) for
complete coverage on the protected branch. Job names are unchanged so existing
required status checks keep matching; skipped jobs report as passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joglekara
joglekara merged commit 9478819 into main Jul 9, 2026
9 checks passed
@joglekara
joglekara deleted the ci/gate-tests-by-changed-paths branch July 9, 2026 00:02
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