@@ -988,9 +988,10 @@ jobs:
988
988
timeout_minutes : 5
989
989
max_attempts : 3
990
990
command : scripts/gha/install_test_workflow_prereqs.sh -p Android -t true
991
- - id : get- device-type
991
+ - id : device-info
992
992
run : |
993
- echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )"
993
+ echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_device_type)"
994
+ echo "::set-output name=device::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device)"
994
995
- name : Set up Node (16)
995
996
uses : actions/setup-node@v2
996
997
with :
@@ -1001,15 +1002,15 @@ jobs:
1001
1002
distribution : ' temurin'
1002
1003
java-version : ' 17'
1003
1004
- name : Setup Firestore Emulator
1004
- if : steps.get- device-type .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1005
+ if : steps.device-info .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1005
1006
uses : nick-invision/retry@v2
1006
1007
with :
1007
1008
shell : bash
1008
1009
timeout_minutes : 5
1009
1010
max_attempts : 3
1010
1011
command : npm install -g firebase-tools
1011
1012
- name : Start Firestore Emulator
1012
- if : steps.get- device-type .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1013
+ if : steps.device-info .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1013
1014
run : |
1014
1015
firebase emulators:start --only firestore --project demo-example &
1015
1016
- name : Setup java 8 for test_simulator.py
@@ -1018,27 +1019,31 @@ jobs:
1018
1019
distribution : ' temurin'
1019
1020
java-version : ' 8'
1020
1021
- name : Run Android integration tests on Emulator locally
1021
- timeout-minutes : 120
1022
- if : steps.get- device-type .outputs.device_type == 'virtual'
1022
+ timeout-minutes : 150
1023
+ if : steps.device-info .outputs.device_type == 'virtual'
1023
1024
run : |
1024
1025
python scripts/gha/test_simulator.py --testapp_dir testapps \
1025
1026
--test_type "${{ matrix.test_type }}" \
1026
1027
--android_device "${{ matrix.android_device }}" \
1027
1028
--logfile_name "android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}" \
1028
1029
--ci
1029
- - name : Install Cloud SDK
1030
- if : steps.get-device-type.outputs.device_type == 'real'
1031
- uses : google-github-actions/setup-gcloud@v0
1032
- - name : Run Android integration tests on Real Device via FTL
1033
- timeout-minutes : 60
1034
- if : steps.get-device-type.outputs.device_type == 'real'
1030
+ - id : ftl_test
1031
+ if : steps.device-info.outputs.device_type == 'real'
1032
+ uses :
FirebaseExtended/github-actions/[email protected]
1033
+ timeout-minutes : 90
1034
+ with :
1035
+ credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
1036
+ testapp_dir : testapps
1037
+ test_type : " game-loop"
1038
+ test_devices : ${{ steps.device-info.outputs.device }}
1039
+ max_attempts : 3
1040
+ validator : ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1041
+ - name : Read FTL Test Result
1042
+ if : steps.device-info.outputs.device_type == 'real'
1043
+ shell : bash
1035
1044
run : |
1036
- python scripts/gha/test_lab.py --testapp_dir testapps \
1037
- --android_device "${{ matrix.android_device }}" \
1038
- --logfile_name "android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}" \
1039
- --code_platform cpp \
1040
- --key_file_encrypted scripts/gha-encrypted/gcs_key_file.json.gpg \
1041
- --key_file_passphrase "${{ secrets.TEST_SECRET }}"
1045
+ python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \
1046
+ --output_path testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.log
1042
1047
- name : Prepare results summary artifact
1043
1048
if : ${{ !cancelled() }}
1044
1049
shell : bash
@@ -1055,14 +1060,14 @@ jobs:
1055
1060
path : testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}*
1056
1061
retention-days : ${{ env.artifactRetentionDays }}
1057
1062
- name : Upload Android test video artifact
1058
- if : ${{ steps.get- device-type .outputs.device_type == 'virtual' && !cancelled() }}
1063
+ if : ${{ steps.device-info .outputs.device_type == 'virtual' && !cancelled() }}
1059
1064
uses : actions/upload-artifact@v3
1060
1065
with :
1061
1066
name : mobile-simulator-test-video-artifact
1062
1067
path : testapps/video-*-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.mp4
1063
1068
retention-days : ${{ env.artifactRetentionDays }}
1064
1069
- name : Upload Android test logcat artifact
1065
- if : ${{ steps.get- device-type .outputs.device_type == 'virtual' && !cancelled() }}
1070
+ if : ${{ steps.device-info .outputs.device_type == 'virtual' && !cancelled() }}
1066
1071
uses : actions/upload-artifact@v3
1067
1072
with :
1068
1073
name : mobile-simulator-test-logcat-artifact
@@ -1130,9 +1135,10 @@ jobs:
1130
1135
timeout_minutes : 3
1131
1136
max_attempts : 3
1132
1137
command : scripts/gha/install_test_workflow_prereqs.sh -p iOS -t true
1133
- - id : get- device-type
1138
+ - id : device-info
1134
1139
run : |
1135
- echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )"
1140
+ echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_device_type)"
1141
+ echo "::set-output name=device::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_ftl_device)"
1136
1142
- name : Set up Node (16)
1137
1143
uses : actions/setup-node@v2
1138
1144
with :
@@ -1143,40 +1149,43 @@ jobs:
1143
1149
distribution : ' temurin'
1144
1150
java-version : ' 17'
1145
1151
- name : Setup Firestore Emulator
1146
- if : steps.get- device-type .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1152
+ if : steps.device-info .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1147
1153
uses : nick-invision/retry@v2
1148
1154
with :
1149
1155
shell : bash
1150
1156
timeout_minutes : 5
1151
1157
max_attempts : 3
1152
1158
command : npm install -g firebase-tools
1153
1159
- name : Start Firestore Emulator
1154
- if : steps.get- device-type .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1160
+ if : steps.device-info .outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
1155
1161
run : |
1156
1162
firebase emulators:start --only firestore --project demo-example &
1157
1163
- name : Run iOS integration tests on Simulator locally
1158
- timeout-minutes : 120
1159
- if : steps.get- device-type .outputs.device_type == 'virtual'
1164
+ timeout-minutes : 150
1165
+ if : steps.device-info .outputs.device_type == 'virtual'
1160
1166
run : |
1161
1167
python scripts/gha/test_simulator.py --testapp_dir testapps \
1162
1168
--test_type "${{ matrix.test_type }}" \
1163
1169
--ios_device "${{ matrix.ios_device }}" \
1164
1170
--logfile_name "ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}" \
1165
1171
--ci
1166
- - name : Install Cloud SDK
1167
- if : steps.get-device-type.outputs.device_type == 'real'
1168
- uses : google-github-actions/setup-gcloud@v0
1169
- - name : Run iOS integration tests on Real Device via FTL
1170
- # max 3 retry and 10m timeout for each testapp, plus other steps
1171
- timeout-minutes : 60
1172
- if : steps.get-device-type.outputs.device_type == 'real'
1172
+ - id : ftl_test
1173
+ if : steps.device-info.outputs.device_type == 'real'
1174
+ uses :
FirebaseExtended/github-actions/[email protected]
1175
+ timeout-minutes : 90
1176
+ with :
1177
+ credentials_json : ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
1178
+ testapp_dir : testapps
1179
+ test_type : " game-loop"
1180
+ test_devices : ${{ steps.device-info.outputs.device }}
1181
+ max_attempts : 3
1182
+ validator : ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1183
+ - name : Read FTL Test Result
1184
+ if : steps.device-info.outputs.device_type == 'real'
1185
+ shell : bash
1173
1186
run : |
1174
- python scripts/gha/test_lab.py --testapp_dir testapps \
1175
- --ios_device "${{ matrix.ios_device }}" \
1176
- --logfile_name "ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}" \
1177
- --code_platform cpp \
1178
- --key_file_encrypted scripts/gha-encrypted/gcs_key_file.json.gpg \
1179
- --key_file_passphrase "${{ secrets.TEST_SECRET }}"
1187
+ python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \
1188
+ --output_path testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}.log
1180
1189
- name : Prepare results summary artifact
1181
1190
if : ${{ !cancelled() }}
1182
1191
shell : bash
@@ -1193,7 +1202,7 @@ jobs:
1193
1202
path : testapps/test-results-ios-${{ matrix.build_os }}-${{ matrix.ios_device }}-${{ matrix.test_type }}*
1194
1203
retention-days : ${{ env.artifactRetentionDays }}
1195
1204
- name : Upload iOS test video artifact
1196
- if : ${{ steps.get- device-type .outputs.device_type == 'virtual' && !cancelled() }}
1205
+ if : ${{ steps.device-info .outputs.device_type == 'virtual' && !cancelled() }}
1197
1206
uses : actions/upload-artifact@v3
1198
1207
with :
1199
1208
name : mobile-simulator-test-video-artifact
0 commit comments