Skip to content

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

Open
nattb8 wants to merge 1 commit into
mainfrom
feat/sdk-540-build-size-ci
Open

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

Conversation

@nattb8

@nattb8 nattb8 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Before this PR, we had no way to tell customers how large the Audience SDK is, and no guardrail to catch it accidentally growing. After merging and setting up baselines, every Audience PR will show a comment like this:

## 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 — sizes are visible even before limits are configured. The check only blocks merge once you set a maxBytes limit per platform in .github/audience-build-budget.json. Limits are absolute (not delta-based), so a PR that intentionally grows the SDK by 500 KB 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 ARM64, Unity batch mode to Xcode project then xcodebuild CODE_SIGNING_ALLOWED=NO — no Apple signing certs needed
  • macOS: self-hosted macOS ARM64, Unity batch mode directly to .app

Where sizes are recorded: .github/audience-build-budget.jsonbaselineBytes is the measured size from main (for the delta column), maxBytes is the hard limit. Both start at 0 (disabled) until set after the first real run.

Test plan

  • Merge and trigger workflow_dispatch on main to get real numbers
  • Set baselineBytes and maxBytes per platform in .github/audience-build-budget.json and commit to main
  • Open a test PR to confirm the size comment appears
  • Verify re-running CI updates the comment in place rather than posting a new one
  • Verify a PR that would exceed 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 3 times, most recently from ad6aa85 to 1171057 Compare June 25, 2026 03:24
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 1171057 to 43d1306 Compare June 25, 2026 04:19
@github-actions

Copy link
Copy Markdown

Audience SDK — Build Size

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

No size limits set yet. Run workflow_dispatch on main, measure the output, then set maxBytes in .github/audience-build-budget.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant