@@ -184,72 +184,15 @@ jobs:
184184 - name : setup Xcode version
185185 if : runner.os == 'macOS'
186186 run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
187-
188- - name : Setup Unity (Android)
189- if : ${{ contains(matrix.platform, 'Android') }}
190- uses : kuler90/setup-unity@v1
191- timeout-minutes : 30
192- with :
193- unity-version : 2020.3.34f1
194- unity-modules : android
195- # Because of a bug, include iOS for the editor tools
196- - name : Setup Unity (Android, Part 2)
197- if : ${{ contains(matrix.platform, 'Android') }}
198- uses : kuler90/setup-unity@v1
187+ - id : unity_setup
188+ uses : ./gha/unity
199189 timeout-minutes : 30
200190 with :
201- unity-version : 2020.3.34f1
202- unity-modules : ios
203-
204- - name : Setup Unity (iOS)
205- if : ${{ contains(matrix.platform, 'iOS') }}
206- uses : kuler90/setup-unity@v1
207- timeout-minutes : 30
208- with :
209- unity-version : 2020.3.34f1
210- unity-modules : ios
211-
212- - name : Setup Unity (Desktop Windows)
213- if : ${{ !contains(matrix.platform, 'Android') && !contains(matrix.platform, 'iOS') && runner.os != 'macOS' }}
214- uses : kuler90/setup-unity@v1
215- timeout-minutes : 30
216- with :
217- unity-version : 2020.3.34f1
218- unity-modules : mac-mono
219- - name : Setup Unity (Desktop Windows Part 2)
220- if : ${{ !contains(matrix.platform, 'Android') && !contains(matrix.platform, 'iOS') && runner.os != 'macOS' }}
221- uses : kuler90/setup-unity@v1
222- timeout-minutes : 30
223- with :
224- unity-version : 2020.3.34f1
225- unity-modules : linux-mono
226-
227- - name : Setup Unity (Desktop macOS)
228- if : ${{ !contains(matrix.platform, 'Android') && !contains(matrix.platform, 'iOS') && runner.os == 'macOS' }}
229- uses : kuler90/setup-unity@v1
230- timeout-minutes : 30
231- with :
232- unity-version : 2020.3.34f1
233- unity-modules : windows-mono
234- - name : Setup Unity (Desktop macOS Part 2)
235- if : ${{ !contains(matrix.platform, 'Android') && !contains(matrix.platform, 'iOS') && runner.os == 'macOS' }}
236- uses : kuler90/setup-unity@v1
237- timeout-minutes : 30
238- with :
239- unity-version : 2020.3.34f1
240- unity-modules : linux-mono
241-
242- - name : Activate Unity license
243- shell : bash
244- run : |
245- python gha/unity/unity_installer.py --activate_license \
246- --version 2020 \
247- --username "${{ secrets.UNITY_USERNAME }}" \
248- --password "${{ secrets.UNITY_PASSWORD }}" \
249- --serial_ids "${{ secrets.SERIAL_ID }}" \
250- --logfile "testapps/activate_license.log"
251- cat testapps/activate_license.log
252-
191+ version : ${{ matrix.unity_version }}
192+ platforms : ${{ matrix.platform }}
193+ username : ${{ secrets.UNITY_USERNAME }}
194+ password : ${{ secrets.UNITY_PASSWORD }}
195+ serial_ids : ${{ secrets.SERIAL_ID }}
253196 - name : Prepare for integration tests
254197 timeout-minutes : 10
255198 shell : bash
@@ -275,28 +218,21 @@ jobs:
275218 fi
276219 python scripts/gha/build_testapps.py \
277220 --t ${{ needs.check_and_prepare.outputs.apis }} \
278- --u 2020.3.34f1 \
221+ --u ${{ env.UNITY_VERSION }} \
279222 --p "${{ matrix.platform }}" \
280223 --ios_sdk "${{ matrix.ios_sdk }}" \
281224 --plugin_dir ~/Downloads/firebase_unity_sdk \
282225 --output_directory "${{ github.workspace }}" \
283226 --artifact_name "${{ steps.matrix_info.outputs.info }}" \
284227 --force_latest_runtime \
285228 --ci
286-
287229 - name : Return Unity license
230+ # Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
288231 if : always()
289- uses : nick-invision/retry@v2
232+ uses : ./gha/unity
290233 with :
291- timeout_minutes : 5
292- max_attempts : 2
293- shell : bash
294- command : |
295- python gha/unity/unity_installer.py --release_license \
296- --version 2020 \
297- --logfile "testapps/release_license.log"
298- cat testapps/release_license.log
299-
234+ version : ${{ matrix.unity_version }}
235+ release_license : " true"
300236 - name : Prepare results summary artifact
301237 if : ${{ !cancelled() }}
302238 shell : bash
@@ -422,23 +358,15 @@ jobs:
422358 shell : bash
423359 run : |
424360 pip install -r scripts/gha/requirements.txt
425- - name : Setup Unity
426- uses : kuler90/setup- unity@v1
361+ - id : unity_setup
362+ uses : ./gha/ unity
427363 timeout-minutes : 30
428364 with :
429- unity-version : 2020.3.34f1
430- # Install ios for the editor tools
431- unity-modules : ios
432- - name : Activate Unity license
433- shell : bash
434- run : |
435- python gha/unity/unity_installer.py --activate_license \
436- --version 2020 \
437- --username "${{ secrets.UNITY_USERNAME }}" \
438- --password "${{ secrets.UNITY_PASSWORD }}" \
439- --serial_ids "${{ secrets.SERIAL_ID }}" \
440- --logfile "testapps/activate_license.log"
441- cat testapps/activate_license.log
365+ version : ${{ matrix.unity_version }}
366+ platforms : Playmode
367+ username : ${{ secrets.UNITY_USERNAME }}
368+ password : ${{ secrets.UNITY_PASSWORD }}
369+ serial_ids : ${{ secrets.SERIAL_ID }}
442370 - name : Prepare for integration tests
443371 timeout-minutes : 10
444372 shell : bash
@@ -462,25 +390,20 @@ jobs:
462390 fi
463391 python scripts/gha/build_testapps.py \
464392 --t ${{ needs.check_and_prepare.outputs.apis }} \
465- --u 2020.3.34f1 \
393+ --u ${{ env.UNITY_VERSION }} \
466394 --p Playmode \
467395 --plugin_dir ~/Downloads/firebase_unity_sdk \
468396 --output_directory "${{ github.workspace }}" \
469397 --artifact_name "${{ steps.matrix_info.outputs.info }}" \
470398 --force_latest_runtime \
471399 --ci
472400 - name : Return Unity license
401+ # Always returns true, even when job failed or canceled. But will not run when a critical failure prevents the task from running.
473402 if : always()
474- uses : nick-invision/retry@v2
403+ uses : ./gha/unity
475404 with :
476- timeout_minutes : 5
477- max_attempts : 2
478- shell : bash
479- command : |
480- python gha/unity/unity_installer.py --release_license \
481- --version 2020 \
482- --logfile "testapps/release_license.log"
483- cat testapps/release_license.log
405+ version : ${{ matrix.unity_version }}
406+ release_license : " true"
484407 - name : Prepare results summary artifact
485408 if : ${{ !cancelled() }}
486409 shell : bash
@@ -562,7 +485,7 @@ jobs:
562485 test_type : " game-loop"
563486 test_devices : ${{ matrix.device_detail }}
564487 - name : Read FTL Test Result
565- if : ${{ matrix.device_type == 'real' }}
488+ if : ${{ matrix.device_type == 'real' && !cancelled() }}
566489 timeout-minutes : 60
567490 shell : bash
568491 run : |
0 commit comments