Conversation
`build_release_files.py` records each language build's flash usage in `sizes/<board>.json`, including sizes predicted for languages it skips. The board job uploads it as `zz-sizes-<board>` with one-day retention, and `build-ci` merges the records with the new `ci_firmware_sizes.py` into a `zz-sizes` artifact holding `sizes.json` and a sortable `sizes.html`, plus a job summary of the boards with the least free flash. The report steps continue on error so they cannot fail the gate. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`build-ci` copies the merged report to `bin/0-sizes/` on pushes to main
and release branches and on published releases. The files are named
`adafruit-circuitpython-sizes-<version>.{json,html}` like the firmware,
so the flat directory keeps a history that the usual version-glob
cleanup prunes. `ci_firmware_sizes.py` takes the version from
`--version` or `$CP_VERSION`, which `build-ci` now gets from the
scheduler job.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Each report is its own artifact with `archive: false`, so it opens directly instead of arriving in a zip; the file name is the artifact name. The S3 copies keep the versioned names. The job summary is now one line giving the board count and pointing at the two artifacts, instead of the abbreviated table. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`actions/download-artifact` matches its pattern against a listing of the run's artifacts that stops at 1000, and a full build has about 1350, so the report silently covered 486 of 673 boards. `ci_download_sizes.mjs` looks each `zz-sizes-<board>` up by name with `@actions/artifact`, from the board list the scheduler produced, and reports any board whose record is missing as a run annotation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
How big are the size files? Could you use job outputs instead? They are limited to 1MB per job and 50MB overall. https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idoutputs |
That was considered during the design phase, but artifacts worked out better. Job output consideration summary:
|
The artifact API token `ACTIONS_RUNTIME_TOKEN` is only given to action steps, not `run:` steps, so calling the script with `node` found no records at all. `ci_download_sizes.mjs` is now a module that an `actions/github-script` step imports and calls; the install of `@actions/artifact` stays a shell step. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The free-flash filter defaulted to "under 1 KiB", which shows an empty table when no board is that tight, as on main today. Default to "all"; the colour bands still mark the tight boards. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Claude wrote this: what was verified in Build CI run 35254751381, on commit 2682ba8.
|
|
Ready to review. Click on the |
Code by Claude, design and review by @dhalbert.
Build
.jsonand.htmlreports that list each board's firmware sizes.How
build_release_files.pyrecords each language build insizes/<board>.json. The board job uploads it as an artifact namedzz-sizes-<board>with one-day retention. Thezz-prefix sorts them after the boards in the artifact list. The sizes file records, per language:A new script
tools/ci_firmware_sizes.pymerges the records into:0-sizes.jsonfor use by other tools0-sizes.html, which is a table of every board's free flash for the largest translation build. It has user-sortable columns and filtering. The data is embedded in the page so it can stand alone.ci_firmware_sizes.pyalso adds one line to the job summary giving the number of boards built and pointing at the two reports.build-cifetches the per-board records with a small Node script,tools/ci_download_sizes.mjs, which looks eachzz-sizes-<board>up by exact name from the scheduler's board list.actions/download-artifactmatches a pattern against a listing of the run's artifacts that stops at 1000, and a full build has about 1350, so the first run of this PR silently reported 486 of 673 boards. The script is JavaScript because the only supported client for the artifact service outside the REST API, which is rate-limited to 1000 requests per hour per repository, is the@actions/artifactlibrary.The
build-cijob runs the merge after the board jobs and uploads each report as its own artifact, unzipped, so0-sizes.htmland0-sizes.jsonopen directly from the run's artifact list. On pushes to main and release branches and on published releases it also copies them tos3://adafruit-circuit-python/bin/0-sizes/asadafruit-circuitpython-sizes-<version>.htmland.json, where the versioned names keep a history that the usual version-glob cleanup prunes.The report steps use
continue-on-error, so a reporting problem cannot fail the required check.