Skip to content

CI: firmware and module workflows check what a change can reach - #232

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

bdbarnett merged 1 commit into
mainfrom
ci/scope-changes

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The firmware workflow built every cell when a pull request touched only the page stager or a test, and the module workflows (CircuitPython unix and ESP32-P4 builds, one workflow per module) ran for README and example edits, which no build reads. In October these workflows used about 7,400 runner-minutes.

What changes

  • Release firmware. A pull request now builds what its change can reach. scripts/ci_scope.py firmware reads the diff: the page stager, the pin script and the test files build nothing (the gate job still runs their unit tests); a change to one cell's row in CELLS builds that cell (release_firmware.py matrix --only); anything else in release_firmware.py, a cell added or removed, or the workflow builds the whole set. The assemble job checks a whole set, so it runs only then. A manual or weekly run, and a base git can't find, build everything as before.
  • circuitpython.yml. Its three jobs gate on scripts/ci_scope.py circuitpython. unix (pygraphics, fetched from modules.lock) no longer runs for a change inside modules/; unix_modules runs for the modules it names, not for audioif, picotts, tflite or vision; esp32p4-usbhost runs for usbhost sources, not its tests or tools. MicroPython's patches, its pin and TinyUSB's patches reach none of them.
  • Eleven module workflows (audioif, cameraif, castif, displayif, h264enc, jpegio, mdns, picotts, pngio, ppa, tsmux) skip a module's top-level markdown, and its docs/ and examples/ where no check reads them. usbhost keeps all of its paths, because its tests read the examples and the READMEs, and cameraif keeps its examples, which it lints.
  • Only pull request runs cancel each other, on every workflow touched. A weekly run checks all of them in full.

Replay

Pushes to main, the last 40 commits compared with their first parents, minutes from the real runs (a scope job adds about a minute to circuitpython.yml):

Of the 40 commits, 31 cost less (README, example and docs commits 9-26 minutes before and 0-4 after; module source commits 9-23 before and 3-19 after) and 9 cost the same, to within the minute the scope job adds (build_mp.py, modules.lock, patches, the workflows and library changes). Four commits that touched only module docs ran nothing.

Together 522 runner-minutes before and 262 after, plus about 20 for the scope jobs.

Release firmware pull requests in October (33 runs, 1,698 job-minutes), each PR's diff run through the new rule with the cells' real build minutes: 22 runs change the workflow or code outside CELLS and still build everything, 10 change a cell row and build only that cell (for example 74 minutes became 10 for a cp-p4-devkit change), and 1 changes only the stager. 1,698 minutes became about 1,295.

Planted faults

  • A compile error in modules/usbhost/src/: the scope keeps unix_modules and usbhost, the two jobs that compile it.
  • A wrong flash size in the mp-s3-lcd43 row: the scope builds that cell only (test_one_cells_row_builds_that_cell); a change to a CELLS helper builds all ten.
  • A README or example edit runs nothing; a change in build_mp.py, modules.lock or patches/circuitpython/ still runs all three jobs.

Testing

test_ci_scope.py (14 tests) holds the job rules, the cell diff read with ast, and the fallbacks. test_release_firmware and test_stage_firmware_page still pass (44). actionlint reports only the shellcheck notes the workflows already had. The gate job runs the new tests, and this PR touches the workflow, so its own run builds the whole set.

Not changed

windows-native and the jobs that run on patches/** keep their paths: the series is applied to every port. The weekly full runs cost about 50 runner-minutes a week across the module workflows.

@bdbarnett
bdbarnett merged commit c79733c into main Oct 31, 2026
32 checks passed
@bdbarnett
bdbarnett deleted the ci/scope-changes branch October 31, 2026 05:53
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