46
46
triggerLabelPrefix : " tests-requested: "
47
47
triggerLabelFull : " tests-requested: full"
48
48
triggerLabelQuick : " tests-requested: quick"
49
- pythonVersion : ' 3.7 '
49
+ pythonVersion : ' 3.8 '
50
50
xcodeVersion : ' 14.1'
51
51
artifactRetentionDays : 2
52
52
GITHUB_TOKEN : ${{ github.token }}
@@ -164,6 +164,9 @@ jobs:
164
164
shell : bash
165
165
command : pip install -r scripts/gha/python_requirements.txt
166
166
- id : matrix_config
167
+ env :
168
+ HEAD_REF : ${{github.event.pull_request.head.ref}}
169
+ BASE_REF : ${{github.event.pull_request.base.ref}}
167
170
run : |
168
171
if [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "expanded" ]]; then
169
172
TEST_MATRIX_PARAM=-e=1
@@ -174,12 +177,12 @@ jobs:
174
177
elif [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "auto" ]]; then
175
178
# auto-diff only apply when running in a PR.
176
179
# 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)
178
181
# If origin/<branch> is no longer valid, then just run all tests.
179
182
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}"
183
186
fi
184
187
fi
185
188
@@ -188,12 +191,13 @@ jobs:
188
191
if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
189
192
# at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
190
193
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
194
+ echo "::warning ::Running main nightly tests"
191
195
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
192
196
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
193
197
echo "::warning ::Running Firestore nightly tests"
194
198
apis="firestore"
195
199
else
196
- echo "::warning ::Running main nightly tests"
200
+ echo "::warning ::Running pull request tests"
197
201
apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )
198
202
fi
199
203
if [[ "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
@@ -762,17 +766,22 @@ jobs:
762
766
timeout_minutes : 15
763
767
max_attempts : 3
764
768
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 )
766
770
uses : actions/setup-node@v3
767
771
with :
768
- node-version : 16 .x
772
+ node-version : 18 .x
769
773
- name : Setup Firestore Emulator
770
774
uses : nick-invision/retry@v2
771
775
with :
772
776
shell : bash
773
777
timeout_minutes : 5
774
778
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
776
785
- name : Setup java
777
786
uses : actions/setup-java@v3
778
787
with :
@@ -983,7 +992,7 @@ jobs:
983
992
test_android :
984
993
name : test-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}
985
994
needs : [check_and_prepare, build_android]
986
- runs-on : macos-12
995
+ runs-on : ubuntu-20.04
987
996
if : contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
988
997
strategy :
989
998
fail-fast : false
@@ -1020,7 +1029,7 @@ jobs:
1020
1029
id : device-info
1021
1030
run : |
1022
1031
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
1024
1033
- name : Setup java 8 for test_simulator.py
1025
1034
uses : actions/setup-java@v3
1026
1035
with :
@@ -1037,15 +1046,17 @@ jobs:
1037
1046
--ci
1038
1047
- id : ftl_test
1039
1048
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
1042
1051
with :
1043
1052
credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
1044
1053
testapp_dir : testapps
1045
1054
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
1047
1057
max_attempts : 3
1048
1058
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 }}'
1049
1060
- name : Read FTL Test Result
1050
1061
if : ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
1051
1062
shell : bash
@@ -1147,11 +1158,11 @@ jobs:
1147
1158
id : device-info
1148
1159
run : |
1149
1160
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 )
1152
1163
uses : actions/setup-node@v3
1153
1164
with :
1154
- node-version : 16 .x
1165
+ node-version : 18 .x
1155
1166
- name : Setup java for Firestore emulator
1156
1167
uses : actions/setup-java@v3
1157
1168
with :
@@ -1164,7 +1175,13 @@ jobs:
1164
1175
shell : bash
1165
1176
timeout_minutes : 5
1166
1177
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
1168
1185
- name : Start Firestore Emulator
1169
1186
if : steps.device-info.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1170
1187
run : |
@@ -1180,15 +1197,17 @@ jobs:
1180
1197
--ci
1181
1198
- id : ftl_test
1182
1199
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
1184
1201
timeout-minutes : 90
1185
1202
with :
1186
1203
credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
1187
1204
testapp_dir : testapps
1188
1205
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
1190
1208
max_attempts : 3
1191
1209
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 }}'
1192
1211
- name : Read FTL Test Result
1193
1212
if : ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
1194
1213
shell : bash
@@ -1283,7 +1302,13 @@ jobs:
1283
1302
shell : bash
1284
1303
timeout_minutes : 5
1285
1304
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
1287
1312
- name : Start Firestore Emulator
1288
1313
if : contains(needs.check_and_prepare.outputs.apis, 'firestore')
1289
1314
run : |
@@ -1408,3 +1433,34 @@ jobs:
1408
1433
${additional_flags[*]}
1409
1434
- name : Summarize results into GitHub log
1410
1435
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