Skip to content

Commit 5fdaa59

Browse files
runningcodeclaude
andcommitted
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. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5e269de commit 5fdaa59

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/integration-tests-ui-critical.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ jobs:
7575
target: google_apis
7676
channel: canary # Necessary for ATDs
7777
arch: x86_64
78+
- api-level: "37.0" # Android 17; API 37 ships only as a minor-versioned image
79+
target: google_apis_ps16k # API 37 has no plain google_apis image
80+
channel: canary # Necessary for ATDs
81+
arch: x86_64
7882
steps:
7983
- name: Checkout code
8084
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -85,14 +89,31 @@ jobs:
8589
sudo udevadm control --reload-rules
8690
sudo udevadm trigger --name-match=kvm
8791
92+
# The runner ships an outdated avdmanager that writes target=android-0 into the
93+
# AVD config for minor-versioned packages (android-37.x), so the emulator clamps
94+
# to API 3 and boots misconfigured. Update cmdline-tools so avdmanager parses it.
95+
- name: Update SDK cmdline-tools
96+
id: cmdline-tools
97+
run: |
98+
SDK="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-/usr/local/lib/android/sdk}}"
99+
yes | "$SDK/cmdline-tools/latest/bin/sdkmanager" --install "cmdline-tools;latest" > /dev/null
100+
# sdkmanager won't overwrite the preinstalled dir, so it installs to latest-2.
101+
if [ -d "$SDK/cmdline-tools/latest-2" ]; then
102+
rm -rf "$SDK/cmdline-tools/latest"
103+
mv "$SDK/cmdline-tools/latest-2" "$SDK/cmdline-tools/latest"
104+
fi
105+
echo "version=$("$SDK/cmdline-tools/latest/bin/sdkmanager" --version 2>/dev/null | grep -Eo '^[0-9][0-9.]*' | head -1)" >> "$GITHUB_OUTPUT"
106+
88107
- name: AVD cache
89108
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
90109
id: avd-cache
91110
with:
92111
path: |
93112
~/.android/avd/*
94113
~/.android/adb*
95-
key: avd-api-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }}
114+
# Keyed on the cmdline-tools version so AVDs created by the old, broken
115+
# avdmanager are invalidated automatically.
116+
key: avd-api-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }}-tools${{ steps.cmdline-tools.outputs.version }}
96117

97118
- name: Create AVD and generate snapshot for caching
98119
if: steps.avd-cache.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)