ci: install the Android SDK through one setup-android-sdk action

Merged
TH
5d ago
+177-115

Summary

TOOL2-5 (refs #4368). The sdkmanager install existed in six copies. They handled the yes SIGPIPE three different ways, and one of them (|| true) hid real licence failures. The build-tools version 36.0.0, which decides the helper APK bytes, was written nine times.

A new composite action, .github/actions/setup-android-sdk, now owns the version through its build-tools input. It exports AGENT_DEVICE_ANDROID_BUILD_TOOLS, outputs build-tools-dir, and installs only when a build-tools binary a caller runs (aapt aapt2 d8 zipalign apksigner) or the platform jar is missing. All six sites call it.

The fixture APK scripts read the exported version. A local repack outside CI uses the newest installed build-tools, and it refuses to run without the version when CI=true.

A repo guard keeps the version and sdkmanager inside the action. 12 files.

Validation

  • Tested SHA 819d1dd.
  • check:quick and check:fallow --base origin/main pass, and so do the new guard and test:fixture-cache (16/16, including build-tools version ordering and a missing SDK).
  • At 2295200: check:affected stopped at the 2 known container-only smoke-daemon-clean failures, and every remaining gate passed when run on its own. 819d1dd touches only the action's readiness check, the repack script and its test.
  • actionlint is clean on the changed files.
  • CI obligations: green runs of android.yml, size.yml and test-app-build-cache.yml (Android leg).
  • release.yml and release-android-snapshot-helper.yml run only after merge, so the next release run is their first proof.
  • Risk: a workflow_dispatch of the snapshot-helper workflow with a checkout_ref older than this action fails, because the action does not exist at that ref.

Generated by Claude Code


<a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796966815&installation_model_id=447842&pr_number=4400&ref=codesmith_pr_footer&repository=callstack%2Fagent-device&return_to=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4400&signature=3c7dbb95da9da01e1adcc23d3c07df48dac44735b450e18e918d560c4e67f04f"&gt;&lt;picture&gt;&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"&gt;&lt;img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"&gt;
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

<a href="https://www.cubic.dev/action/auto-fix/pr/callstack/agent-device/4400?returnTo=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4400&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true">&lt;source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"&gt;&lt;img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"&gt;


Generated by Claude Code