diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 58bd4d22398e..dc00cfb53eca 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -98,6 +98,13 @@ jobs: remove-codeql: true remove-docker-images: true remove-large-packages: true + - name: Prepare AVD home on /mnt + # GitHub-hosted runners mount a ~74GB volume at /mnt. Create it before AVD cache + # restore and android-emulator-runner (avdmanager needs the space at create time). + run: | + sudo mkdir -p /mnt/avd + sudo chown "$USER:$USER" /mnt/avd + df -h / /mnt - name: AVD cache uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae continue-on-error: true @@ -105,11 +112,19 @@ jobs: with: # Must match the save path exactly path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }} + - name: Link AVD home to /mnt + # android-emulator-runner exportVariables ANDROID_AVD_HOME to $HOME/.android/avd + run: | + mkdir -p "$HOME/.android" + rm -rf "$HOME/.android/avd" + ln -s /mnt/avd "$HOME/.android/avd" - name: Start AVD then run E2E tests uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a + env: + ANDROID_AVD_HOME: /mnt/avd with: api-level: ${{ env.AVD_API_LEVEL }} target: ${{ env.AVD_TARGET }} @@ -141,7 +156,7 @@ jobs: key: ${{ steps.avd-cache.outputs.cache-primary-key }} # Must match the restore path exactly path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* agp9-compatibility: diff --git a/.github/workflows/e2e_tests_fdc.yaml b/.github/workflows/e2e_tests_fdc.yaml index d840b38f2695..ce9e4e570691 100644 --- a/.github/workflows/e2e_tests_fdc.yaml +++ b/.github/workflows/e2e_tests_fdc.yaml @@ -97,6 +97,11 @@ jobs: remove-codeql: true remove-docker-images: true remove-large-packages: true + - name: Prepare AVD home on /mnt + run: | + sudo mkdir -p /mnt/avd + sudo chown "$USER:$USER" /mnt/avd + df -h / /mnt - name: AVD cache uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae id: avd-cache @@ -104,11 +109,18 @@ jobs: with: # Must match the save path exactly path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }} + - name: Link AVD home to /mnt + run: | + mkdir -p "$HOME/.android" + rm -rf "$HOME/.android/avd" + ln -s /mnt/avd "$HOME/.android/avd" - name: Start AVD then run E2E tests uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a + env: + ANDROID_AVD_HOME: /mnt/avd with: api-level: ${{ env.AVD_API_LEVEL }} target: ${{ env.AVD_TARGET }} @@ -126,7 +138,7 @@ jobs: key: ${{ steps.avd-cache.outputs.cache-primary-key }} # Must match the restore path exactly path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* - name: Save Firestore Emulator Cache # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. diff --git a/.github/workflows/e2e_tests_pipeline.yaml b/.github/workflows/e2e_tests_pipeline.yaml index c45b311ee3ed..22ffb4736201 100644 --- a/.github/workflows/e2e_tests_pipeline.yaml +++ b/.github/workflows/e2e_tests_pipeline.yaml @@ -79,17 +79,29 @@ jobs: remove-codeql: true remove-docker-images: true remove-large-packages: true + - name: Prepare AVD home on /mnt + run: | + sudo mkdir -p /mnt/avd + sudo chown "$USER:$USER" /mnt/avd + df -h / /mnt - name: AVD cache uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae continue-on-error: true id: avd-cache with: path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }} + - name: Link AVD home to /mnt + run: | + mkdir -p "$HOME/.android" + rm -rf "$HOME/.android/avd" + ln -s /mnt/avd "$HOME/.android/avd" - name: Start AVD then run pipeline E2E tests uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a + env: + ANDROID_AVD_HOME: /mnt/avd with: api-level: ${{ env.AVD_API_LEVEL }} target: ${{ env.AVD_TARGET }} @@ -108,7 +120,7 @@ jobs: with: key: ${{ steps.avd-cache.outputs.cache-primary-key }} path: | - ~/.android/avd/* + /mnt/avd/* ~/.android/adb* pipeline-e2e-web: