This commit is contained in:
Frank Luong 2024-07-30 17:12:59 -04:00
Родитель f60fb5272f
Коммит e2ede1b483
3 изменённых файлов: 139 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,128 @@
# Modeled after Yamato mobile automation example: https://github.cds.internal.unity3d.com/unity/mobile-yamato-example
{% metadata_file .yamato/project.metafile %}
---
{% for project in projects -%}
{% for editor in project.test_editors -%}
Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}:
name: build {{ project.name }} - {{ editor }} on iOS
agent:
type: Unity::VM::osx
image: package-ci/macos-12:v4
flavor: b1.large
commands:
- pip install unity-downloader-cli==1.2.0 --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- unity-downloader-cli -c Editor -c iOS -u {{ editor }} --fast --wait
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
- chmod +x ./utr
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --build-only
artifacts:
players:
paths:
- "build/players/**"
logs:
paths:
- "build/logs/**"
{% endfor -%}
{% endfor -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}:
name: build {{ project.name }} - {{ editor }} on Android
agent:
type: Unity::VM
# Any generic image can be used, no need to have Android tools in the image for building
# All Android tools will be downloaded by unity-downloader-cli
image: mobile/android-execution-base:stable
flavor: b1.xlarge
commands:
# Download unity-downloader-cli
- pip install unity-downloader-cli==1.2.0 --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
- python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform Android
- unity-downloader-cli -c Editor -c Android -u {{ editor }} --fast --wait
# Build player(s)
- set UTR_VERSION=0.12.0
- ./utr.bat --suite=playmode --platform=Android --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --scripting-backend=mono --build-only
artifacts:
players:
paths:
- "build/players/**"
logs:
paths:
- "build/logs/**"
variables:
CI: true
ENABLE_BURST_COMPILATION: False
{% endfor -%}
{% endfor -%}
# For every editor version, run iOS project tests without
# running package tests too since they are handled on their respective jobs
{% for project in projects -%}
{% for editor in project.test_editors -%}
mobile_test_ios_{{ project.name }}_{{ editor }}:
name: {{ project.name }} mobile project tests - {{ editor }} on iOS
agent:
type: Unity::mobile::iPhone
image: package-ci/macos-12:v4
flavor: b1.medium
# Skip repository cloning
skip_checkout: true
# Set a dependency on the build job
dependencies:
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}
commands:
# Download standalone UnityTestRunner
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
# Give UTR execution permissions
- chmod +x ./utr
# Run the test build on the device
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results
artifacts:
logs:
paths:
- "build/test-results/**"
{% endfor -%}
{% endfor -%}
# For every editor version, run Android project tests without
# running package tests too since they are handled on their respective jobs
{% for project in projects -%}
{% for editor in project.test_editors -%}
mobile_test_android_{{ project.name }}_{{ editor }}:
name: {{ project.name }} mobile project tests - {{ editor }} on Android
agent:
type: Unity::mobile::shield
image: mobile/android-execution-base:stable
flavor: b1.medium
# Skip repository cloning
skip_checkout: true
# Set a dependency on the build job
dependencies:
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}
commands:
# Download standalone UnityTestRunner
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
- |
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices
set UTR_VERSION=0.12.0
./utr --artifacts_path=build/test-results --testproject={{ project.path }} --editor-location=.Editor --reruncount=2 --suite=playmode --platform=android --player-load-path=build/players
artifacts:
logs:
paths:
- "build/test-results/**"
{% endfor -%}
{% endfor -%}

Просмотреть файл

@ -40,7 +40,7 @@ projects:
- name: dedicatedgameserver
path: Experimental/DedicatedGameServer
test_editors:
- 6000.0.3
- trunk
run_editor_tests: !!bool false
run_playmode_tests: !!bool true
test_filter: Unity.DedicatedGameServerSample.Tests
@ -49,4 +49,10 @@ projects:
test_editors:
- 2022.3
run_editor_tests: !!bool true
run_playmode_tests: !!bool false
- name: DistributedAuthoritySample
path: Experimental/DistributedAuthoritySample
test_editors:
- trunk
run_editor_tests: !!bool true
run_playmode_tests: !!bool false

Просмотреть файл

@ -14,6 +14,10 @@ pull_request_trigger:
{% endif -%}
{% endfor -%}
{% endfor -%}
# iOS
- .yamato/mobile-build-and-run.yml#mobile_test_ios_{{ project.name }}_{{ editor }}
# Android
- .yamato/mobile-build-and-run.yml#mobile_test_android_{{ project.name }}_{{ editor }}
{% endfor -%}
triggers:
cancel_old_ci: true