Skip to content

Commit a5e862c

Browse files
authoredMay 10, 2021
chore: Upgrade XCode version 12.2 for CI (Unity-Technologies#388)
* change bokken image version for macOS * fix * workaround * [skip ci] wip * [skip ci] wip * [skip ci] fix * [skip ci] fix error * [skip ci] fix * [skip ci] fix * [skip ci] fix * [skip ci] fix yaml * [skip ci] fix * [skip ci] fix * [skip ci] fix * [skip ci] test * [skip ci] fix * [skip ci] fix * [skip ci] fix error * [skip] fix bugs * [skip ci] test
1 parent 5420894 commit a5e862c

File tree

5 files changed

+134
-46
lines changed

5 files changed

+134
-46
lines changed
 

‎.yamato/upm-ci-libwebrtc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ platforms:
88
build_command: BuildScripts~/build_libwebrtc_win.cmd
99
- name: macos
1010
type: Unity::VM::osx
11-
image: slough-ops/macos-10.14-xcode:stable
11+
image: package-ci/mac:latest
1212
flavor: m1.mac
1313
build_command: BuildScripts~/build_libwebrtc_macos.sh
1414
- name: linux
@@ -23,7 +23,7 @@ platforms:
2323
build_command: BuildScripts~/build_libwebrtc_android.sh
2424
- name: ios
2525
type: Unity::VM::osx
26-
image: slough-ops/macos-10.14-xcode:stable
26+
image: package-ci/mac:latest
2727
flavor: m1.mac
2828
build_command: BuildScripts~/build_libwebrtc_ios.sh
2929
projects:

‎.yamato/upm-ci-webrtc-packages.yml

+68-14
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ platforms:
2626
- name: macos
2727
type: Unity::metal::macmini
2828
gpu_type: Unity::metal::macmini
29-
image: slough-ops/macos-10.14-xcode
30-
gpu_image: slough-ops/macos-10.14-xcode
29+
image: package-ci/mac:latest
30+
gpu_image: package-ci/mac:latest
3131
flavor: m1.mac
3232
build_command: BuildScripts~/build_plugin_mac.sh
3333
test_command: BuildScripts~/test_plugin_mac.sh
3434
plugin_path: Runtime/Plugins/x86_64/webrtc.bundle/**
3535
- name: ios
3636
type: Unity::metal::macmini
3737
gpu_type: Unity::metal::macmini
38-
image: slough-ops/macos-10.14-xcode
39-
gpu_image: slough-ops/macos-10.14-xcode
38+
image: package-ci/mac:latest
39+
gpu_image: package-ci/mac:latest
4040
flavor: m1.mac
4141
build_command: BuildScripts~/build_plugin_ios.sh
4242
test_command: BuildScripts~/test_plugin_ios.sh
@@ -134,19 +134,23 @@ test_targets:
134134
platform: standalone
135135
- name: macos
136136
type: Unity::metal::macmini
137-
image: slough-ops/macos-10.14-xcode
137+
image: package-ci/mac:latest
138138
flavor: m1.mac
139139
gfx_types:
140140
- name: metal
141141
extra-editor-arg: force-metal
142142
test_params:
143143
- backend: mono
144+
additional_component_arg: StandaloneSupport-Mono
144145
platform: editmode
145146
- backend: mono
147+
additional_component_arg: StandaloneSupport-Mono
146148
platform: playmode
147149
- backend: mono
150+
additional_component_arg: StandaloneSupport-Mono
148151
platform: standalone
149152
- backend: il2cpp
153+
additional_component_arg: StandaloneSupport-IL2CPP
150154
platform: standalone
151155

152156
test_targets_android:
@@ -220,7 +224,7 @@ build_{{ package.name }}_{{ editor.version }}_ios:
220224
name : Build {{ package.packagename }} with {{ editor.version }} for ios device
221225
agent:
222226
type: Unity::VM::osx
223-
image: mobile/macos-10.13-testing:stable
227+
image: package-ci/mac:latest
224228
flavor: b1.large
225229
commands:
226230
- |
@@ -267,7 +271,7 @@ build_{{ package.name }}_{{ editor.version }}_android_{{ target.name }}:
267271
name : Build {{ package.packagename }} with {{ editor.version }} for android device {{ target.name }}
268272
agent:
269273
type: Unity::VM::osx
270-
image: mobile/macos-10.13-testing:stable
274+
image: package-ci/mac:latest
271275
flavor: b1.xlarge
272276
commands:
273277
- |
@@ -320,9 +324,9 @@ test_{{ package.name }}_{{ editor.version }}_android_{{ target.name }}:
320324

321325
{% for target in test_targets %}
322326
{% for editor in editors %}
323-
{% if target.name != "macos" -%}
324327
{% for param in target.test_params %}
325328
{% for gfx_type in target.gfx_types %}
329+
{% if target.name != "macos" %}
326330
test_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name }}_{{ editor.version }}_{{ gfx_type.name }}:
327331
name : Test {{ package.packagename }} with {{ param.platform }} {{ param.backend }} {{ editor.version }} on {{ target.name }} {{ gfx_type.name }}
328332
agent:
@@ -338,12 +342,61 @@ test_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name
338342
- "upm-ci~/test-results/**/*"
339343
dependencies:
340344
- .yamato/upm-ci-{{ package.name }}-packages.yml#pack_{{ package.name }}
341-
{% endfor %}
342-
{% endfor %}
343-
{% else -%}
344345

345-
{% for param in target.test_params %}
346-
{% for gfx_type in target.gfx_types %}
346+
{% elsif param.platform == "standalone" %}
347+
348+
build_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name }}_{{ editor.version }}_{{ gfx_type.name }}:
349+
name : Build {{ package.packagename }} with {{ param.platform }} {{ param.backend }} {{ editor.version }} on {{ target.name }} {{ gfx_type.name }}
350+
agent:
351+
type: Unity::VM::osx
352+
image: package-ci/mac:latest
353+
flavor: m1.mac
354+
commands:
355+
- |
356+
find upm-ci~/packages/ -name "*.tgz" | xargs -I file tar xvf file -C upm-ci~
357+
cp -rf upm-ci~/package/Runtime/Plugins Runtime/
358+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
359+
- unity-downloader-cli -c Editor -c {{ param.additional_component_arg }} -u {{ editor.version }} --fast -w
360+
- curl -s https://artifactory.internal.unity3d.com/core-automation/tools/utr-standalone/utr --output utr
361+
- chmod +x ./utr
362+
- ./utr --suite=playmode --platform=StandaloneOSX --editor-location=.Editor --testproject=WebRTC~ --player-save-path=build/players --architecture=x64 --artifacts_path=build/logs --scripting-backend={{ param.backend }} --build-only
363+
artifacts:
364+
players:
365+
paths:
366+
- "build/players/**"
367+
logs:
368+
paths:
369+
- "build/logs/**"
370+
dependencies:
371+
- .yamato/upm-ci-{{ package.name }}-packages.yml#pack_{{ package.name }}
372+
373+
test_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name }}_{{ editor.version }}_{{ gfx_type.name }}:
374+
name : Test {{ package.packagename }} with {{ param.platform }} {{ param.backend }} {{ editor.version }} on {{ target.name }} {{ gfx_type.name }}
375+
agent:
376+
type: {{ target.type }}
377+
image: {{ target.image }}
378+
flavor: {{ target.flavor }}
379+
variables:
380+
TEMPLATE_FILE: BuildScripts~/template/remote.sh.template
381+
PACKAGE_DIR: com.unity.webrtc
382+
PLAYER_LOAD_PATH: build/players
383+
TEST_RESULT_DIR: upm-ci~/test-results/
384+
TEST_TARGET: {{ target.name }}
385+
TEST_PLATFORM: {{ param.platform }}
386+
SCRIPTING_BACKEND: {{ param.backend }}
387+
EDITOR_VERSION: {{ editor.version }}
388+
EXTRA_EDITOR_ARG: {{ gfx_type.extra-editor-arg }}
389+
commands:
390+
- BuildScripts~/test_package_mac.sh
391+
artifacts:
392+
{{ package.name }}_{{ param.backend }}_{{ editor.version }}_{{ target.name }}_test_results:
393+
paths:
394+
- "upm-ci~/test-results/**"
395+
dependencies:
396+
- .yamato/upm-ci-{{ package.name }}-packages.yml#build_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name }}_{{ editor.version }}_{{ gfx_type.name }}
397+
398+
{% else %}
399+
347400
test_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name }}_{{ editor.version }}_{{ gfx_type.name }}:
348401
name : Test {{ package.packagename }} with {{ param.platform }} {{ param.backend }} {{ editor.version }} on {{ target.name }} {{ gfx_type.name }}
349402
agent:
@@ -371,9 +424,10 @@ test_{{ package.name }}_{{ param.platform }}_{{ param.backend }}_{{ target.name
371424
- "upm-ci~/test-results/**"
372425
dependencies:
373426
- .yamato/upm-ci-{{ package.name }}-packages.yml#pack_{{ package.name }}
427+
428+
{% endif %}
374429
{% endfor %}
375430
{% endfor %}
376-
{% endif -%}
377431
{% endfor %}
378432
{% endfor %}
379433

‎BuildScripts~/build_plugin_ios.sh

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cmake . \
2323
-B build
2424

2525
xcodebuild -sdk iphonesimulator \
26+
-arch "x86_64" \
2627
-project build/webrtc.xcodeproj \
2728
-target WebRTCPlugin \
2829
-configuration Release

‎BuildScripts~/template/remote.sh.template

+41-23
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,31 @@ platform=Editor
1313
architecture=x64
1414
suite=playmode
1515

16-
if [ ${TEST_PLATFORM} = "standalone" ]; then
17-
if [ ${TEST_TARGET} = "ios" ]; then
16+
if [ ${TEST_PLATFORM} = "standalone" ]
17+
then
18+
if [ ${TEST_TARGET} = "ios" ]
19+
then
1820
additional_component_arg="-c editor -c iOS"
1921
architecture=arm64
2022
platform=iOS
21-
elif [ ${TEST_TARGET} = "iossimulator" ]; then
23+
elif [ ${TEST_TARGET} = "iossimulator" ]
24+
then
2225
additional_component_arg="-c editor -c iOS"
2326
platform=iOS
24-
elif [ ${TEST_TARGET} = "macos" ]; then
27+
elif [ ${TEST_TARGET} = "macos" ]
28+
then
2529
platform=StandaloneOSX
26-
if [ ${SCRIPTING_BACKEND} = "il2cpp" ]; then
30+
if [ ${SCRIPTING_BACKEND} = "il2cpp" ]
31+
then
2732
additional_component_arg="-c editor -c StandaloneSupport-IL2CPP"
2833
else
2934
additional_component_arg="-c editor -c StandaloneSupport-Mono"
3035
fi
3136
fi
3237
fi
3338

34-
if [ ${TEST_PLATFORM} = "editmode" ]; then
39+
if [ ${TEST_PLATFORM} = "editmode" ]
40+
then
3541
suite=editor
3642
fi
3743

@@ -46,24 +52,36 @@ curl -s https://artifactory.internal.unity3d.com/core-automation/tools/utr-stand
4652
--output utr
4753
chmod +x ./utr
4854

49-
# download unity editor
50-
unity-downloader-cli \
51-
-u ${EDITOR_VERSION} \
52-
${additional_component_arg} \
53-
--wait \
54-
--published
55+
if [ ${TEST_PLATFORM} = "standalone" ]
56+
then
57+
# run utr
58+
./utr \
59+
--suite=${suite} \
60+
--platform=${platform} \
61+
--player-load-path=${PLAYER_LOAD_PATH} \
62+
--artifacts_path=${ARTIFACT_DIR} \
63+
--player-connection-ip=${BOKKEN_DEVICE_IP}
64+
result=$?
65+
else
66+
# download unity editor
67+
unity-downloader-cli \
68+
-u ${EDITOR_VERSION} \
69+
${additional_component_arg} \
70+
--wait \
71+
--published
5572

56-
# run utr
57-
./utr \
58-
--suite=${suite} \
59-
--platform=${platform} \
60-
--scripting-backend=${SCRIPTING_BACKEND} \
61-
--extra-editor-arg="-${EXTRA_EDITOR_ARG}" \
62-
--testproject=${HOME}/${TEST_PROJECT_DIR} \
63-
--editor-location=${HOME}/.Editor \
64-
--artifacts_path=${ARTIFACT_DIR} \
65-
--architecture=${architecture}
66-
result=$?
73+
# run utr
74+
./utr \
75+
--suite=${suite} \
76+
--platform=${platform} \
77+
--scripting-backend=${SCRIPTING_BACKEND} \
78+
--extra-editor-arg="-${EXTRA_EDITOR_ARG}" \
79+
--testproject=${HOME}/${TEST_PROJECT_DIR} \
80+
--editor-location=${HOME}/.Editor \
81+
--artifacts_path=${ARTIFACT_DIR} \
82+
--architecture=${architecture}
83+
result=$?
84+
fi
6785

6886
# return exit-code
6987
exit $result

‎BuildScripts~/test_package_mac.sh

+22-7
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ brew install gettext
2323

2424
# render template
2525
envsubst ' \
26+
$BOKKEN_DEVICE_IP \
2627
$SCRIPTING_BACKEND \
2728
$EXTRA_EDITOR_ARG \
29+
$PLAYER_LOAD_PATH \
2830
$TEST_PROJECT_DIR \
2931
$TEST_TARGET \
3032
$TEST_PLATFORM \
@@ -33,18 +35,31 @@ envsubst ' \
3335
> ~/remote.sh
3436
chmod +x ~/remote.sh
3537

36-
# copy package to remote machine
37-
scp -i ${IDENTITY} -r ${YAMATO_SOURCE_DIR} bokken@${BOKKEN_DEVICE_IP}:~/${PACKAGE_DIR}
38-
3938
# copy shell script to remote machine
4039
scp -i ${IDENTITY} -r ~/remote.sh bokken@${BOKKEN_DEVICE_IP}:~/remote.sh
4140

41+
if [ ${TEST_PLATFORM} = "standalone" ]
42+
then
43+
# copy build player to remote machine
44+
scp -i ${IDENTITY} -r build bokken@${BOKKEN_DEVICE_IP}:~/
45+
else
46+
# copy package to remote machine
47+
scp -i ${IDENTITY} -r ${YAMATO_SOURCE_DIR} bokken@${BOKKEN_DEVICE_IP}:~/${PACKAGE_DIR}
48+
fi
49+
50+
set +e
51+
4252
# run remote.sh on the remote machine
4353
ssh -i ${IDENTITY} bokken@${BOKKEN_DEVICE_IP} ~/remote.sh
4454
result=$?
45-
if [ $result -ne 0 ]; then
46-
exit $result
47-
fi
4855

56+
set -e
57+
58+
# copy artifacts from the remote machine
4959
mkdir -p ${TEST_RESULT_DIR}
50-
scp -i ${IDENTITY} -r bokken@${BOKKEN_DEVICE_IP}:~/test-results ${TEST_RESULT_DIR}
60+
scp -i ${IDENTITY} -r bokken@${BOKKEN_DEVICE_IP}:~/test-results ${TEST_RESULT_DIR}
61+
62+
# return ssh commend results
63+
if [ $result -ne 0 ]; then
64+
exit $result
65+
fi

0 commit comments

Comments
 (0)
Please sign in to comment.