Skip to content

CI: run the jobs a change can reach - #352

Merged
bdbarnett merged 1 commit into
mainfrom
ci/scope-changes
Nov 1, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
ci/scope-changes

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Lint, Test CPython and Clean standalone build each ran in full for every change that wasn't plain docs: about 80 runner-minutes per run, on both the pull request and the push to main. A release bump (VERSION and CHANGELOG.md) ran all of it, and so did a one-line example edit.

What changes

  • A scope step per workflow. tools/ci_scope.py diffs a pull request against its base and a push to main from the commit main was at before the push, and sets four outputs: lint, unit (the CPython matrix), wheels (cibuildwheel on macOS and ARM, the [render] extra) and build (the MicroPython unix build, the float cell, CMake configure). Each job gates on its output with a job-level if:.
  • What it skips. VERSION reaches nothing: the tests read __version__ from the file and compare it with no number. An example reaches only lint. A unit test reaches lint and the CPython matrix, not the interpreter build or the wheel jobs. A pump or parity probe reaches lint, the matrix and the build, not the wheel jobs. tests/circuitpython and tests/cmake reach only the build. Each workflow file reaches its own jobs; the release workflows reach none of them.
  • Everything else runs everything. src/, third_party/, lib/, setup.py, pyproject.toml, MANIFEST.in, the make and cmake files, the pins, a path no rule names, and the scope tool itself check every job. So does a manual run, a scheduled run, or a base git can't find (all zeros, or gone after a force push).
  • A weekly run (Monday) checks everything, for the drift no change touched.
  • Only pull request runs cancel each other. A push to main is never cancelled, so each merge keeps its own record. Until now nothing cancelled anything.
  • Docs-only changes still run nothing (the paths-ignore stays).

Replay

The last 25 commits on main, each compared with its first parent, which is what the push of that merge sees. Minutes are the job minutes of the real push runs, and "after" counts the jobs the new scope keeps (each workflow's scope job adds about a minute).

commits before after
release bump (VERSION, CHANGELOG.md) 7 79-86 min each, 4 runs scope jobs only
source, workflow or mixed change 14 78-85 min each the same
probe-only change (tests/parity) 1 82 min 75 min (no wheel jobs)
docs only 3 no run no run

Together: 1783 runner-minutes before, about 1270 after, a saving of 29 percent on this stretch. Most recent work is in src/, which can reach everything, so the saving is the release bumps. The pull requests for those bumps save the same again.

Planted faults

  • An undefined name in examples/audiodsp_simpletest.py: the scope keeps lint only, and flake8 fails (F821).
  • A failing assertion in tests/test_cpython_audiomath.py: the scope keeps lint and unit, and the unit run fails.
  • A change under src/ keeps all four.

Testing

tests/test_ci_scope.py (12 tests) holds the rules, the union over files, the fallbacks and the outputs file. actionlint reports the same five shellcheck notes on the old workflows and the new ones, none from these edits. This PR changes the workflows and the tool, so its own CI run is full.

@bdbarnett
bdbarnett merged commit 5fd2b24 into main Nov 1, 2026
34 checks passed
@bdbarnett
bdbarnett deleted the ci/scope-changes branch November 1, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant