9
9
10
10
workflow_dispatch :
11
11
inputs :
12
- build_os :
13
- description : ' Build OS (windows-latest,macos-latest)'
14
- default : ' macos-latest'
15
- required : true
16
12
unity_versions :
17
13
description : ' Unity version'
18
14
default : ' 2019'
19
15
required : true
16
+ build_os :
17
+ description : ' Build OS (windows-latest,macos-latest)'
18
+ default : ' macos-latest'
19
+ required : true
20
20
platforms :
21
21
description : ' CSV of Android,iOS,Windows,macOS,Linux'
22
22
default : ' Android,iOS,Windows,macOS,Linux'
@@ -182,16 +182,26 @@ jobs:
182
182
echo "::set-output name=mobile_test_on::${mobile_test_on}"
183
183
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} )"
184
184
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} )"
185
+ - name : Update PR label and comment
186
+ if : steps.set_outputs.outputs.pr_number
187
+ run : |
188
+ #Add the in-progress label and remove any previous labels.
189
+ python scripts/gha/it_workflow.py --stage start \
190
+ --token ${{github.token}} \
191
+ --issue_number ${{steps.set_outputs.outputs.pr_number}} \
192
+ --actor ${{github.actor}} \
193
+ --commit ${{steps.set_outputs.outputs.github_ref}} \
194
+ --run_id ${{github.run_id}}
185
195
186
196
build :
187
- name : build-${{matrix.os }}-${{ matrix.unity_version }}-${{ needs.check_and_prepare.outputs.platform }}
197
+ name : build-${{ matrix.unity_version }}-${{matrix.os }}-${{ needs.check_and_prepare.outputs.platform }}
188
198
runs-on : ${{matrix.os}}
189
199
needs : check_and_prepare
190
200
strategy :
191
201
fail-fast : false
192
202
matrix :
193
- os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_build_os) }}
194
203
unity_version : ${{ fromJson(needs.check_and_prepare.outputs.matrix_unity_versions) }}
204
+ os : ${{ fromJson(needs.check_and_prepare.outputs.matrix_build_os) }}
195
205
env :
196
206
# LC_ALL, LANG and U3D_PASSWORD are needed for U3D.
197
207
LC_ALL : en_US.UTF-8
@@ -267,7 +277,7 @@ jobs:
267
277
--ios_sdk ${{ needs.check_and_prepare.outputs.mobile_test_on }} \
268
278
--plugin_dir ~/Downloads/firebase_unity_sdk \
269
279
--output_directory "${{ github.workspace }}" \
270
- --artifact_name "${{matrix.os}}-${{ matrix.unity_version }}-all " \
280
+ --artifact_name "${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}" \
271
281
--force_latest_runtime \
272
282
--ci
273
283
- name : Return Unity license
@@ -288,51 +298,51 @@ jobs:
288
298
if : ${{ !cancelled() }}
289
299
shell : bash
290
300
run : |
291
- if [ ! -f build-results-${{matrix.os}}-${{ matrix.unity_version }}-all .log.json ]; then
301
+ if [ ! -f build-results-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}.log.json ]; then
292
302
# No summary was created, make a placeholder one.
293
- echo "__SUMMARY_MISSING__" > build-results-${{matrix.os}}-${{ matrix.unity_version }}-all .log.json
303
+ echo "__SUMMARY_MISSING__" > build-results-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}.log.json
294
304
fi
295
305
- name : Upload build results artifact
296
306
297
307
if : ${{ !cancelled() }}
298
308
with :
299
309
name : log-artifact
300
- path : build-results-${{matrix.os}}-${{ matrix.unity_version }}-all *
310
+ path : build-results-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}*
301
311
retention-days : ${{ env.artifactRetentionDays }}
302
312
- name : Upload Android integration tests artifact
303
313
304
314
if : contains(needs.check_and_prepare.outputs.platform, 'Android') && ${{ !cancelled() }}
305
315
with :
306
- name : testapps-${{matrix.os }}-${{ matrix.unity_version }}-Android
307
- path : testapps-${{matrix.os}}-${{ matrix.unity_version }}-all /Android
316
+ name : testapps-${{ matrix.unity_version }}-${{matrix.os }}-Android
317
+ path : testapps-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}/Android
308
318
retention-days : ${{ env.artifactRetentionDays }}
309
319
- name : Upload iOS integration tests artifact
310
320
311
321
if : contains(needs.check_and_prepare.outputs.platform, 'iOS') && ${{ !cancelled() }}
312
322
with :
313
- name : testapps-${{matrix.os }}-${{ matrix.unity_version }}-iOS
314
- path : testapps-${{matrix.os}}-${{ matrix.unity_version }}-all /iOS
323
+ name : testapps-${{ matrix.unity_version }}-${{matrix.os }}-iOS
324
+ path : testapps-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}/iOS
315
325
retention-days : ${{ env.artifactRetentionDays }}
316
326
- name : Upload Linux integration tests artifact
317
327
318
328
if : contains(needs.check_and_prepare.outputs.platform, 'Linux') && ${{ !cancelled() }}
319
329
with :
320
- name : testapps-${{matrix.os }}-${{ matrix.unity_version }}-ubuntu-latest
321
- path : testapps-${{matrix.os}}-${{ matrix.unity_version }}-all /Linux
330
+ name : testapps-${{ matrix.unity_version }}-${{matrix.os }}-ubuntu-latest
331
+ path : testapps-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}/Linux
322
332
retention-days : ${{ env.artifactRetentionDays }}
323
333
- name : Upload macOS integration tests artifact
324
334
325
335
if : contains(needs.check_and_prepare.outputs.platform, 'macOS') && ${{ !cancelled() }}
326
336
with :
327
- name : testapps-${{matrix.os }}-${{ matrix.unity_version }}-macos-latest
328
- path : testapps-${{matrix.os}}-${{ matrix.unity_version }}-all /macOS
337
+ name : testapps-${{ matrix.unity_version }}-${{matrix.os }}-macos-latest
338
+ path : testapps-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}/macOS
329
339
retention-days : ${{ env.artifactRetentionDays }}
330
340
- name : Upload Windows integration tests artifact
331
341
332
342
if : contains(needs.check_and_prepare.outputs.platform, 'Windows') && ${{ !cancelled() }}
333
343
with :
334
- name : testapps-${{matrix.os }}-${{ matrix.unity_version }}-windows-latest
335
- path : testapps-${{matrix.os}}-${{ matrix.unity_version }}-all /Windows
344
+ name : testapps-${{ matrix.unity_version }}-${{matrix.os }}-windows-latest
345
+ path : testapps-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}/Windows
336
346
retention-days : ${{ env.artifactRetentionDays }}
337
347
- name : Download log artifacts
338
348
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
@@ -342,6 +352,7 @@ jobs:
342
352
name : log-artifact
343
353
- name : Update PR label and comment
344
354
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
355
+ shell : bash
345
356
run : |
346
357
python scripts/gha/it_workflow.py --stage progress \
347
358
--token ${{github.token}} \
@@ -353,14 +364,14 @@ jobs:
353
364
if : ${{ !cancelled() }}
354
365
shell : bash
355
366
run : |
356
- cat build-results-${{matrix.os}}-${{ matrix.unity_version }}-all .log
367
+ cat build-results-${{ matrix.unity_version }}-${{matrix. os}}-${{ needs.check_and_prepare.outputs.platform }}.log
357
368
if [[ "${{ job.status }}" != "success" ]]; then
358
369
exit 1
359
370
fi
360
371
361
372
362
373
test_desktop :
363
- name : test-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop
374
+ name : test-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop
364
375
runs-on : ${{ matrix.os }}
365
376
if : (contains(needs.check_and_prepare.outputs.platform, 'Windows') || contains(needs.check_and_prepare.outputs.platform, 'macOS') || contains(needs.check_and_prepare.outputs.platform, 'Linux')) && !cancelled()
366
377
needs : [check_and_prepare, build]
@@ -378,7 +389,7 @@ jobs:
378
389
379
390
with :
380
391
path : testapps
381
- name : testapps-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}
392
+ name : testapps-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}
382
393
- name : Setup python
383
394
uses : actions/setup-python@v2
384
395
with :
@@ -393,20 +404,20 @@ jobs:
393
404
shell : bash
394
405
run : |
395
406
python scripts/gha/desktop_tester.py --testapp_dir testapps \
396
- --logfile_name "${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop"
407
+ --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop"
397
408
- name : Prepare results summary artifact
398
409
if : ${{ !cancelled() }}
399
410
shell : bash
400
411
run : |
401
- if [ ! -f testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop.log.json ]; then
402
- mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop.log.json
412
+ if [ ! -f testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop.log.json ]; then
413
+ mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop.log.json
403
414
fi
404
415
- name : Upload Desktop test results artifact
405
416
if : ${{ !cancelled() }}
406
417
407
418
with :
408
419
name : log-artifact
409
- path : testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop*
420
+ path : testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop*
410
421
retention-days : ${{ env.artifactRetentionDays }}
411
422
- name : Download log artifacts
412
423
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
@@ -429,13 +440,13 @@ jobs:
429
440
if : ${{ !cancelled() }}
430
441
shell : bash
431
442
run : |
432
- cat testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.os }}-desktop.log
443
+ cat testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.os }}-desktop.log
433
444
if [[ "${{ job.status }}" != "success" ]]; then
434
445
exit 1
435
446
fi
436
447
437
448
test_mobile :
438
- name : test-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}-${{ matrix.mobile_test_on }}
449
+ name : test-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}-${{ matrix.mobile_test_on }}
439
450
runs-on : macos-11
440
451
if : (contains(needs.check_and_prepare.outputs.platform, 'Android') || contains(needs.check_and_prepare.outputs.platform, 'iOS')) && !cancelled()
441
452
needs : [check_and_prepare, build]
@@ -459,7 +470,7 @@ jobs:
459
470
460
471
with :
461
472
path : testapps
462
- name : testapps-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}
473
+ name : testapps-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}
463
474
- name : Setup python
464
475
uses : actions/setup-python@v2
465
476
with :
@@ -479,29 +490,29 @@ jobs:
479
490
run : |
480
491
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
481
492
python scripts/gha/test_lab.py --testapp_dir testapps \
482
- --logfile_name "${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}" \
493
+ --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}" \
483
494
--code_platform unity \
484
495
--key_file scripts/gha-encrypted/gcs_key_file.json
485
496
- name : Run Mobile integration tests on virtual device locally
486
497
timeout-minutes : 60
487
498
if : matrix.mobile_test_on == 'virtual'
488
499
run : |
489
500
python scripts/gha/test_simulator.py --testapp_dir testapps \
490
- --logfile_name "${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}" \
501
+ --logfile_name "${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}" \
491
502
--ci
492
503
- name : Prepare results summary artifact
493
504
if : ${{ !cancelled() }}
494
505
shell : bash
495
506
run : |
496
- if [ ! -f testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}.log.json ]; then
497
- mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}.log.json
507
+ if [ ! -f testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log.json ]; then
508
+ mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log.json
498
509
fi
499
510
- name : Upload Desktop test results artifact
500
511
if : ${{ !cancelled() }}
501
512
502
513
with :
503
514
name : log-artifact
504
- path : testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}*
515
+ path : testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}*
505
516
retention-days : ${{ env.artifactRetentionDays }}
506
517
- name : Download log artifacts
507
518
if : ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
@@ -522,7 +533,63 @@ jobs:
522
533
if : ${{ !cancelled() }}
523
534
shell : bash
524
535
run : |
525
- cat testapps/test-results-${{ matrix.build_os }}-${{ matrix.unity_version }}-${{ matrix.platform }}.log
536
+ cat testapps/test-results-${{ matrix.unity_version }}-${{ matrix.build_os }}-${{ matrix.platform }}.log
526
537
if [[ "${{ job.status }}" != "success" ]]; then
527
538
exit 1
528
539
fi
540
+
541
+
542
+ summarize_results :
543
+ name : " summarize-results"
544
+ needs : [check_and_prepare, build, test_desktop, test_mobile]
545
+ runs-on : ubuntu-latest
546
+ if : ${{ !cancelled() }}
547
+ steps :
548
+ - uses : actions/checkout@v2
549
+ with :
550
+ ref : ${{needs.check_and_prepare.outputs.github_ref}}
551
+ - name : Setup python
552
+ uses : actions/setup-python@v2
553
+ with :
554
+ python-version : ${{ env.pythonVersion }}
555
+ - name : Install python deps
556
+ run : pip install -r scripts/gha/requirements.txt
557
+ - name : Download log artifacts
558
+
559
+ with :
560
+ path : test_results
561
+ name : log-artifact
562
+ # Use a different token to remove the "in-progress" label,
563
+ # to allow the removal to trigger the "Check Labels" workflow.
564
+ - name : Generate token for GitHub API
565
+ uses : tibdex/github-app-token@v1
566
+ id : generate-token
567
+ with :
568
+ app_id : ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
569
+ private_key : ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
570
+ - name : Update PR label and comment
571
+ if : ${{ needs.check_and_prepare.outputs.pr_number }}
572
+ run : |
573
+ python scripts/gha/it_workflow.py --stage end \
574
+ --token ${{github.token}} \
575
+ --issue_number ${{needs.check_and_prepare.outputs.pr_number}}\
576
+ --actor ${{github.actor}} \
577
+ --commit ${{needs.check_and_prepare.outputs.github_ref}} \
578
+ --run_id ${{github.run_id}} \
579
+ --new_token ${{steps.generate-token.outputs.token}}
580
+ - name : Update Daily Report
581
+ if : needs.check_and_prepare.outputs.trigger == 'scheduled_trigger'
582
+ run : |
583
+ if [[ "${{ github.event.inputs.test_pull_request }}" == "nightly-packaging" ]]; then
584
+ additional_flags=(--build_against sdk)
585
+ else
586
+ additional_flags=(--build_against repo)
587
+ fi
588
+ python scripts/gha/it_workflow.py --stage report \
589
+ --token ${{github.token}} \
590
+ --actor ${{github.actor}} \
591
+ --commit ${{needs.check_and_prepare.outputs.github_ref}} \
592
+ --run_id ${{github.run_id}} \
593
+ ${additional_flags[*]}
594
+ - name : Summarize results into GitHub log
595
+ run : python scripts/gha/summarize_test_results.py --dir test_results --github_log
0 commit comments