From 5ad56462eb2251daf80c3312ee4c46ad5c6dd108 Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 12 Oct 2024 17:00:15 +1100 Subject: [PATCH 1/3] Disable avd caching --- .github/workflows/main.yml | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d120b4ef..191918633 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: api-level: 34 target: aosp_atd arch: x86_64 - - os: ubuntu-24.04 + - os: ubuntu-lastest api-level: 35 target: google_apis arch: x86_64 @@ -56,14 +56,14 @@ jobs: distribution: 'zulu' java-version: 23 - - uses: actions/cache@v4 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - ~/.android/debug.keystore - key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }} + # - uses: actions/cache@v4 + # id: avd-cache + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # ~/.android/debug.keystore + # key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.arch }} - uses: gradle/actions/setup-gradle@v4 @@ -78,23 +78,23 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: run emulator to generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: ./ - with: - api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: ${{ matrix.arch }} - profile: Galaxy Nexus - cores: 2 - sdcard-path-or-size: 100M - avd-name: test - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - working-directory: ./test-fixture/ - channel: canary - script: echo "Generated AVD snapshot for caching." + # - name: run emulator to generate snapshot for caching + # if: steps.avd-cache.outputs.cache-hit != 'true' + # uses: ./ + # with: + # api-level: ${{ matrix.api-level }} + # target: ${{ matrix.target }} + # arch: ${{ matrix.arch }} + # profile: Galaxy Nexus + # cores: 2 + # sdcard-path-or-size: 100M + # avd-name: test + # force-avd-creation: false + # emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + # disable-animations: false + # working-directory: ./test-fixture/ + # channel: canary + # script: echo "Generated AVD snapshot for caching." - name: run action uses: ./ From 13d5a4f299c169e8426ecc2d09f1c8a63db9dff5 Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 12 Oct 2024 17:12:12 +1100 Subject: [PATCH 2/3] Create avd dir. --- lib/sdk-installer.js | 1 + src/sdk-installer.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index 21f355728..fe7f51385 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -63,6 +63,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk // add paths for commandline-tools and platform-tools core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); // set standard AVD path + yield io.mkdirP(`${process.env.HOME}/.android/avd`); core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`); // accept all Android SDK licenses yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`); diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index fa0ee16fa..f87028a6f 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -32,6 +32,7 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch: core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); // set standard AVD path + await io.mkdirP(`${process.env.HOME}/.android/avd`); core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`); // accept all Android SDK licenses From 7319626116d98b9fcf5130103ca130df693bb8df Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 12 Oct 2024 17:18:11 +1100 Subject: [PATCH 3/3] Revert avd caching. --- .github/workflows/main.yml | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 191918633..06c078931 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,14 +56,14 @@ jobs: distribution: 'zulu' java-version: 23 - # - uses: actions/cache@v4 - # id: avd-cache - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # ~/.android/debug.keystore - # key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.arch }} + - uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + ~/.android/debug.keystore + key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.arch }} - uses: gradle/actions/setup-gradle@v4 @@ -78,23 +78,23 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - # - name: run emulator to generate snapshot for caching - # if: steps.avd-cache.outputs.cache-hit != 'true' - # uses: ./ - # with: - # api-level: ${{ matrix.api-level }} - # target: ${{ matrix.target }} - # arch: ${{ matrix.arch }} - # profile: Galaxy Nexus - # cores: 2 - # sdcard-path-or-size: 100M - # avd-name: test - # force-avd-creation: false - # emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - # disable-animations: false - # working-directory: ./test-fixture/ - # channel: canary - # script: echo "Generated AVD snapshot for caching." + - name: run emulator to generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: ./ + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + profile: Galaxy Nexus + cores: 2 + sdcard-path-or-size: 100M + avd-name: test + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + working-directory: ./test-fixture/ + channel: canary + script: echo "Generated AVD snapshot for caching." - name: run action uses: ./