From cedd070bfe59356cca4ac474da523be94ac4bff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl?= Date: Tue, 4 Aug 2026 11:04:07 +0200 Subject: [PATCH] ci: rely on the runner image for the Android SDK Drops the setup-android step from the release job and gates the swapfile resize, which needs a hosted runner image and passwordless sudo. --- .../healthchat-release-playstore.yml | 20 ++++++++----------- .github/workflows/tests.yml | 3 +++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/healthchat-release-playstore.yml b/.github/workflows/healthchat-release-playstore.yml index ba804f3972..734ff52ba9 100644 --- a/.github/workflows/healthchat-release-playstore.yml +++ b/.github/workflows/healthchat-release-playstore.yml @@ -183,18 +183,14 @@ jobs: distribution: 'temurin' java-version: '21' - # The self-hosted runner image has no Android SDK (unlike GitHub-hosted - # ubuntu-latest), so install it here. - # - platform: follows COMPILE_SDK in plugins/src/main/kotlin/Versions.kt. - # Platform packages are minor-versioned, so compileSdk 37 is android-37.0. - # - build-tools: nothing sets buildToolsVersion, so AGP picks its own - # default (SdkConstants.CURRENT_BUILD_TOOLS_VERSION). Bump it when AGP is - # upgraded, not when Versions.kt changes. - - name: Set up Android SDK - uses: android-actions/setup-android@v3 - with: - packages: 'platforms;android-37.0 build-tools;36.0.0' - + # The Android SDK now comes from the self-hosted runner image, so there is no + # setup-android step here. The image must provide it AND export ANDROID_HOME to + # the job environment — Gradle fails with "SDK location not found" otherwise. + # The image also has to carry the platform matching COMPILE_SDK in + # plugins/src/main/kotlin/Versions.kt (platform packages are minor-versioned, so + # compileSdk 37 means android-37.0) and the build-tools version AGP defaults to + # (SdkConstants.CURRENT_BUILD_TOOLS_VERSION), since nothing sets buildToolsVersion + # here. Both need refreshing in the image when AGP or COMPILE_SDK moves. - name: Configure gradle uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02d03880c6..fca7e8b63f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: # Increase swapfile size to prevent screenshot tests getting terminated # https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749 - name: 💽 Increase swapfile size + # /mnt/swapfile is a GitHub runner-image path and this needs passwordless sudo, + # so it only applies to the hosted VMs. + if: runner.environment == 'github-hosted' run: | sudo swapoff -a sudo fallocate -l 8G /mnt/swapfile