Skip to content

Commit f6110bb

Browse files
committed
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
1 parent cd17491 commit f6110bb

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

.github/workflows/android.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
with:
5858
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
5959
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
60+
# The firebase emulators are pure javascript and java, OS-independent
61+
enableCrossOsArchive: true
6062
path: ~/.cache/firebase/emulators
61-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
63+
key: firebase-emulators-v3}-${{ env.FIREBASE_TOOLS_VERSION }}
6264
restore-keys: firebase-emulators-v3
6365
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
6466
with:

.github/workflows/e2e_tests_fdc.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ jobs:
5151
with:
5252
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
5353
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
54+
# The firebase emulators are pure javascript and java, OS-independent
55+
enableCrossOsArchive: true
5456
path: ~/.cache/firebase/emulators
55-
key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
57+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
5658
restore-keys: firebase-emulators-v3
5759
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
5860
with:
@@ -152,8 +154,10 @@ jobs:
152154
with:
153155
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
154156
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
157+
# The firebase emulators are pure javascript and java, OS-independent
158+
enableCrossOsArchive: true
155159
path: ~/.cache/firebase/emulators
156-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
160+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
157161
restore-keys: firebase-emulators-v3
158162
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
159163
with:
@@ -234,8 +238,10 @@ jobs:
234238
with:
235239
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
236240
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
241+
# The firebase emulators are pure javascript and java, OS-independent
242+
enableCrossOsArchive: true
237243
path: ~/.cache/firebase/emulators
238-
key: firebase-emulators-v3-fdc-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
244+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
239245
restore-keys: firebase-emulators-v3
240246
- name: Start Firebase Emulator
241247
run: |

.github/workflows/ios.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ jobs:
7070
with:
7171
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
7272
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
73+
# The firebase emulators are pure javascript and java, OS-independent
74+
enableCrossOsArchive: true
7375
path: ~/.cache/firebase/emulators
74-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
76+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
7577
restore-keys: firebase-emulators-v3
7678
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
7779
with:

.github/workflows/macos.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ jobs:
6868
with:
6969
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
7070
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
71+
# The firebase emulators are pure javascript and java, OS-independent
72+
enableCrossOsArchive: true
7173
path: ~/.cache/firebase/emulators
72-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
74+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
7375
restore-keys: firebase-emulators-v3
7476
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
7577
with:

.github/workflows/web.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ jobs:
6565
with:
6666
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
6767
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
68+
# The firebase emulators are pure javascript and java, OS-independent
69+
enableCrossOsArchive: true
6870
path: ~/.cache/firebase/emulators
69-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
71+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
7072
restore-keys: firebase-emulators-v3
7173
- name: Start Firebase Emulator
7274
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
@@ -122,8 +124,10 @@ jobs:
122124
with:
123125
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
124126
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
127+
# The firebase emulators are pure javascript and java, OS-independent
128+
enableCrossOsArchive: true
125129
path: ~/.cache/firebase/emulators
126-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
130+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
127131
restore-keys: firebase-emulators-v3
128132
- name: Start Firebase Emulator
129133
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
@@ -184,8 +188,10 @@ jobs:
184188
with:
185189
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
186190
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
191+
# The firebase emulators are pure javascript and java, OS-independent
192+
enableCrossOsArchive: true
187193
path: ~/.cache/firebase/emulators
188-
key: firebase-emulators-v3-${{ runner.os }}-${{ env.FIREBASE_TOOLS_VERSION }}
194+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
189195
restore-keys: firebase-emulators-v3
190196
- name: Start Firebase Emulator
191197
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh

0 commit comments

Comments
 (0)