Skip to content

feat(audience): per-platform build size check in CI#803

Merged
nattb8 merged 1 commit into
mainfrom
feat/sdk-540-build-size-ci
Jun 26, 2026
Merged

feat(audience): per-platform build size check in CI#803
nattb8 merged 1 commit into
mainfrom
feat/sdk-540-build-size-ci

Conversation

@nattb8

@nattb8 nattb8 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

We had no way to tell customers how large the Audience SDK is, and no guardrail to catch it growing. Now every Audience PR gets a size comment:

```

Audience SDK — Build Size

Platform Build Size vs Baseline
Android 14.2 MB +0.0 MB
Windows 47.8 MB +0.1 MB
iOS 31.4 MB +0.1 MB
macOS 38.2 MB +0.1 MB

Fails if any platform exceeds its absolute size limit.
```

The comment always posts. It only blocks merge once you set a maxBytes per platform in .github/audience-build-budget.json. Limits are absolute, not delta-based, so an intentional 500 KB bump is fine as long as the total stays under the ceiling.

How each platform builds

  • Android + Windows: GameCI on ubuntu (Windows added to the existing mobile-build matrix, no new runners)
  • iOS: self-hosted macOS, Unity → Xcode project → xcodebuild CODE_SIGNING_ALLOWED=NO (no Apple certs)
  • macOS: self-hosted macOS, Unity → .app directly

Budget file .github/audience-build-budget.json: baselineBytes feeds the delta column, maxBytes is the hard limit. Both start at 0 (disabled) until set from the first real run.

When the check runs build-size-check needs all three build jobs to succeed. If any is skipped or failed it skips too. The three share triggers, so all run on an Audience PR and all skip on a no-change or fork PR. mobile-build is a fail-fast: false matrix (Android/iOS/Windows), so one failed leg fails the job and skips the check.

mobile-build build-size-ios build-size-macos build-size-check
success success success runs
success skipped success skipped
success failed success skipped
skipped skipped skipped skipped

How the gate decides ci-gate checks two things, because a skipped build-size-check can't tell a broken build from a no-op:

  • mobile-build, build-size-ios, build-size-macos directly catch broken builds.
  • build-size-check catches over-budget builds (it's the only job that measures and calls setFailed).
  • skipped passes, so no-change PRs are clean.

Test plan

  • Trigger workflow_dispatch on main to get real numbers (written to the job summary)
  • Set baselineBytes and maxBytes per platform and commit to main
  • Open a test PR, confirm the comment appears and updates in place on re-run
  • Confirm a PR exceeding maxBytes is blocked

Closes SDK-540

🤖 Generated with Claude Code

@nattb8 nattb8 requested review from a team as code owners June 25, 2026 01:56
@nattb8 nattb8 force-pushed the feat/sdk-540-build-size-ci branch 4 times, most recently from 1171057 to 43d1306 Compare June 25, 2026 04:19
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

Audience SDK — Build Size

Platform Build Size vs Baseline
Android 0.00 MB +0.00 MB
Windows 51.38 MB +51.38 MB
iOS 47.29 MB +47.29 MB
macOS 91.86 MB +91.86 MB

No size limits set yet. Set baselineBytes and maxBytes in .github/audience-build-budget.json.

Comment thread .github/workflows/test-audience-sample-app.yml Outdated
Comment thread .github/workflows/test-audience-sample-app.yml
@nattb8 nattb8 force-pushed the feat/sdk-540-build-size-ci branch from 43d1306 to daee102 Compare June 25, 2026 23:55
JCSanPedro
JCSanPedro previously approved these changes Jun 26, 2026
Comment thread .github/workflows/test-audience-sample-app.yml
@nattb8 nattb8 force-pushed the feat/sdk-540-build-size-ci branch 2 times, most recently from 95361b9 to d122e43 Compare June 26, 2026 00:55
Every Audience PR now gets a comment showing the build size for Android,
iOS, Windows, and macOS, with a delta against a committed baseline.

Android and Windows build on ubuntu via GameCI (Windows added to the
existing mobile-build matrix). iOS and macOS build on the self-hosted
macOS ARM64 runner: iOS via Unity batch mode then xcodebuild with
CODE_SIGNING_ALLOWED=NO (no Apple certs needed), macOS via Unity batch
mode directly.

Size limits are absolute (not delta-based) and configured per-platform
in .github/audience-build-budget.json. Limits default to 0 (disabled)
until set after the first real run on main. The comment always posts
regardless — the sizes are visible even before limits are configured.

After merging: run workflow_dispatch on main, record the four byte
counts, then set baselineBytes and maxBytes in the budget file and
commit to main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nattb8 nattb8 force-pushed the feat/sdk-540-build-size-ci branch from d122e43 to 96cdca6 Compare June 26, 2026 01:04
@nattb8 nattb8 requested a review from JCSanPedro June 26, 2026 02:57
@nattb8 nattb8 merged commit 52326c3 into main Jun 26, 2026
113 of 129 checks passed
@nattb8 nattb8 deleted the feat/sdk-540-build-size-ci branch June 26, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants