diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 5b6eb2555dc0..b0139064dfa9 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,11 +47,20 @@ 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 - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -61,9 +74,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 @@ -82,19 +92,21 @@ jobs: remove-docker-images: true remove-large-packages: true - name: AVD cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true id: avd-cache with: + # Must match the save path exactly 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 + 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 @@ -103,3 +115,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..5b0305c4acb6 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,11 +41,20 @@ 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 - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -55,9 +68,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 @@ -80,22 +90,44 @@ jobs: remove-docker-images: true remove-large-packages: true - name: AVD cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 id: avd-cache + continue-on-error: true with: + # Must match the save path exactly 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 + - 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 + continue-on-error: true + 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 + continue-on-error: true + 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,18 +153,29 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true 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: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -144,9 +187,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: | @@ -178,6 +218,24 @@ 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 + continue-on-error: true + 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 + continue-on-error: true + with: + key: ${{ steps.pods-cache.outputs.cache-primary-key }} + # Must match the restore paths exactly + path: tests/ios/Pods web: runs-on: macos-latest @@ -207,12 +265,19 @@ jobs: - name: 'Bootstrap package' 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 + 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: + # 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - name: Start Firebase Emulator run: | @@ -237,3 +302,21 @@ 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 + continue-on-error: true + 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 + continue-on-error: true + 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..02ccb0fafbdb 100644 --- a/.github/workflows/ios.yaml +++ b/.github/workflows/ios.yaml @@ -50,18 +50,29 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 + continue-on-error: true 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: 'Install Tools' + run: | + sudo npm i -g firebase-tools + echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV - name: Firebase Emulator Cache - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + id: firebase-emulator-cache + 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -75,9 +86,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 \ @@ -118,3 +126,21 @@ 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 + continue-on-error: true + 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 + continue-on-error: true + 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..fd0b77bebc75 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -48,18 +48,29 @@ jobs: with: key: xcode-cache-${{ runner.os }} max-size: 700M - - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 name: Pods Cache + continue-on-error: true + 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: '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 + 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 }} + key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }} restore-keys: firebase-emulators-v3 - uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff with: @@ -73,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: 'Build Application' working-directory: ${{ matrix.working_directory }} run: | @@ -98,3 +106,21 @@ jobs: -d macos \ --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 + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # 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 + 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..c69b3118b45c 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -56,12 +56,19 @@ jobs: - name: 'Bootstrap package' 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 + 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: + # 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 }} + 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 @@ -81,6 +88,15 @@ 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' + continue-on-error: true + 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 @@ -108,12 +124,19 @@ jobs: - name: 'Bootstrap package' run: melos bootstrap --scope tests - name: 'Install Tools' - run: sudo npm i -g firebase-tools - - name: Cache Firebase Emulator - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 + 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: + # 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 }} + 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 @@ -133,6 +156,15 @@ 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 + continue-on-error: true + 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 @@ -165,12 +197,19 @@ jobs: - name: 'Bootstrap package' 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 + 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: + # 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 }} + 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 @@ -191,3 +230,12 @@ 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 + continue-on-error: true + with: + key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }} + # Must match the restore path exactly + path: ~/.cache/firebase/emulators