From ade40a18623efd80848f8b6ad93200452e94f3d9 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 24 Nov 2025 11:11:50 -0500 Subject: [PATCH 1/5] chore(ci): pin android emulator runner action to fixed SHA it was previously on the sliding v2 tag and could update to unknown code without notice --- .github/workflows/android.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 5b6eb2555dc0..f12f89ea44d1 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -90,7 +90,7 @@ jobs: ~/.android/adb* key: avd-${{ runner.os }} - name: Start AVD then run E2E tests - uses: reactivecircus/android-emulator-runner@v2 + uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b with: api-level: 34 target: google_apis From 6b2bcb4adae5fcc2009dd94a4f27041f6c88d1ea Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 24 Nov 2025 09:49:18 -0500 Subject: [PATCH 2/5] chore(ci): only cache main - avoid branches LRU evicting main cache use the separate actions/cache "restore" and "save" actions so we may only save optional based on whether we are on main or not actions/cache isolates branch caches from main to avoid branch cache poison attacks on main runs but branches may see main cache as those caches are considered trustworthy branch caches do consume available LRU storage though, meaning branch caches could evict main caches and in high traffic / large cache repositories like this one that means caches LRU out frequently and cache hit rates are terrible unless you cache on main only --- .github/workflows/android.yaml | 25 +++++++++- .github/workflows/e2e_tests_fdc.yaml | 70 +++++++++++++++++++++++++--- .github/workflows/ios.yaml | 23 ++++++++- .github/workflows/macos.yaml | 25 ++++++++-- .github/workflows/web.yaml | 42 ++++++++++++++--- 5 files changed, 166 insertions(+), 19 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index f12f89ea44d1..f131d3f28267 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -44,8 +44,10 @@ jobs: distribution: 'temurin' java-version: '17' - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -82,9 +84,10 @@ jobs: remove-docker-images: true remove-large-packages: true - name: AVD cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: avd-cache with: + # Must match the save path exactly path: | ~/.android/avd/* ~/.android/adb* @@ -103,3 +106,21 @@ jobs: # https://github.com/ReactiveCircus/android-emulator-runner/issues/385 run: | pgrep -f appium && pkill -f appium || echo "No Appium process found" + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators + - name: Save Android Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.avd-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: | + ~/.android/avd/* + ~/.android/adb* diff --git a/.github/workflows/e2e_tests_fdc.yaml b/.github/workflows/e2e_tests_fdc.yaml index d252f8fed582..6d6a656cb602 100644 --- a/.github/workflows/e2e_tests_fdc.yaml +++ b/.github/workflows/e2e_tests_fdc.yaml @@ -38,8 +38,10 @@ jobs: distribution: 'temurin' java-version: '17' - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-fdc-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -80,9 +82,10 @@ jobs: remove-docker-images: true remove-large-packages: true - name: AVD cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: avd-cache with: + # Must match the save path exactly path: | ~/.android/avd/* ~/.android/adb* @@ -96,6 +99,24 @@ jobs: working-directory: 'packages/firebase_data_connect/firebase_data_connect/example' script: | flutter test integration_test/e2e_test.dart --dart-define=CI=true -d emulator-5554 + - name: Save Android Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.avd-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: | + ~/.android/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. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators ios: runs-on: macos-15 @@ -121,16 +142,19 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 name: Pods Cache id: pods-cache with: + # Must match the save path exactly path: tests/ios/Pods key: ${{ runner.os }}-fdc-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }} restore-keys: ${{ runner.os }}-ios-pods-v2 - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-fdc-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -178,6 +202,22 @@ jobs: # Uncomment following line to have simulator logs printed out for debugging purposes. # xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' & flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators + - name: Save Pods Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.pods-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: tests/ios/Pods web: runs-on: macos-latest @@ -208,9 +248,11 @@ jobs: run: melos bootstrap --scope "firebase_data_connect*" - name: 'Install Tools' run: sudo npm i -g firebase-tools - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - name: Firebase Emulator Cache + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-fdc-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -237,3 +279,19 @@ jobs: exit 1 fi shell: bash + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators + - name: Save Pods Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.pods-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: tests/ios/Pods diff --git a/.github/workflows/ios.yaml b/.github/workflows/ios.yaml index 28865c50d745..e8e594d639d2 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -50,16 +50,19 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 name: Pods Cache id: pods-cache with: + # Must match the save path exactly path: tests/ios/Pods key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/ios/Podfile.lock') }} restore-keys: pods-v3-${{ runner.os }} - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -118,3 +121,19 @@ jobs: # Uncomment following line to have simulator logs printed out for debugging purposes. # xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' & flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --ignore-timeouts --dart-define=CI=true + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: ~/.cache/firebase/emulators + - name: Save Pods Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.pods-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: tests/ios/Pods diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 4c4e8a6ba03f..a929a4491df5 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -48,16 +48,19 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 name: Pods Cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: pods-cache with: + # Must match the save path exactly path: tests/macos/Pods key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/macos/Podfile.lock') }} restore-keys: pods-v3-${{ runner.os }} - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - name: Firebase Emulator Cache + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -98,3 +101,19 @@ jobs: -d macos \ --dart-define=CI=true \ --ignore-timeouts + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators + - name: Save Pods Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.pods-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: tests/ios/Pods diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index 3866161422f6..9ee31231ed1f 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -57,9 +57,11 @@ jobs: run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - name: 'Install Tools' run: sudo npm i -g firebase-tools - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - name: Firebase Emulator Cache + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -81,6 +83,14 @@ jobs: exit 1 fi shell: bash + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators web-app-check: runs-on: macos-latest @@ -109,9 +119,11 @@ jobs: run: melos bootstrap --scope tests - name: 'Install Tools' run: sudo npm i -g firebase-tools - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - name: Firebase Emulator Cache + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -133,6 +145,14 @@ jobs: exit 1 fi shell: bash + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators web-wasm: runs-on: macos-latest @@ -166,9 +186,11 @@ jobs: run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - name: 'Install Tools' run: sudo npm i -g firebase-tools - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - name: Firebase Emulator Cache + id: firebase-emulator-cache + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: + # Must match the save path exactly path: ~/.cache/firebase/emulators key: firebase-emulators-v3-${{ runner.os }} restore-keys: firebase-emulators-v3 @@ -191,3 +213,11 @@ jobs: exit 1 fi shell: bash + - name: Save Firestore Emulator Cache + # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators From 951208bac643978f22ce742b8ce1d4fdc614729b Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 24 Nov 2025 10:14:22 -0500 Subject: [PATCH 3/5] chore(ci): cache restore/save failures should never break the build very occasionally, there are errors in the `hashFiles` function used to calculate cache keys, and this causes a build error that is a flake, not a valid CI failure signal so, continue the workflow even if the caching setup has errors, as that is a recoverable problem and the workflow may still have a valid success outcome --- .github/workflows/android.yaml | 2 ++ .github/workflows/e2e_tests_fdc.yaml | 11 +++++++++++ .github/workflows/ios.yaml | 4 ++++ .github/workflows/macos.yaml | 4 ++++ .github/workflows/web.yaml | 6 ++++++ 5 files changed, 27 insertions(+) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index f131d3f28267..9ab49eff3bf2 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -46,6 +46,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -85,6 +86,7 @@ jobs: remove-large-packages: true - name: AVD cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true id: avd-cache with: # Must match the save path exactly diff --git a/.github/workflows/e2e_tests_fdc.yaml b/.github/workflows/e2e_tests_fdc.yaml index 6d6a656cb602..7986cf8a2a2a 100644 --- a/.github/workflows/e2e_tests_fdc.yaml +++ b/.github/workflows/e2e_tests_fdc.yaml @@ -40,6 +40,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -84,6 +85,7 @@ jobs: - name: AVD cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: avd-cache + continue-on-error: true with: # Must match the save path exactly path: | @@ -103,6 +105,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.avd-cache.outputs.cache-primary-key }} # Must match the restore path exactly @@ -113,6 +116,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore path exactly @@ -143,6 +147,7 @@ jobs: key: xcode-cache-${{ runner.os }} max-size: 700M - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true name: Pods Cache id: pods-cache with: @@ -153,6 +158,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -206,6 +212,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore path exactly @@ -214,6 +221,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.pods-cache.outputs.cache-primary-key }} # Must match the restore paths exactly @@ -251,6 +259,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -283,6 +292,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore path exactly @@ -291,6 +301,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.pods-cache.outputs.cache-primary-key }} # Must match the restore paths exactly diff --git a/.github/workflows/ios.yaml b/.github/workflows/ios.yaml index e8e594d639d2..ef7f7b4e624f 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -51,6 +51,7 @@ jobs: key: xcode-cache-${{ runner.os }} max-size: 700M - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true name: Pods Cache id: pods-cache with: @@ -61,6 +62,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -125,6 +127,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore paths exactly @@ -133,6 +136,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.pods-cache.outputs.cache-primary-key }} # Must match the restore paths exactly diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index a929a4491df5..a00a6e6d3d7f 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -49,6 +49,7 @@ jobs: key: xcode-cache-${{ runner.os }} max-size: 700M name: Pods Cache + continue-on-error: true uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: pods-cache with: @@ -59,6 +60,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -102,6 +104,7 @@ jobs: --dart-define=CI=true \ --ignore-timeouts - name: Save Firestore Emulator Cache + continue-on-error: true # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -110,6 +113,7 @@ jobs: # Must match the restore path exactly path: ~/.cache/firebase/emulators - name: Save Pods Cache + continue-on-error: true # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index 9ee31231ed1f..7e1c94274c8f 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -60,6 +60,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -86,6 +87,7 @@ jobs: - name: Save Firestore Emulator Cache # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' + continue-on-error: true uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} @@ -122,6 +124,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -149,6 +152,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore path exactly @@ -189,6 +193,7 @@ jobs: - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators @@ -217,6 +222,7 @@ jobs: # Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache. if: github.ref == 'refs/heads/main' uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true with: key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} # Must match the restore path exactly From 0dd19a5416703ac86738bc31022b9d8b73eb8e0f Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 24 Nov 2025 10:08:09 -0500 Subject: [PATCH 4/5] chore(ci): make github primary cache keys unique so caches update github workflow caches are considered immutable, they will never update if there was a hit on the primary cache key ergo, if the primary cache key never changes the caches will never update and you will only ever get fresh caches by chance if stale caches are evicted via LRU cache storage limit management So, all cache primary keys are unique now according to the requirements of the specific cache - the AVD cache is now unique on the api-level/target/arch tuple, and that is set and referenced in an environment variable since it is now used in two places - the firebase emulator cache is set based on the firebase-tools version, which always changes when new emulator versions are downloaded --- .github/workflows/android.yaml | 21 +++++++++------ .github/workflows/e2e_tests_fdc.yaml | 38 +++++++++++++++++----------- .github/workflows/ios.yaml | 9 ++++--- .github/workflows/macos.yaml | 9 ++++--- .github/workflows/web.yaml | 18 ++++++++----- 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 9ab49eff3bf2..b72674abfd35 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -33,6 +33,10 @@ jobs: matrix: working_directory: ['tests', 'packages/cloud_firestore/cloud_firestore/example'] + env: + AVD_ARCH: x86_64 + AVD_API_LEVEL: 34 + AVD_TARGET: google_apis steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a @@ -43,6 +47,10 @@ jobs: with: distribution: 'temurin' java-version: '17' + - name: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -50,7 +58,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -64,9 +72,6 @@ jobs: melos-version: '5.3.0' - name: 'Bootstrap package' run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - - name: 'Install Tools' - run: | - sudo npm i -g firebase-tools - name: Start Firebase Emulator run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh - name: Enable KVM @@ -93,13 +98,13 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-${{ runner.os }} + key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }} - name: Start AVD then run E2E tests uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b with: - api-level: 34 - target: google_apis - arch: x86_64 + api-level: ${{ env.AVD_API_LEVEL }} + target: ${{ env.AVD_TARGET }} + arch: ${{ env.AVD_ARCH }} working-directory: ${{ matrix.working_directory }} script: | flutter test integration_test/e2e_test.dart --ignore-timeouts --dart-define=CI=true -d emulator-5554 diff --git a/.github/workflows/e2e_tests_fdc.yaml b/.github/workflows/e2e_tests_fdc.yaml index 7986cf8a2a2a..999c813a2cdc 100644 --- a/.github/workflows/e2e_tests_fdc.yaml +++ b/.github/workflows/e2e_tests_fdc.yaml @@ -27,6 +27,10 @@ jobs: timeout-minutes: 45 strategy: fail-fast: false + env: + AVD_ARCH: x86_64 + AVD_API_LEVEL: 34 + AVD_TARGET: google_apis steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a @@ -37,6 +41,10 @@ jobs: with: distribution: 'temurin' java-version: '17' + - name: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -44,7 +52,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-fdc-${{ runner.os }} + key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -58,9 +66,6 @@ jobs: melos-version: '5.3.0' - name: 'Bootstrap package' run: melos bootstrap --scope "firebase_data_connect*" - - name: 'Install Tools' - run: | - sudo npm i -g firebase-tools - name: Start Firebase Emulator run: | cd ./packages/firebase_data_connect/firebase_data_connect/example @@ -91,13 +96,13 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-${{ runner.os }} + key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }} - name: Start AVD then run E2E tests uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 34 - target: google_apis - arch: x86_64 + api-level: ${{ env.AVD_API_LEVEL }} + target: ${{ env.AVD_TARGET }} + arch: ${{ env.AVD_ARCH }} working-directory: 'packages/firebase_data_connect/firebase_data_connect/example' script: | flutter test integration_test/e2e_test.dart --dart-define=CI=true -d emulator-5554 @@ -155,6 +160,10 @@ jobs: path: tests/ios/Pods key: ${{ runner.os }}-fdc-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }} restore-keys: ${{ runner.os }}-ios-pods-v2 + - name: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -162,7 +171,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-fdc-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -174,9 +183,6 @@ jobs: melos-version: '5.3.0' - name: 'Bootstrap package' run: melos bootstrap --scope "firebase_data_connect*" - - name: 'Install Tools' - run: | - sudo npm i -g firebase-tools - name: 'Build Application' working-directory: 'packages/firebase_data_connect/firebase_data_connect/example' run: | @@ -255,15 +261,17 @@ jobs: - name: 'Bootstrap package' run: melos bootstrap --scope "firebase_data_connect*" - name: 'Install Tools' - run: sudo npm i -g firebase-tools - - name: Firebase Emulator Cache + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV + - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-fdc-${{ runner.os }} + key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: | diff --git a/.github/workflows/ios.yaml b/.github/workflows/ios.yaml index ef7f7b4e624f..5d5b9b8e1a54 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -59,6 +59,10 @@ jobs: path: tests/ios/Pods key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/ios/Podfile.lock') }} restore-keys: pods-v3-${{ runner.os }} + - name: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -66,7 +70,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -80,9 +84,6 @@ jobs: melos-version: '5.3.0' - name: 'Bootstrap package' run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - - name: 'Install Tools' - run: | - sudo npm i -g firebase-tools - name: 'Free up space' run: | sudo rm -rf \ diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index a00a6e6d3d7f..812c55f8160c 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -57,6 +57,10 @@ jobs: path: tests/macos/Pods key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/macos/Podfile.lock') }} restore-keys: pods-v3-${{ runner.os }} + - name: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -64,7 +68,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -78,9 +82,6 @@ jobs: melos-version: '5.3.0' - name: 'Bootstrap package' run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - - name: 'Install Tools' - run: | - sudo npm i -g firebase-tools - name: 'Build Application' working-directory: ${{ matrix.working_directory }} run: | diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index 7e1c94274c8f..96f73fc22331 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -56,7 +56,9 @@ jobs: - name: 'Bootstrap package' run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - name: 'Install Tools' - run: sudo npm i -g firebase-tools + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -64,7 +66,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh @@ -120,7 +122,9 @@ jobs: - name: 'Bootstrap package' run: melos bootstrap --scope tests - name: 'Install Tools' - run: sudo npm i -g firebase-tools + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -128,7 +132,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh @@ -189,7 +193,9 @@ jobs: - name: 'Bootstrap package' run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*" - name: 'Install Tools' - run: sudo npm i -g firebase-tools + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache id: firebase-emulator-cache uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 @@ -197,7 +203,7 @@ jobs: with: # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }} + key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh From ef66fc877203caea6909324ac87fd41f896191db Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Mon, 24 Nov 2025 11:07:06 -0500 Subject: [PATCH 5/5] chore(ci): firebase emulators are cross-platform, share cache across OSs the downloaded/cached files are pure javascript and java, they may be shared across operating systems safely --- .github/workflows/android.yaml | 4 +++- .github/workflows/e2e_tests_fdc.yaml | 12 +++++++++--- .github/workflows/ios.yaml | 4 +++- .github/workflows/macos.yaml | 4 +++- .github/workflows/web.yaml | 12 +++++++++--- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index b72674abfd35..b0139064dfa9 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -56,9 +56,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: diff --git a/.github/workflows/e2e_tests_fdc.yaml b/.github/workflows/e2e_tests_fdc.yaml index 999c813a2cdc..5b0305c4acb6 100644 --- a/.github/workflows/e2e_tests_fdc.yaml +++ b/.github/workflows/e2e_tests_fdc.yaml @@ -50,9 +50,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -169,9 +171,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -269,9 +273,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: | diff --git a/.github/workflows/ios.yaml b/.github/workflows/ios.yaml index 5d5b9b8e1a54..02ccb0fafbdb 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -68,9 +68,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 812c55f8160c..fd0b77bebc75 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -66,9 +66,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index 96f73fc22331..c69b3118b45c 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -64,9 +64,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh @@ -130,9 +132,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh @@ -201,9 +205,11 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 continue-on-error: true with: + # The firebase emulators are pure javascript and java, OS-independent + enableCrossOsArchive: true # Must match the save path exactly path: ~/.cache/firebase/emulators - key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh