Skip to content

Commit 190fe43

Browse files
authored
Stable builds (#1415)
* Delay to sync up builds * Adding in ending step * Add in script * Activate the license first * Export the mac runner verions * Just hard code in mac 14 * Fix up comments
1 parent b0224d6 commit 190fe43

1 file changed

Lines changed: 49 additions & 6 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
build_matrix: ${{ steps.matrix_config.outputs.build_matrix }}
5252
test_matrix: ${{ steps.matrix_config.outputs.test_matrix }}
5353
playmode_matrix: ${{ steps.matrix_config.outputs.playmode_matrix }}
54+
macos_runner: ${{ steps.matrix_config.outputs.macos_runner }}
5455
steps:
5556
### Fail the workflow if the user does not have admin access to run the tests.
5657
- name: Check if user has permission to trigger tests
@@ -282,9 +283,11 @@ jobs:
282283
MATRIX_PLATFORM: ${{ matrix.platform }}
283284
MATRIX_IOS_SDK: ${{ matrix.ios_sdk }}
284285
STEPS_MATRIX_INFO_OUTPUTS_INFO: ${{ steps.matrix_info.outputs.info }}
285-
- name: Return Unity license
286-
# Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
287-
if: always()
286+
- name: Return Unity license (Non-macOS only)
287+
# Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
288+
# Note: macOS is handled by the 'teardown-unity-license' step.
289+
# This is due to a quirk with licenses see the teardown-unity-license' step.
290+
if: always() && runner.os != 'macOS'
288291
uses: ./gha/unity
289292
with:
290293
version: ${{ matrix.unity_version }}
@@ -484,9 +487,11 @@ jobs:
484487
GITHUB_EVENT_INPUTS_PACKAGED_SDK_RUN_ID: ${{ github.event.inputs.packaged_sdk_run_id }}
485488
NEEDS_CHECK_AND_PREPARE_OUTPUTS_APIS: ${{ needs.check_and_prepare.outputs.apis }}
486489
STEPS_MATRIX_INFO_OUTPUTS_INFO: ${{ steps.matrix_info.outputs.info }}
487-
- name: Return Unity license
488-
# Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
489-
if: always()
490+
- name: Return Unity license (Non-macOS only)
491+
# Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
492+
# Note: macOS is handled by the 'teardown-unity-license' step.
493+
# This is due to a quirk with licenses see the teardown-unity-license step for more information
494+
if: always() && runner.os != 'macOS'
490495
uses: ./gha/unity
491496
with:
492497
version: ${{ matrix.unity_version }}
@@ -813,3 +818,41 @@ jobs:
813818
-A
814819
env:
815820
STEPS_GENERATE_TOKEN_OUTPUTS_TOKEN: ${{ steps.generate-token.outputs.token }}
821+
822+
teardown_unity_license:
823+
name: "teardown-unity-license"
824+
# When one Mac runner is released, the license is removed from all of them.
825+
# This appears to be quirk of the Github actions Mac VM's and the Unity license server.
826+
# For some reason the Unity license server see all the Mac runners as the same machine.
827+
# As a result returning one machine's license returns it from all the machines.
828+
# Our best guess is something to do with the MAC address all being the same across the Mac runners.
829+
# Therefore we wait for the builds to complete before returning the license.
830+
# Ensures that all the build and playmode tests complete before the license is returned from all the machines.
831+
runs-on: macos-14
832+
# Wait for both build and playmode to finish before returning the license
833+
needs: [build_testapp, playmode_test]
834+
if: always()
835+
strategy:
836+
fail-fast: false
837+
matrix:
838+
unity_version: ['2021', '2022']
839+
steps:
840+
- uses: actions/checkout@v3
841+
- name: Setup python
842+
uses: actions/setup-python@v4
843+
with:
844+
python-version: '3.9'
845+
- name: Install python deps
846+
run: pip install -r scripts/gha/requirements.txt
847+
- name: Activate Unity license
848+
uses: ./gha/unity
849+
with:
850+
version: ${{ matrix.unity_version }}
851+
username: ${{ secrets.UNITY_USERNAME }}
852+
password: ${{ secrets.UNITY_PASSWORD }}
853+
serial_ids: ${{ secrets.SERIAL_ID }}
854+
- name: Return Unity license
855+
uses: ./gha/unity
856+
with:
857+
version: ${{ matrix.unity_version }}
858+
release_license: "true"

0 commit comments

Comments
 (0)