Skip to content

馃懛 Nightly Sizes: build every example, keep the flash used by each - #1222

Merged
thinkyhead merged 1 commit into
MarlinFirmware:import-2.1.xfrom
thinkyhead:nightly-sizes
Oct 21, 2026
Merged

thinkyhead merged 1 commit into
MarlinFirmware:import-2.1.xfrom
thinkyhead:nightly-sizes

Conversation

@thinkyhead

Copy link
Copy Markdown
Member

Description

"PR Test Build" only builds the folders a PR changes. When Marlin itself grows, an example that no PR touches can stop fitting in flash, and nobody sees it until the next PR to touch that example fails. Nothing records how large each example is either.

This adds a scheduled workflow (daily 07:17 UTC, or by hand) that builds every example against the current bugfix-2.1.x:

  • plan: splits the 422 folders into shards of at most 30 (24 shards today). A shard holds one toolchain group, so it uses the cache that cache-pio.yml already saves.
  • build: each shard runs build-configs. All shards use the same Marlin commit, even if bugfix-2.1.x moves during the run.
  • manifest: merges the results into sizes.tsv (the sizes artifact, 90 days), compares it with the previous run, and writes the job summary.

The summary lists failures (marking new ones), configs fixed or added since the previous run, the median size change per environment (Marlin's own growth, not one example's), the biggest changes in a single config, the configs within 2 KB of the flash limit, and a link to the Marlin commits since the last run.

The run fails if a config fails to build or a shard doesn't finish. It needs no write permission, only actions: read to find the previous manifest. A run started by hand takes a regex to build only some folders (saved as sizes-partial, so it isn't used as the baseline).

The planning, merging and report are in .github/scripts/size-manifest.

Testing

  • Planned against the real 422 folders: 24 shards, 12 toolchain groups.
  • Ran on a fork twice with a four-pattern filter (7 configs, 3 shards): the first run built all 7, the second compared with it and reported no change. My first trial found a bug (every shard saved results.tsv, so merging overwrote them), which is fixed.
  • actionlint is clean.
  • Not yet run here: the full build of all 422 configs, or the scheduled trigger. Expect the first full run to take a few hours of runner time across the shards.

Problem: "PR Test Build" only builds the folders that a PR changes. When
Marlin itself grows, an example that no PR touches can stop fitting in
flash, and nobody sees it until the next PR to touch that example fails.
There is also no record of how large each example is, so a jump in the
base size of the firmware is only found when something overflows.

Solution: A scheduled workflow builds every example against the current
bugfix-2.1.x, in shards of 30 that each use one toolchain group (and its
cache from cache-pio.yml). Each shard reports with build-configs. A final
job merges the results into a manifest (the "sizes" artifact, 90 days),
compares it with the previous night's, and writes the job summary:

- configs that fail, marking the new ones,
- the median size change of each environment, which is Marlin's own growth
  and not one example's,
- the biggest changes in a single config,
- the configs within 2 KB of the flash limit,
- a link to the Marlin commits since the previous run.

The run fails if a config fails to build or a shard doesn't finish.
It can also be started by hand with a regex to build just some folders.

The planning, merging and report are in .github/scripts/size-manifest.
@thinkyhead thinkyhead added the GitHub Admin GitHub actions, templates, etc. label Oct 20, 2026
@thinkyhead
thinkyhead merged commit a28ac7f into MarlinFirmware:import-2.1.x Oct 21, 2026
2 checks passed
@thinkyhead
thinkyhead deleted the nightly-sizes branch October 21, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GitHub Admin GitHub actions, templates, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant