Skip to content

Commit 47eb1de

Browse files
authored
Update FTL GHA version & other minor fixes (#494)
1 parent 60f1f0e commit 47eb1de

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.github/workflows/integration_tests.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
name: build-${{ matrix.unity_version }}-${{matrix.os}}-${{ matrix.platform }}-${{ matrix.ios_sdk }}
160160
runs-on: ${{matrix.os}}
161161
needs: check_and_prepare
162+
if: ${{ needs.check_and_prepare.outputs.build_matrix != '' && !cancelled() }}
162163
strategy:
163164
fail-fast: false
164165
matrix: ${{ fromJson(needs.check_and_prepare.outputs.build_matrix) }}
@@ -283,57 +284,57 @@ jobs:
283284
retention-days: ${{ env.artifactRetentionDays }}
284285
- name: Upload Android integration tests artifact
285286
uses: actions/upload-artifact@v3
286-
if: contains(matrix.platform, 'Android') && ${{ !cancelled() }}
287+
if: ${{ contains(matrix.platform, 'Android') && !cancelled() }}
287288
with:
288289
name: testapps-Android-${{ steps.matrix_info.outputs.artifact_suffix }}
289290
path: testapps-${{ steps.matrix_info.outputs.info }}/Android
290291
retention-days: ${{ env.artifactRetentionDays }}
291292
- name: Delete Android integration tests artifact
292-
if: contains(matrix.platform, 'Android') && ${{ !cancelled() }}
293+
if: ${{ contains(matrix.platform, 'Android') && !cancelled() }}
293294
shell: bash
294295
run: rm -rf testapps-${{ steps.matrix_info.outputs.info }}/Android || true
295296
- name: Upload iOS integration tests artifact
296297
uses: actions/upload-artifact@v3
297-
if: contains(matrix.platform, 'iOS') && ${{ !cancelled() }}
298+
if: ${{ contains(matrix.platform, 'iOS') && !cancelled() }}
298299
with:
299300
name: testapps-iOS-${{ steps.matrix_info.outputs.artifact_suffix }}
300301
path: testapps-${{ steps.matrix_info.outputs.info }}/iOS
301302
retention-days: ${{ env.artifactRetentionDays }}
302303
- name: Delete iOS integration tests artifact
303-
if: contains(matrix.platform, 'iOS') && ${{ !cancelled() }}
304+
if: ${{ contains(matrix.platform, 'iOS') && !cancelled() }}
304305
shell: bash
305306
run: rm -rf testapps-${{ steps.matrix_info.outputs.info }}/iOS || true
306307
- name: Upload Linux integration tests artifact
307308
uses: actions/upload-artifact@v3
308-
if: contains(matrix.platform, 'Linux') && ${{ !cancelled() }}
309+
if: ${{ contains(matrix.platform, 'Linux') && !cancelled() }}
309310
with:
310311
name: testapps-Linux-${{ steps.matrix_info.outputs.artifact_suffix }}
311312
path: testapps-${{ steps.matrix_info.outputs.info }}/Linux
312313
retention-days: ${{ env.artifactRetentionDays }}
313314
- name: Delete Linux integration tests artifact
314-
if: contains(matrix.platform, 'Linux') && ${{ !cancelled() }}
315+
if: ${{ contains(matrix.platform, 'Linux') && !cancelled() }}
315316
shell: bash
316317
run: rm -rf testapps-${{ steps.matrix_info.outputs.info }}/Linux || true
317318
- name: Upload macOS integration tests artifact
318319
uses: actions/upload-artifact@v3
319-
if: contains(matrix.platform, 'macOS') && ${{ !cancelled() }}
320+
if: ${{ contains(matrix.platform, 'macOS') && !cancelled() }}
320321
with:
321322
name: testapps-macOS-${{ steps.matrix_info.outputs.artifact_suffix }}
322323
path: testapps-${{ steps.matrix_info.outputs.info }}/macOS
323324
retention-days: ${{ env.artifactRetentionDays }}
324325
- name: Delete macOS integration tests artifact
325-
if: contains(matrix.platform, 'macOS') && ${{ !cancelled() }}
326+
if: ${{ contains(matrix.platform, 'macOS') && !cancelled() }}
326327
shell: bash
327328
run: rm -rf testapps-${{ steps.matrix_info.outputs.info }}/macOS || true
328329
- name: Upload Windows integration tests artifact
329330
uses: actions/upload-artifact@v3
330-
if: contains(matrix.platform, 'Windows') && ${{ !cancelled() }}
331+
if: ${{ contains(matrix.platform, 'Windows') && !cancelled() }}
331332
with:
332333
name: testapps-Windows-${{ steps.matrix_info.outputs.artifact_suffix }}
333334
path: testapps-${{ steps.matrix_info.outputs.info }}/Windows
334335
retention-days: ${{ env.artifactRetentionDays }}
335336
- name: Delete Windows integration tests artifact
336-
if: contains(matrix.platform, 'Windows') && ${{ !cancelled() }}
337+
if: ${{ contains(matrix.platform, 'Windows') && !cancelled() }}
337338
shell: bash
338339
run: rm -rf testapps-${{ steps.matrix_info.outputs.info }}/Windows || true
339340
- name: Download log artifacts
@@ -365,6 +366,7 @@ jobs:
365366
name: test-${{ matrix.unity_version }}-${{matrix.os}}-Playmode
366367
runs-on: ${{matrix.os}}
367368
needs: check_and_prepare
369+
if: ${{ needs.check_and_prepare.outputs.playmode_matrix != '' && !cancelled() }}
368370
strategy:
369371
fail-fast: false
370372
matrix: ${{ fromJson(needs.check_and_prepare.outputs.playmode_matrix) }}
@@ -499,7 +501,7 @@ jobs:
499501
integration_test:
500502
name: test-${{ matrix.unity_version }}-${{matrix.build_os}}-${{ matrix.platform }}-${{ matrix.test_device }}-${{ matrix.test_os }}
501503
runs-on: ${{ matrix.test_os }}
502-
if: ${{ !cancelled() }}
504+
if: ${{ needs.check_and_prepare.outputs.build_matrix != '' && needs.check_and_prepare.outputs.test_matrix != '' && !cancelled() }}
503505
needs: [check_and_prepare, build_testapp]
504506
strategy:
505507
fail-fast: false
@@ -535,7 +537,7 @@ jobs:
535537
- name: Run Mobile integration tests on real device via FTL
536538
id: ftl_test
537539
if: ${{ matrix.device_type == 'real' }}
538-
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.1
540+
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
539541
with:
540542
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
541543
testapp_dir: testapps

scripts/gha/print_matrix_configuration.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ def get_testapp_build_matrix(matrix_type, unity_versions, platforms, build_os, i
268268

269269
# generate base matrix: combinations of (unity_versions, platforms, build_os)
270270
l = list(itertools.product(unity_versions, platforms, build_os))
271+
if not l: return ""
272+
271273
matrix = {"include": []}
272274
for li in l:
273275
unity_version = li[0]
@@ -320,11 +322,14 @@ def get_testapp_test_matrix(matrix_type, unity_versions, platforms, build_os, mo
320322

321323
if matrix_type: unity_versions = get_value("integration_tests", matrix_type, "unity_versions")
322324
if matrix_type: platforms = get_value("integration_tests", matrix_type, "platforms")
325+
if PLAYMODE in platforms: platforms.remove(PLAYMODE)
323326
if matrix_type: build_os = get_value("integration_tests", matrix_type, "build_os")
324327
if matrix_type: mobile_device_types = get_value("integration_tests", matrix_type, "mobile_test_on")
325328

326329
# generate base matrix: combinations of (unity_versions, platforms, build_os)
327330
l = list(itertools.product(unity_versions, platforms, build_os))
331+
if not l: return ""
332+
328333
matrix = {"include": []}
329334
for li in l:
330335
unity_version = li[0]
@@ -333,11 +338,12 @@ def get_testapp_test_matrix(matrix_type, unity_versions, platforms, build_os, mo
333338

334339
if platform in [WINDOWS, MACOS, LINUX]:
335340
test_os = _get_test_os(platform)
336-
matrix["include"].append({"unity_version": unity_version, "platform": platform, "build_os": build_os, "test_os": test_os, "test_device": "github_runner", "ios_sdk": "NA"})
341+
matrix["include"].append({"unity_version": unity_version, "platform": platform, "build_os": build_os, "test_os": test_os, "test_device": "github_runner", "device_detail": "NA", "device_type": "NA", "ios_sdk": "NA"})
337342
else:
338343
mobile_devices = get_value("integration_tests", matrix_type, "mobile_devices")
339344
for mobile_device in mobile_devices:
340345
device_detail = TEST_DEVICES.get(mobile_device).get("device")
346+
if not device_detail: device_detail = "NA"
341347
device_type = TEST_DEVICES.get(mobile_device).get("type")
342348
device_platform = TEST_DEVICES.get(mobile_device).get("platform")
343349
if device_platform == platform and device_type in mobile_device_types:

0 commit comments

Comments
 (0)