Skip to content

android-cloud-check: RUNS_ON, in-job Android SDK, Kotlin/Native cache - #121

Merged
matejsemancik merged 2 commits into
mainfrom
feat/android-check-runs-on-and-sdk
Oct 6, 2026
Merged

matejsemancik merged 2 commits into
mainfrom
feat/android-check-runs-on-and-sdk

Conversation

@ssestak

@ssestak ssestak commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Three optional inputs on android-cloud-check.yml so a consumer can run the Android lint + test gate on self-hosted macOS runners whose image has no Android SDK. Defaults keep today's behaviour (ubuntu-latest, no SDK step, no K/N cache).

Changes

  • RUNS_ON (string, default ubuntu-latest): runner label for the job.
  • ANDROID_SDK_PACKAGES (string, default empty): when set, android-actions/setup-android@v3 installs the SDK in the job with these packages and accepts the licences.
  • KOTLIN_NATIVE_CACHE (boolean, default false): actions/cache on ~/.konan/dependencies, keyed by libs.versions.toml - on macOS the KMP toolchain otherwise downloads LLVM + libffi (~1 min) on every fresh runner.

Diagram

Job steps with the new optional ones
flowchart LR
  C["Checkout"] --> E["android-setup-environment<br/>Java · Gradle · Ruby"]
  E --> S{"ANDROID_SDK_PACKAGES set?"}
  S -- yes --> SDK["android-actions/setup-android<br/>packages + licences"] --> K
  S -- no --> K{"KOTLIN_NATIVE_CACHE?"}
  K -- yes --> KC["actions/cache ~/.konan/dependencies"] --> R
  K -- no --> R["android-check<br/>lint → tests → Danger"]
  RO(["runs-on: RUNS_ON<br/>default ubuntu-latest"]) -.-> C
Loading

Notes

  • Measured on a self-hosted M4 VM (4 cores, 14 GB, no SDK in the image): SDK install 18 s, lintCheck 6.5 min, unit tests 1.7 min, versus 19 + 7 min on ubuntu-latest.
  • Platform package names follow the new SDK scheme (platforms;android-37.0, not android-37).
  • Follow-up candidate: the same RUNS_ON on android-cloud-nightly-build.yml.

🤖 Generated with Claude Code

…ive cache inputs

Lets consumers run the Android checks on self-hosted macOS runners whose image has no Android SDK:
RUNS_ON picks the runner (default unchanged), ANDROID_SDK_PACKAGES installs the SDK in the job via
android-actions/setup-android, KOTLIN_NATIVE_CACHE keeps ~/.konan/dependencies between runs for KMP
projects that configure iOS targets on macOS. Measured in futuredapp/tetadrogerie-kmp: lintCheck 6.5 min
and tests 1.7 min on an M4 VM vs 19 and 7 min on ubuntu-latest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9gziD9cVTJLX1oB8ZL73c
Comment on lines +84 to +96
- name: Set up Android SDK
if: ${{ inputs.ANDROID_SDK_PACKAGES != '' }}
uses: android-actions/setup-android@v3
with:
packages: ${{ inputs.ANDROID_SDK_PACKAGES }}
accept-android-sdk-licenses: true
log-accepted-android-sdk-licenses: false
- name: Cache Kotlin/Native dependencies
if: ${{ inputs.KOTLIN_NATIVE_CACHE }}
uses: actions/cache@v4
with:
path: ~/.konan/dependencies
key: konan-deps-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/libs.versions.toml') }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My spidey sense tells me this should be extracted into actions/android-setup-environment Action

…n/Native cache into the action

Review feedback on #121: the SDK install and ~/.konan/dependencies cache
were inlined in android-cloud-check.yml, but the action is used by eight
jobs and the same steps would be copied into the nightly build next.

- android-setup-environment: new optional inputs `android_sdk_packages`
  (empty = skip) and `kotlin_native_cache` (default 'false'), following
  the existing java/ruby/gradle toggle pattern. The K/N cache gets a
  `restore-keys` prefix so a Kotlin bump reuses the previous entry.
- android-cloud-check: pass the two workflow inputs through to the action
  instead of running the steps inline.

The workflow still references the action at 2.4.6; the ref gets bumped in
the usual follow-up PR once a new tag is cut.

Claude-Session: https://claude.ai/code/session_015HbhiukLQv71hkruK31fyT
@matejsemancik
matejsemancik merged commit b83a192 into main Oct 6, 2026
2 checks passed
@matejsemancik
matejsemancik deleted the feat/android-check-runs-on-and-sdk branch October 6, 2026 14:36
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