4646 triggerLabelPrefix : " tests-requested: "
4747 triggerLabelFull : " tests-requested: full"
4848 triggerLabelQuick : " tests-requested: quick"
49- pythonVersion : ' 3.7 '
49+ pythonVersion : ' 3.8 '
5050 xcodeVersion : ' 14.1'
5151 artifactRetentionDays : 2
5252 GITHUB_TOKEN : ${{ github.token }}
@@ -164,6 +164,9 @@ jobs:
164164 shell : bash
165165 command : pip install -r scripts/gha/python_requirements.txt
166166 - id : matrix_config
167+ env :
168+ HEAD_REF : ${{github.event.pull_request.head.ref}}
169+ BASE_REF : ${{github.event.pull_request.base.ref}}
167170 run : |
168171 if [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "expanded" ]]; then
169172 TEST_MATRIX_PARAM=-e=1
@@ -174,12 +177,12 @@ jobs:
174177 elif [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "auto" ]]; then
175178 # auto-diff only apply when running in a PR.
176179 # diff against the PR's base. "git merge-base main branch_name" will give the common ancestor of both branches.
177- MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}} || true)
180+ MERGE_BASE=$(git merge-base " origin/${HEAD_REF}" " origin/${BASE_REF}" || true)
178181 # If origin/<branch> is no longer valid, then just run all tests.
179182 if [[ -n "${MERGE_BASE}" ]]; then
180- echo "::warning ::Auto-diff origin/${{github.event.pull_request.head.ref} }..${MERGE_BASE}"
181- git diff --name-only origin/${{github.event.pull_request.head.ref}} ..${MERGE_BASE}
182- TEST_MATRIX_PARAM="--auto_diff origin/${{github.event.pull_request.head.ref} }..${MERGE_BASE}"
183+ echo "::warning ::Auto-diff origin/${HEAD_REF }..${MERGE_BASE}"
184+ git diff --name-only " origin/${HEAD_REF} ..${MERGE_BASE}"
185+ TEST_MATRIX_PARAM="--auto_diff origin/${HEAD_REF }..${MERGE_BASE}"
183186 fi
184187 fi
185188
@@ -188,12 +191,13 @@ jobs:
188191 if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
189192 # at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
190193 apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
194+ echo "::warning ::Running main nightly tests"
191195 elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
192196 # at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
193197 echo "::warning ::Running Firestore nightly tests"
194198 apis="firestore"
195199 else
196- echo "::warning ::Running main nightly tests"
200+ echo "::warning ::Running pull request tests"
197201 apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )
198202 fi
199203 if [[ "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
@@ -762,17 +766,22 @@ jobs:
762766 timeout_minutes : 15
763767 max_attempts : 3
764768 command : scripts/gha/install_test_workflow_prereqs.sh -p Desktop -t true -a '${{ matrix.arch }}' -s '${{ matrix.ssl_variant }}'
765- - name : Set up Node (16 )
769+ - name : Set up Node (18 )
766770 uses : actions/setup-node@v3
767771 with :
768- node-version : 16 .x
772+ node-version : 18 .x
769773 - name : Setup Firestore Emulator
770774 uses : nick-invision/retry@v2
771775 with :
772776 shell : bash
773777 timeout_minutes : 5
774778 max_attempts : 3
775- command : npm install -g firebase-tools
779+ command : npm install firebase-tools
780+ - name : Add firebase-tools to PATH
781+ shell : bash
782+ run : |
783+ echo "$(npm root)" >> $GITHUB_PATH
784+ echo "$(npm root)/.bin" >> $GITHUB_PATH
776785 - name : Setup java
777786 uses : actions/setup-java@v3
778787 with :
@@ -983,7 +992,7 @@ jobs:
983992 test_android :
984993 name : test-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}
985994 needs : [check_and_prepare, build_android]
986- runs-on : macos-12
995+ runs-on : ubuntu-20.04
987996 if : contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
988997 strategy :
989998 fail-fast : false
@@ -1020,7 +1029,7 @@ jobs:
10201029 id : device-info
10211030 run : |
10221031 echo "device_type=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_device_type)" >> $GITHUB_OUTPUT
1023- echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device )" >> $GITHUB_OUTPUT
1032+ echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device_list )" >> $GITHUB_OUTPUT
10241033 - name : Setup java 8 for test_simulator.py
10251034 uses : actions/setup-java@v3
10261035 with :
@@ -1037,15 +1046,17 @@ jobs:
10371046 --ci
10381047 - id : ftl_test
10391048 if : steps.device-info.outputs.device_type == 'ftl'
1040- uses : FirebaseExtended/github-actions/firebase-test-lab@v1.2
1041- timeout-minutes : 90
1049+ uses : FirebaseExtended/github-actions/firebase-test-lab@v1.4
1050+ timeout-minutes : 120
10421051 with :
10431052 credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
10441053 testapp_dir : testapps
10451054 test_type : " game-loop"
1046- test_devices : ${{ steps.device-info.outputs.device }}
1055+ test_devices : ' ${{ steps.device-info.outputs.device }}'
1056+ test_device_selection : random
10471057 max_attempts : 3
10481058 validator : ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1059+ additional_flags : ' --client-details matrixLabel=android-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.android_device }}'
10491060 - name : Read FTL Test Result
10501061 if : ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
10511062 shell : bash
@@ -1147,11 +1158,11 @@ jobs:
11471158 id : device-info
11481159 run : |
11491160 echo "device_type=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_device_type)" >> $GITHUB_OUTPUT
1150- echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_ftl_device )" >> $GITHUB_OUTPUT
1151- - name : Set up Node (16 )
1161+ echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_ftl_device_list )" >> $GITHUB_OUTPUT
1162+ - name : Set up Node (18 )
11521163 uses : actions/setup-node@v3
11531164 with :
1154- node-version : 16 .x
1165+ node-version : 18 .x
11551166 - name : Setup java for Firestore emulator
11561167 uses : actions/setup-java@v3
11571168 with :
@@ -1164,7 +1175,13 @@ jobs:
11641175 shell : bash
11651176 timeout_minutes : 5
11661177 max_attempts : 3
1167- command : npm install -g firebase-tools
1178+ command : npm install firebase-tools
1179+ - name : Add firebase-tools to PATH
1180+ if : contains(needs.check_and_prepare.outputs.apis, 'firestore')
1181+ shell : bash
1182+ run : |
1183+ echo "$(npm root)" >> $GITHUB_PATH
1184+ echo "$(npm root)/.bin" >> $GITHUB_PATH
11681185 - name : Start Firestore Emulator
11691186 if : steps.device-info.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
11701187 run : |
@@ -1180,15 +1197,17 @@ jobs:
11801197 --ci
11811198 - id : ftl_test
11821199 if : steps.device-info.outputs.device_type == 'ftl'
1183- uses : FirebaseExtended/github-actions/firebase-test-lab@v1.2
1200+ uses : FirebaseExtended/github-actions/firebase-test-lab@v1.4
11841201 timeout-minutes : 90
11851202 with :
11861203 credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
11871204 testapp_dir : testapps
11881205 test_type : " game-loop"
1189- test_devices : ${{ steps.device-info.outputs.device }}
1206+ test_devices : ' ${{ steps.device-info.outputs.device }}'
1207+ test_device_selection : random
11901208 max_attempts : 3
11911209 validator : ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1210+ additional_flags : ' --client-details matrixLabel=ios-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.ios_device }}'
11921211 - name : Read FTL Test Result
11931212 if : ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
11941213 shell : bash
@@ -1283,7 +1302,13 @@ jobs:
12831302 shell : bash
12841303 timeout_minutes : 5
12851304 max_attempts : 3
1286- command : npm install -g firebase-tools
1305+ command : npm install firebase-tools
1306+ - name : Add firebase-tools to PATH
1307+ if : contains(needs.check_and_prepare.outputs.apis, 'firestore')
1308+ shell : bash
1309+ run : |
1310+ echo "$(npm root)" >> $GITHUB_PATH
1311+ echo "$(npm root)/.bin" >> $GITHUB_PATH
12871312 - name : Start Firestore Emulator
12881313 if : contains(needs.check_and_prepare.outputs.apis, 'firestore')
12891314 run : |
@@ -1408,3 +1433,34 @@ jobs:
14081433 ${additional_flags[*]}
14091434 - name : Summarize results into GitHub log
14101435 run : python scripts/gha/summarize_test_results.py --dir test_results --github_log
1436+
1437+ attempt_retry :
1438+ name : " attempt-retry"
1439+ needs : [check_and_prepare, summarize_results]
1440+ runs-on : ubuntu-20.04
1441+ if : ${{ failure() && needs.check_and_prepare.outputs.trigger == 'scheduled_trigger' }}
1442+ steps :
1443+ - uses : actions/checkout@v3
1444+ with :
1445+ ref : ${{needs.check_and_prepare.outputs.github_ref}}
1446+ - name : Setup python
1447+ uses : actions/setup-python@v4
1448+ with :
1449+ python-version : ${{ env.pythonVersion }}
1450+ - name : Install python deps
1451+ run : pip install -r scripts/gha/python_requirements.txt
1452+ # The default token can't run workflows, so get an alternate token.
1453+ - name : Generate token for GitHub API
1454+ uses : tibdex/github-app-token@v1
1455+ id : generate-token
1456+ with :
1457+ app_id : ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
1458+ private_key : ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
1459+ - name : Retry failed tests
1460+ run : |
1461+ echo "::warning ::Attempting to retry failed tests"
1462+ python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} \
1463+ -w retry-test-failures.yml \
1464+ -p run_id ${{ github.run_id }} \
1465+ -s 10 \
1466+ -A
0 commit comments