@@ -250,11 +250,85 @@ jobs:
250250 retention-days : 7
251251 if-no-files-found : ignore
252252
253+ firestore_emulator_integ_tests :
254+ name : " System Tests Against Emulator"
255+ runs-on : ubuntu-latest
256+ needs :
257+ - determine_changed
258+ # only run on post submit or PRs not originating from forks.
259+ if : ((github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && contains(fromJSON(needs.determine_changed.outputs.modules), ':firebase-firestore')
260+ strategy :
261+ fail-fast : false
262+
263+ steps :
264+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
265+ with :
266+ fetch-depth : 2
267+ submodules : true
268+
269+ - name : Enable KVM
270+ run : |
271+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
272+ sudo udevadm control --reload-rules
273+ sudo udevadm trigger --name-match=kvm
274+
275+ - name : Add google-services.json
276+ env :
277+ INTEG_TESTS_GOOGLE_SERVICES : ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
278+ run : |
279+ echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > firebase-firestore/google-services.json
280+
281+ - name : Set up JDK 21
282+ uses : actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
283+ with :
284+ java-version : 21
285+ distribution : temurin
286+ cache : gradle
287+
288+ - uses : google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
289+
290+ - name : Start Emulator
291+ env :
292+ EXPERIMENTAL_MODE : true
293+ run : |
294+ gcloud emulators firestore start --host-port=127.0.0.1:8080 --quiet &
295+
296+ - name : Set up JDK 17
297+ uses : actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
298+ with :
299+ java-version : 17
300+ distribution : temurin
301+ cache : gradle
302+
303+ - name : Firestore Emulator Integ Tests
304+ uses : reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0
305+ env :
306+ FIREBASE_CI : 1
307+ FTL_RESULTS_BUCKET : android-ci
308+ FTL_RESULTS_DIR : ${{ github.event_name == 'pull_request' && format('pr-logs/pull/{0}/{1}/{2}/{3}_{4}/artifacts/', github.repository, github.event.pull_request.number, github.job, github.run_id, github.run_attempt) || format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt)}}
309+ FIREBASE_APP_CHECK_DEBUG_SECRET : ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
310+ with :
311+ api-level : 31
312+ arch : x86_64
313+ ram-size : 4096M
314+ heap-size : 4096M
315+ script : |
316+ adb logcat -v time > logcat.txt &
317+ ./gradlew firebase-firestore:connectedCheck withErrorProne -PtargetBackend="emulator"
318+ - name : Upload logs
319+ if : failure()
320+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
321+ with :
322+ name : emulator-logcat.txt
323+ path : logcat.txt
324+ retention-days : 7
325+ if-no-files-found : ignore
326+
253327 check-required-tests :
254328 runs-on : ubuntu-latest
255329 if : always()
256330 name : Check all required Firestore tests results
257- needs : [integ_tests, named_integ_tests ]
331+ needs : [firestore_emulator_integ_tests ]
258332 steps :
259333 - name : Check test matrix
260334 if : needs.integ_tests.result == 'failure' || needs.named_integ_tests.result == 'failure'
0 commit comments