From 0932c1d8ea682d3e5eae5be6adf14abd550d4359 Mon Sep 17 00:00:00 2001 From: Simon Sestak Date: Tue, 8 Sep 2026 13:14:02 +0200 Subject: [PATCH 1/2] feat(android-cloud-check): RUNS_ON, in-job Android SDK and Kotlin/Native 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 Claude-Session: https://claude.ai/code/session_01L9gziD9cVTJLX1oB8ZL73c --- .github/workflows/android-cloud-check.yml | 30 ++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android-cloud-check.yml b/.github/workflows/android-cloud-check.yml index 17a5341..e72d9b4 100644 --- a/.github/workflows/android-cloud-check.yml +++ b/.github/workflows/android-cloud-check.yml @@ -39,6 +39,21 @@ on: required: false type: string default: "" + RUNS_ON: + description: "Runner label for the job, for example `ubuntu-latest` (default) or `self-hosted` to run the checks on the mac runners" + required: false + type: string + default: ubuntu-latest + ANDROID_SDK_PACKAGES: + description: "When set, installs the Android SDK in the job (android-actions/setup-android) with these sdkmanager packages, for runners whose image has no SDK, for example `platforms;android-36 build-tools;36.0.0 platform-tools`" + required: false + type: string + default: "" + KOTLIN_NATIVE_CACHE: + description: "Caches ~/.konan/dependencies (LLVM, libffi) between runs; for KMP projects checked on macOS, where the Kotlin/Native toolchain downloads them on every fresh runner" + required: false + type: boolean + default: false secrets: GRADLE_CACHE_ENCRYPTION_KEY: @@ -51,7 +66,7 @@ on: jobs: test: name: Lint & Tests - runs-on: ubuntu-latest + runs-on: ${{ inputs.RUNS_ON }} timeout-minutes: ${{ inputs.TIMEOUT_MINUTES }} env: GRADLE_OPTS: ${{ inputs.GRADLE_OPTS }} @@ -66,6 +81,19 @@ jobs: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} gradle_cache_encryption_key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + - 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') }} - name: Run checks uses: futuredapp/.github/.github/actions/android-check@2.4.6 with: From af7bba063decfaccb4fbead51a06e535e1b1825c Mon Sep 17 00:00:00 2001 From: Simon Sestak Date: Tue, 6 Oct 2026 15:34:09 +0200 Subject: [PATCH 2/2] refactor(android-setup-environment): move Android SDK setup and Kotlin/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 --- .../android-setup-environment/action.yml | 27 ++++++++++++++++++- .github/workflows/android-cloud-check.yml | 15 ++--------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/actions/android-setup-environment/action.yml b/.github/actions/android-setup-environment/action.yml index ad61094..787474a 100644 --- a/.github/actions/android-setup-environment/action.yml +++ b/.github/actions/android-setup-environment/action.yml @@ -1,5 +1,5 @@ name: Set up Android environment -description: Sets up Java, Gradle and Ruby and other preconditions for CI runs at Futured Android workflows. +description: Sets up Java, Gradle, Ruby, optionally the Android SDK and Kotlin/Native dependency cache, and other preconditions for CI runs at Futured Android workflows. inputs: # Java @@ -32,6 +32,16 @@ inputs: gradle_cache_encryption_key: description: "Configuration cache encryption key. Leave empty if you don't need cache." required: false + # Android SDK + android_sdk_packages: + description: "sdkmanager packages to install, eg. 'platforms;android-36 build-tools;36.0.0 platform-tools'. Leave empty to skip the SDK setup (runner image already has the SDK)." + required: false + default: '' + # Kotlin/Native + kotlin_native_cache: + description: "Whether to cache ~/.konan/dependencies (LLVM, libffi) between runs. Useful for KMP projects on fresh macOS runners." + required: false + default: 'false' runs: using: "composite" @@ -47,8 +57,23 @@ runs: with: java-version: ${{ inputs.java_version }} distribution: ${{ inputs.java_distribution }} + - name: Setup 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: Setup Gradle if: ${{ inputs.gradle == 'true' }} uses: gradle/actions/setup-gradle@v5 with: cache-encryption-key: ${{ inputs.gradle_cache_encryption_key }} + - name: Cache Kotlin/Native dependencies + if: ${{ inputs.kotlin_native_cache == 'true' }} + uses: actions/cache@v4 + with: + path: ~/.konan/dependencies + key: konan-deps-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/libs.versions.toml') }} + restore-keys: | + konan-deps-${{ runner.os }}-${{ runner.arch }}- diff --git a/.github/workflows/android-cloud-check.yml b/.github/workflows/android-cloud-check.yml index e72d9b4..8a76e19 100644 --- a/.github/workflows/android-cloud-check.yml +++ b/.github/workflows/android-cloud-check.yml @@ -81,19 +81,8 @@ jobs: java_version: ${{ inputs.JAVA_VERSION }} java_distribution: ${{ inputs.JAVA_DISTRIBUTION }} gradle_cache_encryption_key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - - 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') }} + android_sdk_packages: ${{ inputs.ANDROID_SDK_PACKAGES }} + kotlin_native_cache: ${{ inputs.KOTLIN_NATIVE_CACHE }} - name: Run checks uses: futuredapp/.github/.github/actions/android-check@2.4.6 with: