Skip to content

Add CI build workflow and root Makefile - #54

Merged
i12bp8 merged 2 commits into
i12bp8:mainfrom
Hoggormino:ci-build-workflow-and-makefile
Sep 17, 2026
Merged

i12bp8 merged 2 commits into
i12bp8:mainfrom
Hoggormino:ci-build-workflow-and-makefile

Conversation

@Hoggormino

@Hoggormino Hoggormino commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds automated builds for every deliverable in the repo plus a root Makefile so developers get one entry point for all three toolchains.

CI (.github/workflows/build.yml)

Runs on every pull request and every push to main (plus manual dispatch). Five independent jobs:

Job What it does
fap flipperzero-ufbt-action@v0.1, matrix over the release SDK channel (hard gate, matches firmware 1.4.3 / API 87.1 / f7) and the dev channel (allowed to fail, early warning for API breaks). Uploads dist/*.fap + debug ELF.
worker Node 22, npm ci, tsc --noEmit, wrangler deploy --dry-run bundle (no Cloudflare credentials needed). Uploads dist/index.js.
esp32 esp-idf-ci-action@v1 with the espressif/idf:v5.2.8 image, target esp32s2, then asserts the generated sdkconfig really resolved to the S2. Uploads the four flashable binaries + flasher_args.json.
web Extracts every inline <script> from web-image-prep/index.html and runs node --check on each, so a syntax error is caught before Pages deploys it.
lint ufbt lint, non-blocking: main currently fails clang-format because of the column-aligned macros/struct fields, and lint walks the non-FAP folders too.

There are deliberately no paths: filters: esp32-wifi-fw/shared/tt_wifi_proto.h is compiled into both the FAP and the ESP firmware, so a change on either side must rebuild both. PR runs cancel superseded runs; pushes to main never cancel.

Makefile

make / make help lists targets: setup, build-all, build-fap, build-worker, build-esp, launch, flash-esp, serve-web, lint, check-worker, clean, distclean. Works with the stock GNU Make 3.81 on macOS as well as 4.x. UFBT, IDF_PATH, ESP_PORT, WEB_PORT and friends are overridable. clean only removes generated outputs.

build-esp auto-detects the ESP-IDF Python virtualenv when exactly one ~/.espressif/python_env/idf5.2_py*_env exists, because export.sh otherwise looks for an env matching whatever python3 is first on PATH and fails on machines where Homebrew Python has moved on since install.sh ran.

Other changes

  • esp32-wifi-fw/sdkconfig.defaults: pins CONFIG_IDF_TARGET="esp32s2". Without it a fresh clone (or CI) runs idf.py build for plain esp32.
  • cloud-plugins/package.json: adds the build script (wrangler deploy --dry-run --outdir dist) the Makefile and CI rely on.
  • README: build badge and a "Development" section with the make targets. CONTRIBUTING: step 4 now points at make build-fap.
  • .gitignore: .venv/ and the .clang-format that ufbt lint generates.

Verification

  • Clean-room ESP32 build from tracked files only (no sdkconfig, only the new CONFIG_IDF_TARGET line): resolved to esp32s2, ESP-IDF v5.2.8, zero warnings, all four binaries produced, app at 32% headroom in its OTA slot.
  • make build-fap produces dist/tagtinker.fap (Target 7, API 87.1). Note: plain ufbt build only validates inside ~/.ufbt/build and never copies to dist/; the target runs bare ufbt, same as the CI action.
  • make build-worker type-checks and bundles (287 KiB); make build-esp succeeds with no manual environment variables.
  • build.yml: YAML parses; every uses: ref resolves upstream; every with: key was checked against the pinned action.yml files; the espressif/idf:v5.2.8 tag exists on Docker Hub; the inline-script checker passes on the current page and fails on an injected syntax error.
  • Makefile: no GNU Make 3.82+/4.x-only constructs; all make -n dry runs exit 0 with the expected commands.

Notes for reviewers

  • This exact commit has already run green on my fork: https://github.com/Hoggormino/TagTinker/actions/runs/34944982347 (release SDK 1.4.3 / API 87.1 → 88 KB .fap; dev SDK API 88.2 also builds; ESP32-S2 firmware 885 KB with target verified; worker bundle 287 KiB; web check 1/1 scripts OK; lint red-but-non-blocking as intended). Upstream CI is waiting for the first-time-contributor approval.
  • The dev-channel FAP job and the lint job show as red inside a green run when they fail. That is intentional.
  • wrangler 3.x warns that v4 is available; upgrading is out of scope here.

🤖 Generated with Claude Code

Hoggormino and others added 2 commits September 15, 2026 10:02
- .github/workflows/build.yml: build the Flipper FAP (ufbt, release + dev
  SDK channels), the Cloudflare Worker (tsc + wrangler dry-run bundle) and
  the ESP32-S2 firmware (ESP-IDF v5.2.8) on every push to main and every
  pull request; syntax-check the inline scripts of the web image-prep page;
  run `ufbt lint` as a non-blocking advisory job. No path filters, because
  the shared UART protocol header is compiled into both the FAP and the
  ESP firmware.
- Makefile: one entry point for developers (setup, build-all, build-fap,
  build-worker, build-esp, launch, flash-esp, serve-web, lint, clean).
  Works with the stock GNU Make 3.81 on macOS. Auto-detects the ESP-IDF
  Python virtualenv when export.sh would otherwise look for one matching
  a newer system python3.
- esp32-wifi-fw/sdkconfig.defaults: pin CONFIG_IDF_TARGET="esp32s2" so
  clean builds (CI, fresh clones) no longer fall back to plain esp32.
- cloud-plugins/package.json: add the `build` script (wrangler dry-run
  bundle) that the Makefile and CI rely on.
- README/CONTRIBUTING: document the make targets and CI; add a build badge.
- .gitignore: ignore .venv/ and the .clang-format generated by ufbt lint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Export IDF_TARGET=esp32s2 so ESP-IDF performs the same target consistency
  check locally that the CI action gets from its IDF_TARGET env: a stale
  sdkconfig generated for another chip is now refused instead of built.
- Print an absolute path in the export.sh failure hint; zsh does not
  tilde-expand VAR=~/path, so the old hint produced a literal "~".
- launch depends on build-fap and flash-esp on build-esp, so `make -j`
  cannot run two builders in the same tree.
- clean/distclean refuse to run outside the repository root (they delete
  cwd-relative paths).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants