From e89fc0c158e91fe84af5b0c5b273c79fccd490eb Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 21 Jul 2026 15:17:38 +0200 Subject: [PATCH] ci: Add Android 37 emulator to critical UI test matrix (JAVA-647) Add an API level 37 (Android 17) emulator to the critical UI test matrix. API 37 ships only as a minor-versioned image, so the api-level is "37.0" (the platform and system image packages are android-37.0, not android-37) and only as google_apis_ps16k; there is no plain google_apis image. The runner's preinstalled avdmanager is too old to parse the minor version and writes target=android-0 into the AVD config, so the emulator clamps to API 3 and boots misconfigured. Update cmdline-tools before creating the AVD, and key the AVD cache on the tools version to invalidate broken caches. Workaround from ReactiveCircus/android-emulator-runner#482. Co-Authored-By: Claude Opus 4.8 --- .../integration-tests-ui-critical.yml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-ui-critical.yml b/.github/workflows/integration-tests-ui-critical.yml index f1f8e29a3a..1d054079f1 100644 --- a/.github/workflows/integration-tests-ui-critical.yml +++ b/.github/workflows/integration-tests-ui-critical.yml @@ -75,6 +75,10 @@ jobs: target: google_apis channel: canary # Necessary for ATDs arch: x86_64 + - api-level: "37.0" # Android 17; API 37 ships only as a minor-versioned image + target: google_apis_ps16k # API 37 has no plain google_apis image + channel: canary # Necessary for ATDs + arch: x86_64 steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -85,6 +89,22 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm + # The runner ships an outdated avdmanager that writes target=android-0 into the + # AVD config for minor-versioned packages (android-37.x), so the emulator clamps + # to API 3 and boots misconfigured. Update cmdline-tools so avdmanager parses it. + # See https://github.com/ReactiveCircus/android-emulator-runner/issues/482 + - name: Update SDK cmdline-tools + id: cmdline-tools + run: | + SDK="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-/usr/local/lib/android/sdk}}" + yes | "$SDK/cmdline-tools/latest/bin/sdkmanager" --install "cmdline-tools;latest" > /dev/null + # sdkmanager won't overwrite the preinstalled dir, so it installs to latest-2. + if [ -d "$SDK/cmdline-tools/latest-2" ]; then + rm -rf "$SDK/cmdline-tools/latest" + mv "$SDK/cmdline-tools/latest-2" "$SDK/cmdline-tools/latest" + fi + echo "version=$("$SDK/cmdline-tools/latest/bin/sdkmanager" --version 2>/dev/null | grep -Eo '^[0-9][0-9.]*' | head -1)" >> "$GITHUB_OUTPUT" + - name: AVD cache uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 id: avd-cache @@ -92,7 +112,9 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-api-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }} + # Keyed on the cmdline-tools version so AVDs created by the old, broken + # avdmanager are invalidated automatically. + key: avd-api-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }}-tools${{ steps.cmdline-tools.outputs.version }} - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true'