Skip to content

Commit 0023594

Browse files
joined mobile build and run to single yml file
1 parent 140e404 commit 0023594

File tree

4 files changed

+129
-131
lines changed

4 files changed

+129
-131
lines changed

.yamato/_triggers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ pull_request_trigger:
1313
- .yamato/project-tests.yml#test_{{ project.name }}_{{ project.test_editors.first }}_{{ platform.name }}
1414
{% endfor -%}
1515
# iOS
16-
- .yamato/mobile-run.yml#mobile_test_ios_{{ project.name }}_{{ project.test_editors.first }}
16+
- .yamato/mobile-build-and-run.yml#mobile_test_ios_{{ project.name }}_{{ project.test_editors.first }}
1717
# Android
18-
- .yamato/mobile-run.yml#mobile_test_android_{{ project.name }}_{{ project.test_editors.first }}
18+
- .yamato/mobile-build-and-run.yml#mobile_test_android_{{ project.name }}_{{ project.test_editors.first }}
1919
{% endfor -%}
2020
triggers:
2121
cancel_old_ci: true

.yamato/mobile-build-and-run.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{% metadata_file .yamato/project.metafile %}
2+
---
3+
4+
{% for project in projects -%}
5+
{% for editor in project.test_editors -%}
6+
Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}:
7+
name: build {{ project.name }} - {{ editor }} on iOS
8+
agent:
9+
type: Unity::VM::osx
10+
image: mobile/macos-10.15-testing:stable
11+
flavor: b1.large
12+
13+
commands:
14+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
15+
- unity-downloader-cli -c Editor -c iOS -u {{ editor }} --fast --wait
16+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
17+
- chmod +x ./utr
18+
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --build-only --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
19+
20+
artifacts:
21+
players:
22+
paths:
23+
- "build/players/**"
24+
logs:
25+
paths:
26+
- "build/logs/**"
27+
{% endfor -%}
28+
{% endfor -%}
29+
30+
{% for project in projects -%}
31+
{% for editor in project.test_editors -%}
32+
Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}:
33+
name: build {{ project.name }} - {{ editor }} on Android
34+
agent:
35+
type: Unity::VM
36+
# Any generic image can be used, no need to have Android tools in the image for building
37+
# All Android tools will be downloaded by unity-downloader-cli
38+
image: desktop/android-execution-r19:v0.1.1-860408
39+
flavor: b1.xlarge
40+
41+
commands:
42+
# Download unity-downloader-cli
43+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
44+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
45+
- python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform Android
46+
- unity-downloader-cli -c Editor -c Android -u {{ editor }} --fast --wait
47+
# Build player(s)
48+
- set UTR_VERSION=0.12.0
49+
- ./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 --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
50+
artifacts:
51+
players:
52+
paths:
53+
- "build/players/**"
54+
logs:
55+
paths:
56+
- "build/logs/**"
57+
variables:
58+
CI: true
59+
ENABLE_BURST_COMPILATION: False
60+
{% endfor -%}
61+
{% endfor -%}
62+
63+
# For every editor version, run iOS project tests without
64+
# running package tests too since they are handled on their respective jobs
65+
{% for project in projects -%}
66+
{% for editor in project.test_editors -%}
67+
mobile_test_ios_{{ project.name }}_{{ editor }}:
68+
name: {{ project.name }} mobile project tests - {{ editor }} on iOS
69+
agent:
70+
type: Unity::mobile::iPhone
71+
image: mobile/macos-10.15-testing:latest
72+
flavor: b1.medium
73+
74+
# Skip repository cloning
75+
skip_checkout: true
76+
77+
# Set a dependency on the build job
78+
dependencies:
79+
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}
80+
81+
commands:
82+
# Download standalone UnityTestRunner
83+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
84+
# Give UTR execution permissions
85+
- chmod +x ./utr
86+
# Run the test build on the device
87+
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
88+
89+
artifacts:
90+
logs:
91+
paths:
92+
- "build/test-results/**"
93+
{% endfor -%}
94+
{% endfor -%}
95+
96+
# For every editor version, run Android project tests without
97+
# running package tests too since they are handled on their respective jobs
98+
{% for project in projects -%}
99+
{% for editor in project.test_editors -%}
100+
mobile_test_android_{{ project.name }}_{{ editor }}:
101+
name: {{ project.name }} mobile project tests - {{ editor }} on Android
102+
agent:
103+
type: Unity::mobile::shield
104+
image: mobile/android-execution-r19:stable
105+
flavor: b1.medium
106+
107+
# Skip repository cloning
108+
skip_checkout: true
109+
# Set a dependency on the build job
110+
dependencies:
111+
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}
112+
commands:
113+
# Download standalone UnityTestRunner
114+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
115+
- |
116+
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
117+
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
118+
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices
119+
set UTR_VERSION=0.12.0
120+
./utr --artifacts_path=build/test-results --testproject={{ project.path }} --editor-location=.Editor --reruncount=2 --suite=playmode --platform=android --player-connection-ip=%BOKKEN_HOST_IP% --player-load-path=build/players --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
121+
# Set uploadable artifact paths
122+
artifacts:
123+
logs:
124+
paths:
125+
- "build/test-results/**"
126+
{% endfor -%}
127+
{% endfor -%}

.yamato/mobile-build.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.yamato/mobile-run.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)