Skip to content

ci: post a per-target memory usage report on PRs (like arduino-esp32's size-deltas bot) #4920

Closed

Description

@zackees

Goal

Post a sticky memory usage comment on each PR, comparing the PR against its merge base on every target. It should look like the bot espressif/arduino-esp32 runs (example: the github-actions comment on espressif/arduino-esp32#13010).

How Espressif does it

  • Building: .github/workflows/push.yml → .github/scripts/sketch_utils.sh builds the test sketches with arduino-cli. It writes a cli_compile_<chunk>.json sizes file (flash/RAM per target/sketch) and uploads it as the pr_cli_compile_* artifacts. Master's sizes live on their gh-pages branch.
  • Reporting: .github/workflows/publishsizes.yml runs on workflow_run after "Compilation Tests". It downloads the PR artifacts next to the master JSON and calls P-R-O-C-H-Y/report-size-deltas@sizes_v2, a fork of arduino/report-size-deltas. That action renders the DEC/INC table with 💚/⚠️ markers and a collapsible detailed-deltas section.
  • The workflow_run split exists so that fork PRs, which get a read-only token, can still receive a comment.

Strategy for FastLED

Most of this already exists, so we don't need the arduino-cli JSON format or the third-party action:

  • ci/bloat.py <board> --build --no-summary already writes .build/symbols/<board>/report.json, with image_flash (allocated ELF image, from fbuild symbols) and total_ram. This works on every fbuild board; it was verified on uno.
  • New ci/memory_report.py: collect measures the given boards into a JSON file, and render turns a base/head pair into the markdown table. It is unit-tested in ci/tests/.
  • New .github/workflows/memory_report.yml:
    • Runs on same-repo PRs that touch src/**, plus workflow_dispatch.
    • One matrix job per board builds examples/Blink at the merge base, then at the PR head.
    • A final job renders the table and creates or updates a single marker-tagged comment through gh api.
  • FastLED already hard-blocks fork PRs on board jobs (ci: prevent fork PRs from auto-triggering the full CI matrix (cost control — surfaced by #2752) #2757), so the plain pull_request token with pull-requests: write is enough. No workflow_run split is needed.
  • Report only, never gate. The hard gates stay where they are: check_uno_size.yml and bloat_regression_esp32s3.yml.

Targets (besides AVR Uno)

These cover every major toolchain/architecture family FastLED ships:

Board Why
uno AVR baseline, already size-gated
attiny85 smallest AVR; every byte matters
esp32dev Xtensa LX6, the most common ESP32
esp32s3 Xtensa LX7, primary dev board, has the bloat gate
esp32c3 RISC-V ESP32
esp32c6 RISC-V ESP32, newer IDF path
teensy41 Cortex-M7
rp2040 Cortex-M0+ (Pico)
nrf52840_dk Cortex-M4F nRF52
stm32f103c8 Cortex-M3 STM32 (Blue Pill)

Later candidates: esp8266, samd21, esp32p4, teensylc, wasm (.wasm size).

Activity

  1. added
    area: ci
    on Oct 26, 2026
  2. zackees commented on Oct 26, 2026

    @zackees
    MemberAuthor

    Decision on CI time (implemented in #4921): only AVR (uno, attiny85) runs by default, on every same-repo PR that touches src/. Those toolchains download fast and the builds take seconds. The ESP32/Teensy/RP2040/nRF52/STM32 targets in the table above are opt-in via ci-full, ci-test:bloat, or ci-platform:<board>, because their toolchain downloads dominate the job time.

  3. moved this from Triage to Done in FastLED Trackeron Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions