Skip to content

Add build CI for changed apps - #248

Merged
mishamyte merged 1 commit into
devfrom
ci/pr-build
Jul 26, 2026
Merged

Add build CI for changed apps#248
mishamyte merged 1 commit into
devfrom
ci/pr-build

Conversation

@mishamyte

Copy link
Copy Markdown
Collaborator

Adds the build check this repo has been missing - right now nothing verifies that an app still compiles before it is merged.

What it does

Walks the PR diff down to pack/appname directories and builds only the apps that changed. The pack carries 321 apps (75 base / 64 catalog / 182 non-catalog) so building everything per PR is not viable; a typical PR touches one.

Each app is built with standalone ufbt against the Unleashed SDK - the same index and channel used locally:

ufbt update --index-url https://up.unleashedflip.com/directory.json --channel dev --hw-target f7

Built .faps are uploaded as artifacts, and the run summary carries a per-app pass/fail table.

Phase 1 is deliberately report-only

The build step is continue-on-error: true, so a failing app shows in the summary but does not block a merge.

This is on purpose. Some apps in non_catalog_apps/ need firmware-internal headers - assets_icons.h, lib/subghz/protocol_items.h - that only exist when the app is compiled downstream in the firmware tree, and can never build standalone. Guessing which of the 182 those are up front would silently skip apps that build fine. Instead the summary collects the real list, the failures go into .github/no-standalone-build.txt, and then deleting one continue-on-error line turns this into a genuine merge gate. That is a small follow-up PR once there is data.

Safety

pull_request, never pull_request_target - this compiles code straight from the PR, so it must run with the fork's read-only token and no secrets. contents: read only, persist-credentials: false on both checkouts, and every PR-derived value is read through env: instead of being interpolated into a run: body.

What I verified, and what I did not

Verified: YAML parses; the ufbt flags (--index-url, --channel, --hw-target) are real, checked against the local CLI; the SDK channel matches a working local install; and the changed-app detection was dry-run against the real tree - it selects apps across all three packs, drops directories with no application.fam (deleted apps, files moved out of an app), and honours the skip list including comment and blank lines.

Not verified: the actual ufbt build on a GitHub runner. Note this workflow is paths-filtered to the three pack directories, so it will not run on this PR, which only touches .github/. After merge, smoke-test it with the "Run workflow" button - the workflow_dispatch input takes an explicit app list, e.g. base_pack/tetris_game apps_source_code/4inrow_game - before relying on it.

🤖 Generated with Claude Code

Build every app a PR touches with standalone ufbt against the Unleashed
SDK, so a change that does not compile is caught before merge. The pack
has 300+ apps, so the workflow walks the PR diff down to pack/appname
directories and builds only what changed.

Some apps need firmware-internal headers and can only be compiled inside
the firmware tree; those go in .github/no-standalone-build.txt and are
skipped. The list starts empty on purpose - phase 1 is report-only, so
the run summary shows which apps actually fail and the list can be filled
in from real data instead of guesswork. Dropping the continue-on-error
line then turns this into a real merge gate.

Uses pull_request, never pull_request_target: this compiles code straight
from the PR and must run with a read-only token and no secrets.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mishamyte
mishamyte merged commit 036bbff into dev Jul 26, 2026
2 checks passed
@mishamyte
mishamyte deleted the ci/pr-build branch July 26, 2026 10:27
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.

1 participant