63
63
platform : ${{ steps.matrix_config.outputs.platform }}
64
64
apis : ${{ steps.matrix_config.outputs.apis }}
65
65
mobile_test_on : ${{ steps.matrix_config.outputs.mobile_test_on }}
66
- android_device : ${{ steps.matrix_config.outputs.android_device }}
67
- ios_device : ${{ steps.matrix_config.outputs.ios_device }}
66
+ mobile_device : ${{ steps.matrix_config.outputs.mobile_device }}
68
67
steps :
69
68
# ## Fail the workflow if the user does not have admin access to run the tests.
70
69
- name : Check if user has permission to trigger tests
@@ -179,8 +178,7 @@ jobs:
179
178
echo "::set-output name=matrix_unity_versions::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${TEST_MATRIX_PARAM} -k unity_version -o "${{github.event.inputs.unity_versions}}")"
180
179
mobile_test_on=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k mobile_test_on -o "${{github.event.inputs.mobile_test_on}}")
181
180
echo "::set-output name=mobile_test_on::${mobile_test_on}"
182
- echo "::set-output name=android_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${TEST_MATRIX_PARAM} -k android_device -t ${mobile_test_on} )"
183
- echo "::set-output name=ios_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${TEST_MATRIX_PARAM} -k ios_device -t ${mobile_test_on} )"
181
+ echo "::set-output name=mobile_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${TEST_MATRIX_PARAM} -k mobile_device -t ${mobile_test_on} -p ${platform})"
184
182
- name : Update PR label and comment
185
183
if : steps.set_outputs.outputs.pr_number
186
184
run : |
@@ -255,7 +253,6 @@ jobs:
255
253
run_id : ${{ github.event.inputs.test_packaged_sdk }}
256
254
257
255
- name : Build integration tests
258
- timeout-minutes : 220
259
256
shell : bash
260
257
run : |
261
258
if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then
@@ -271,7 +268,7 @@ jobs:
271
268
fi
272
269
python scripts/gha/build_testapps.py \
273
270
--t ${{ needs.check_and_prepare.outputs.apis }} \
274
- --u $( python scripts/gha/print_matrix_configuration.py -u ${{matrix.unity_version}} -k version ) \
271
+ --u $( python scripts/gha/print_matrix_configuration.py -k version - u ${{matrix.unity_version}}) \
275
272
--p ${{ needs.check_and_prepare.outputs.platform }} \
276
273
--ios_sdk ${{ needs.check_and_prepare.outputs.mobile_test_on }} \
277
274
--plugin_dir ~/Downloads/firebase_unity_sdk \
@@ -315,34 +312,54 @@ jobs:
315
312
name : testapps-${{ matrix.unity_version }}-${{matrix.os}}-Android
316
313
path : testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Android
317
314
retention-days : ${{ env.artifactRetentionDays }}
315
+ - name : Delete Android integration tests artifact
316
+ if : contains(needs.check_and_prepare.outputs.platform, 'Android') && ${{ !cancelled() }}
317
+ shell : bash
318
+ run : rm -rf testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Android || true
318
319
- name : Upload iOS integration tests artifact
319
320
320
321
if : contains(needs.check_and_prepare.outputs.platform, 'iOS') && ${{ !cancelled() }}
321
322
with :
322
323
name : testapps-${{ matrix.unity_version }}-${{matrix.os}}-iOS
323
324
path : testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/iOS
324
325
retention-days : ${{ env.artifactRetentionDays }}
326
+ - name : Delete iOS integration tests artifact
327
+ if : contains(needs.check_and_prepare.outputs.platform, 'iOS') && ${{ !cancelled() }}
328
+ shell : bash
329
+ run : rm -rf testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/iOS || true
325
330
- name : Upload Linux integration tests artifact
326
331
327
332
if : contains(needs.check_and_prepare.outputs.platform, 'Linux') && ${{ !cancelled() }}
328
333
with :
329
334
name : testapps-${{ matrix.unity_version }}-${{matrix.os}}-ubuntu-latest
330
335
path : testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Linux
331
336
retention-days : ${{ env.artifactRetentionDays }}
337
+ - name : Delete Linux integration tests artifact
338
+ if : contains(needs.check_and_prepare.outputs.platform, 'Linux') && ${{ !cancelled() }}
339
+ shell : bash
340
+ run : rm -rf testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Linux || true
332
341
- name : Upload macOS integration tests artifact
333
342
334
343
if : contains(needs.check_and_prepare.outputs.platform, 'macOS') && ${{ !cancelled() }}
335
344
with :
336
345
name : testapps-${{ matrix.unity_version }}-${{matrix.os}}-macos-latest
337
346
path : testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/macOS
338
347
retention-days : ${{ env.artifactRetentionDays }}
348
+ - name : Delete macOS integration tests artifact
349
+ if : contains(needs.check_and_prepare.outputs.platform, 'macOS') && ${{ !cancelled() }}
350
+ shell : bash
351
+ run : rm -rf testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/macOS || true
339
352
- name : Upload Windows integration tests artifact
340
353
341
354
if : contains(needs.check_and_prepare.outputs.platform, 'Windows') && ${{ !cancelled() }}
342
355
with :
343
356
name : testapps-${{ matrix.unity_version }}-${{matrix.os}}-windows-latest
344
357
path : testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Windows
345
358
retention-days : ${{ env.artifactRetentionDays }}
359
+ - name : Delete Windows integration tests artifact
360
+ if : contains(needs.check_and_prepare.outputs.platform, 'Windows') && ${{ !cancelled() }}
361
+ shell : bash
362
+ run : rm -rf testapps-${{ matrix.unity_version }}-${{matrix.os}}-${{ needs.check_and_prepare.outputs.platform }}/Windows || true
346
363
- name : Download log artifacts
347
364
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
348
365
@@ -377,9 +394,9 @@ jobs:
377
394
strategy :
378
395
fail-fast : false
379
396
matrix :
397
+ unity_version : ${{ fromJson(needs.check_and_prepare.outputs.matrix_unity_versions) }}
380
398
build_os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_build_os) }}
381
399
os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_desktop_os) }}
382
- unity_version : ${{ fromJson(needs.check_and_prepare.outputs.matrix_unity_versions) }}
383
400
steps :
384
401
- uses : actions/checkout@v2
385
402
with :
@@ -428,7 +445,6 @@ jobs:
428
445
shell : bash
429
446
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
430
447
run : |
431
- pushd ${{env.GCS_UPLOAD_DIR}}
432
448
python scripts/gha/it_workflow.py --stage progress \
433
449
--token ${{github.token}} \
434
450
--issue_number ${{needs.check_and_prepare.outputs.pr_number}}\
@@ -445,31 +461,20 @@ jobs:
445
461
fi
446
462
447
463
test_mobile :
448
- name : test-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}-${{ matrix.mobile_test_on }}
464
+ name : test-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile
449
465
runs-on : macos-11
450
466
if : (contains(needs.check_and_prepare.outputs.platform, 'Android') || contains(needs.check_and_prepare.outputs.platform, 'iOS')) && !cancelled()
451
467
needs : [check_and_prepare, build]
452
468
strategy :
453
469
fail-fast : false
454
470
matrix :
455
- build_os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_build_os) }}
456
- platform : ${{ fromJson(needs.check_and_prepare.outputs.matrix_mobile_platform) }}
457
471
unity_version : ${{ fromJson(needs.check_and_prepare.outputs.matrix_unity_versions) }}
458
- include :
459
- # TODO(sunmou): include test device that are currently working
460
- - platform : " Android"
461
- mobile_test_on : " real"
462
- - platform : " iOS"
463
- mobile_test_on : " virtual"
472
+ build_os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_build_os) }}
473
+ mobile_device : ${{ fromJson(needs.check_and_prepare.outputs.mobile_device) }}
464
474
steps :
465
475
- uses : actions/checkout@v2
466
476
with :
467
477
ref : ${{needs.check_and_prepare.outputs.github_ref}}
468
- - name : Download Desktop integration tests artifact
469
-
470
- with :
471
- path : testapps
472
- name : testapps-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}
473
478
- name : Setup python
474
479
uses : actions/setup-python@v2
475
480
with :
@@ -479,39 +484,52 @@ jobs:
479
484
shell : bash
480
485
run : |
481
486
pip install -r scripts/gha/requirements.txt
487
+ - id : device-info
488
+ run : |
489
+ echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.mobile_device }} -get_device_type)"
490
+ echo "::set-output name=device_platform::$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.mobile_device }} -get_device_platform)"
491
+ - name : Download Desktop integration tests artifact
492
+
493
+ with :
494
+ path : testapps
495
+ name : testapps-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ steps.device-info.outputs.device_platform }}
482
496
- name : Install Cloud SDK
483
- if : matrix.mobile_test_on == 'real'
497
+ if : steps.device-info.outputs.device_type == 'real'
484
498
uses : google-github-actions/setup-gcloud@master
485
499
- name : Run Mobile integration tests on Real Device via FTL
486
- if : matrix.mobile_test_on == 'real'
500
+ if : steps.device-info.outputs.device_type == 'real'
487
501
timeout-minutes : 60
488
502
shell : bash
489
503
run : |
490
504
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
491
505
python scripts/gha/test_lab.py --testapp_dir testapps \
492
- --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}" \
506
+ --ios_device "${{ matrix.mobile_device }}" \
507
+ --android_device "${{ matrix.mobile_device }}" \
508
+ --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile" \
493
509
--code_platform unity \
494
510
--key_file scripts/gha-encrypted/gcs_key_file.json
495
511
- name : Run Mobile integration tests on virtual device locally
496
512
timeout-minutes : 60
497
- if : matrix.mobile_test_on == 'virtual'
513
+ if : steps.device-info.outputs.device_type == 'virtual'
498
514
run : |
499
515
python scripts/gha/test_simulator.py --testapp_dir testapps \
500
- --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}" \
516
+ --ios_device "${{ matrix.mobile_device }}" \
517
+ --android_device "${{ matrix.mobile_device }}" \
518
+ --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile" \
501
519
--ci
502
520
- name : Prepare results summary artifact
503
521
if : ${{ !cancelled() }}
504
522
shell : bash
505
523
run : |
506
- if [ ! -f testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log.json ]; then
507
- mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log.json
524
+ if [ ! -f testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile .log.json ]; then
525
+ mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile .log.json
508
526
fi
509
- - name : Upload Desktop test results artifact
527
+ - name : Upload Mobile test results artifact
510
528
if : ${{ !cancelled() }}
511
529
512
530
with :
513
531
name : log-artifact
514
- path : testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}*
532
+ path : testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile *
515
533
retention-days : ${{ env.artifactRetentionDays }}
516
534
- name : Download log artifacts
517
535
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
@@ -532,7 +550,7 @@ jobs:
532
550
if : ${{ !cancelled() }}
533
551
shell : bash
534
552
run : |
535
- cat testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log
553
+ cat testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.mobile_device }}-mobile .log
536
554
if [[ "${{ job.status }}" != "success" ]]; then
537
555
exit 1
538
556
fi
0 commit comments