Skip to content

Commit b834f98

Browse files
committed
Merge branch 'main' into firebaseai/function_signature
2 parents 18a227f + a5ba632 commit b834f98

File tree

5 files changed

+291
-57
lines changed

5 files changed

+291
-57
lines changed

.github/workflows/android.yaml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
matrix:
3434
working_directory:
3535
['tests', 'packages/cloud_firestore/cloud_firestore/example']
36+
env:
37+
AVD_ARCH: x86_64
38+
AVD_API_LEVEL: 34
39+
AVD_TARGET: google_apis
3640
steps:
3741
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
3842
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
@@ -43,11 +47,20 @@ jobs:
4347
with:
4448
distribution: 'temurin'
4549
java-version: '21'
50+
- name: 'Install Tools'
51+
run: |
52+
sudo npm i -g firebase-tools
53+
echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV
4654
- name: Firebase Emulator Cache
47-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
55+
id: firebase-emulator-cache
56+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
57+
continue-on-error: true
4858
with:
59+
# The firebase emulators are pure javascript and java, OS-independent
60+
enableCrossOsArchive: true
61+
# Must match the save path exactly
4962
path: ~/.cache/firebase/emulators
50-
key: firebase-emulators-v3-${{ runner.os }}
63+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
5164
restore-keys: firebase-emulators-v3
5265
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
5366
with:
@@ -61,9 +74,6 @@ jobs:
6174
melos-version: '5.3.0'
6275
- name: 'Bootstrap package'
6376
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
64-
- name: 'Install Tools'
65-
run: |
66-
sudo npm i -g firebase-tools
6777
- name: Start Firebase Emulator
6878
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
6979
- name: Enable KVM
@@ -82,19 +92,21 @@ jobs:
8292
remove-docker-images: true
8393
remove-large-packages: true
8494
- name: AVD cache
85-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
95+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
96+
continue-on-error: true
8697
id: avd-cache
8798
with:
99+
# Must match the save path exactly
88100
path: |
89101
~/.android/avd/*
90102
~/.android/adb*
91-
key: avd-${{ runner.os }}
103+
key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }}
92104
- name: Start AVD then run E2E tests
93-
uses: reactivecircus/android-emulator-runner@v2
105+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b
94106
with:
95-
api-level: 34
96-
target: google_apis
97-
arch: x86_64
107+
api-level: ${{ env.AVD_API_LEVEL }}
108+
target: ${{ env.AVD_TARGET }}
109+
arch: ${{ env.AVD_ARCH }}
98110
emulator-build: 14214601
99111
working-directory: ${{ matrix.working_directory }}
100112
script: |
@@ -104,3 +116,23 @@ jobs:
104116
# https://github.com/ReactiveCircus/android-emulator-runner/issues/385
105117
run: |
106118
pgrep -f appium && pkill -f appium || echo "No Appium process found"
119+
- name: Save Firestore Emulator Cache
120+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
121+
if: github.ref == 'refs/heads/main'
122+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
123+
with:
124+
# The firebase emulators are pure javascript and java, OS-independent
125+
enableCrossOsArchive: true
126+
key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }}
127+
# Must match the restore path exactly
128+
path: ~/.cache/firebase/emulators
129+
- name: Save Android Emulator Cache
130+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
131+
if: github.ref == 'refs/heads/main'
132+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
133+
with:
134+
key: ${{ steps.avd-cache.outputs.cache-primary-key }}
135+
# Must match the restore path exactly
136+
path: |
137+
~/.android/avd/*
138+
~/.android/adb*

.github/workflows/e2e_tests_fdc.yaml

Lines changed: 110 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
timeout-minutes: 45
2828
strategy:
2929
fail-fast: false
30+
env:
31+
AVD_ARCH: x86_64
32+
AVD_API_LEVEL: 34
33+
AVD_TARGET: google_apis
3034
steps:
3135
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
3236
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
@@ -37,11 +41,20 @@ jobs:
3741
with:
3842
distribution: 'temurin'
3943
java-version: '21'
44+
- name: 'Install Tools'
45+
run: |
46+
sudo npm i -g firebase-tools
47+
echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV
4048
- name: Firebase Emulator Cache
41-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
49+
id: firebase-emulator-cache
50+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
51+
continue-on-error: true
4252
with:
53+
# The firebase emulators are pure javascript and java, OS-independent
54+
enableCrossOsArchive: true
55+
# Must match the save path exactly
4356
path: ~/.cache/firebase/emulators
44-
key: firebase-emulators-v3-fdc-${{ runner.os }}
57+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
4558
restore-keys: firebase-emulators-v3
4659
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
4760
with:
@@ -55,9 +68,6 @@ jobs:
5568
melos-version: '5.3.0'
5669
- name: 'Bootstrap package'
5770
run: melos bootstrap --scope "firebase_data_connect*"
58-
- name: 'Install Tools'
59-
run: |
60-
sudo npm i -g firebase-tools
6171
- name: Start Firebase Emulator
6272
run: |
6373
cd ./packages/firebase_data_connect/firebase_data_connect/example
@@ -80,23 +90,47 @@ jobs:
8090
remove-docker-images: true
8191
remove-large-packages: true
8292
- name: AVD cache
83-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
93+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
8494
id: avd-cache
95+
continue-on-error: true
8596
with:
97+
# Must match the save path exactly
8698
path: |
8799
~/.android/avd/*
88100
~/.android/adb*
89-
key: avd-${{ runner.os }}
101+
key: avd-${{ runner.os }}-${{ env.AVD_API_LEVEL }}-${{ env.AVD_TARGET }}-${{ env.AVD_ARCH }}
90102
- name: Start AVD then run E2E tests
91103
uses: reactivecircus/android-emulator-runner@v2
92104
with:
93-
api-level: 34
94-
target: google_apis
95-
arch: x86_64
105+
api-level: ${{ env.AVD_API_LEVEL }}
106+
target: ${{ env.AVD_TARGET }}
107+
arch: ${{ env.AVD_ARCH }}
96108
emulator-build: 14214601
97109
working-directory: 'packages/firebase_data_connect/firebase_data_connect/example'
98110
script: |
99111
flutter test integration_test/e2e_test.dart --dart-define=CI=true -d emulator-5554
112+
- name: Save Android Emulator Cache
113+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
114+
if: github.ref == 'refs/heads/main'
115+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
116+
continue-on-error: true
117+
with:
118+
key: ${{ steps.avd-cache.outputs.cache-primary-key }}
119+
# Must match the restore path exactly
120+
path: |
121+
~/.android/avd/*
122+
~/.android/adb*
123+
- name: Save Firestore Emulator Cache
124+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
125+
if: github.ref == 'refs/heads/main'
126+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
127+
continue-on-error: true
128+
with:
129+
# The firebase emulators are pure javascript and java, OS-independent
130+
enableCrossOsArchive: true
131+
key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }}
132+
# Must match the restore path exactly
133+
path: ~/.cache/firebase/emulators
100134

101135
ios:
102136
runs-on: macos-15
@@ -121,19 +155,31 @@ jobs:
121155
name: Xcode Compile Cache
122156
with:
123157
key: xcode-cache-${{ runner.os }}
158+
save: "${{ github.ref == 'refs/heads/main' }}"
124159
max-size: 700M
125-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
160+
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
161+
continue-on-error: true
126162
name: Pods Cache
127163
id: pods-cache
128164
with:
165+
# Must match the save path exactly
129166
path: tests/ios/Pods
130167
key: ${{ runner.os }}-fdc-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
131168
restore-keys: ${{ runner.os }}-ios-pods-v2
169+
- name: 'Install Tools'
170+
run: |
171+
sudo npm i -g firebase-tools
172+
echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV
132173
- name: Firebase Emulator Cache
133-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
174+
id: firebase-emulator-cache
175+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
176+
continue-on-error: true
134177
with:
178+
# The firebase emulators are pure javascript and java, OS-independent
179+
enableCrossOsArchive: true
180+
# Must match the save path exactly
135181
path: ~/.cache/firebase/emulators
136-
key: firebase-emulators-v3-fdc-${{ runner.os }}
182+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
137183
restore-keys: firebase-emulators-v3
138184
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
139185
with:
@@ -145,9 +191,6 @@ jobs:
145191
melos-version: '5.3.0'
146192
- name: 'Bootstrap package'
147193
run: melos bootstrap --scope "firebase_data_connect*"
148-
- name: 'Install Tools'
149-
run: |
150-
sudo npm i -g firebase-tools
151194
- name: 'Build Application'
152195
working-directory: 'packages/firebase_data_connect/firebase_data_connect/example'
153196
run: |
@@ -179,6 +222,26 @@ jobs:
179222
# Uncomment following line to have simulator logs printed out for debugging purposes.
180223
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
181224
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true
225+
- name: Save Firestore Emulator Cache
226+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
227+
if: github.ref == 'refs/heads/main'
228+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
229+
continue-on-error: true
230+
with:
231+
# The firebase emulators are pure javascript and java, OS-independent
232+
enableCrossOsArchive: true
233+
key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }}
234+
# Must match the restore path exactly
235+
path: ~/.cache/firebase/emulators
236+
- name: Save Pods Cache
237+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
238+
if: github.ref == 'refs/heads/main'
239+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
240+
continue-on-error: true
241+
with:
242+
key: ${{ steps.pods-cache.outputs.cache-primary-key }}
243+
# Must match the restore paths exactly
244+
path: tests/ios/Pods
182245

183246
web:
184247
runs-on: macos-latest
@@ -208,12 +271,19 @@ jobs:
208271
- name: 'Bootstrap package'
209272
run: melos bootstrap --scope "firebase_data_connect*"
210273
- name: 'Install Tools'
211-
run: sudo npm i -g firebase-tools
212-
- name: Cache Firebase Emulator
213-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
274+
run: |
275+
sudo npm i -g firebase-tools
276+
echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV
277+
- name: Firebase Emulator Cache
278+
id: firebase-emulator-cache
279+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
280+
continue-on-error: true
214281
with:
282+
# The firebase emulators are pure javascript and java, OS-independent
283+
enableCrossOsArchive: true
284+
# Must match the save path exactly
215285
path: ~/.cache/firebase/emulators
216-
key: firebase-emulators-v3-fdc-${{ runner.os }}
286+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
217287
restore-keys: firebase-emulators-v3
218288
- name: Start Firebase Emulator
219289
run: |
@@ -238,3 +308,23 @@ jobs:
238308
exit 1
239309
fi
240310
shell: bash
311+
- name: Save Firestore Emulator Cache
312+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
313+
if: github.ref == 'refs/heads/main'
314+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
315+
continue-on-error: true
316+
with:
317+
# The firebase emulators are pure javascript and java, OS-independent
318+
enableCrossOsArchive: true
319+
key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }}
320+
# Must match the restore path exactly
321+
path: ~/.cache/firebase/emulators
322+
- name: Save Pods Cache
323+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
324+
if: github.ref == 'refs/heads/main'
325+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
326+
continue-on-error: true
327+
with:
328+
key: ${{ steps.pods-cache.outputs.cache-primary-key }}
329+
# Must match the restore paths exactly
330+
path: tests/ios/Pods

.github/workflows/ios.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,31 @@ jobs:
4949
name: Xcode Compile Cache
5050
with:
5151
key: xcode-cache-${{ runner.os }}
52+
save: "${{ github.ref == 'refs/heads/main' }}"
5253
max-size: 700M
53-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
54+
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
55+
continue-on-error: true
5456
name: Pods Cache
5557
id: pods-cache
5658
with:
59+
# Must match the save path exactly
5760
path: tests/ios/Pods
5861
key: pods-v3-${{ runner.os }}-${{ hashFiles('tests/ios/Podfile.lock') }}
5962
restore-keys: pods-v3-${{ runner.os }}
63+
- name: 'Install Tools'
64+
run: |
65+
sudo npm i -g firebase-tools
66+
echo "FIREBASE_TOOLS_VERSION=$(npm firebase --version)" >> $GITHUB_ENV
6067
- name: Firebase Emulator Cache
61-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
68+
id: firebase-emulator-cache
69+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
70+
continue-on-error: true
6271
with:
72+
# The firebase emulators are pure javascript and java, OS-independent
73+
enableCrossOsArchive: true
74+
# Must match the save path exactly
6375
path: ~/.cache/firebase/emulators
64-
key: firebase-emulators-v3-${{ runner.os }}
76+
key: firebase-emulators-v3-${{ env.FIREBASE_TOOLS_VERSION }}
6577
restore-keys: firebase-emulators-v3
6678
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
6779
with:
@@ -75,9 +87,6 @@ jobs:
7587
melos-version: '5.3.0'
7688
- name: 'Bootstrap package'
7789
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
78-
- name: 'Install Tools'
79-
run: |
80-
sudo npm i -g firebase-tools
8190
- name: 'Free up space'
8291
run: |
8392
sudo rm -rf \
@@ -118,3 +127,23 @@ jobs:
118127
# Uncomment following line to have simulator logs printed out for debugging purposes.
119128
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
120129
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --ignore-timeouts --dart-define=CI=true
130+
- name: Save Firestore Emulator Cache
131+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
132+
if: github.ref == 'refs/heads/main'
133+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
134+
continue-on-error: true
135+
with:
136+
# The firebase emulators are pure javascript and java, OS-independent
137+
enableCrossOsArchive: true
138+
key: ${{ steps.firebase-emulator-cache.outputs.cache-primary-key }}
139+
# Must match the restore paths exactly
140+
path: ~/.cache/firebase/emulators
141+
- name: Save Pods Cache
142+
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.
143+
if: github.ref == 'refs/heads/main'
144+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
145+
continue-on-error: true
146+
with:
147+
key: ${{ steps.pods-cache.outputs.cache-primary-key }}
148+
# Must match the restore paths exactly
149+
path: tests/ios/Pods

0 commit comments

Comments
 (0)