Repository navigation
CI: firmware and module workflows check what a change can reach - #232
Merged
Merged
Conversation
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.
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
scripts/ci_scope.py firmwarereads 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 inCELLSbuilds that cell (release_firmware.py matrix --only); anything else inrelease_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.scripts/ci_scope.py circuitpython.unix(pygraphics, fetched frommodules.lock) no longer runs for a change insidemodules/;unix_modulesruns for the modules it names, not for audioif, picotts, tflite or vision;esp32p4-usbhostruns for usbhost sources, not its tests or tools. MicroPython's patches, its pin and TinyUSB's patches reach none of them.docs/andexamples/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.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
CELLSand still build everything, 10 change a cell row and build only that cell (for example 74 minutes became 10 for acp-p4-devkitchange), and 1 changes only the stager. 1,698 minutes became about 1,295.Planted faults
modules/usbhost/src/: the scope keepsunix_modulesandusbhost, the two jobs that compile it.flashsize in themp-s3-lcd43row: the scope builds that cell only (test_one_cells_row_builds_that_cell); a change to aCELLShelper builds all ten.build_mp.py,modules.lockorpatches/circuitpython/still runs all three jobs.Testing
test_ci_scope.py(14 tests) holds the job rules, the cell diff read withast, and the fallbacks.test_release_firmwareandtest_stage_firmware_pagestill 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-nativeand the jobs that run onpatches/**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.