Skip to content

Commit 6de2d2e

Browse files
author
Dmytro Ivanov
authored
Fix CI and update Unity versions (#1557)
1 parent 02e6b19 commit 6de2d2e

File tree

9 files changed

+105
-63
lines changed

9 files changed

+105
-63
lines changed

.yamato/analyze.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
{% metadata_file .yamato/config.metadata %}
2+
---
3+
14
code_analyser:
25
name : Code Analyzer
36
agent:
47
type: Unity::VM::osx
5-
image: package-ci/mac:stable
8+
image: package-ci/macos-12:default
69
flavor: m1.mac
710
commands:
811
- git submodule update --init
912
- mkdir Tools/CodeAnalyzerTestProject/Microsoft.CodeQuality.Analyzers
1013
- curl -L https://www.nuget.org/api/v2/package/Microsoft.CodeQuality.Analyzers/2.9.2 -o Tools/CodeAnalyzerTestProject/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.zip
1114
- unzip Tools/CodeAnalyzerTestProject/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.zip -d Tools/CodeAnalyzerTestProject/Microsoft.CodeQuality.Analyzers
12-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
15+
- {{ upm_ci_install }}
1316
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
1417
- upm-ci project test --project-path Tools/CodeAnalyzerTestProject -u 2019.4
1518
triggers:

.yamato/config.metadata

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
editors:
2-
- version: 2019.4
32
- version: 2020.3
4-
- version: 2021.2
3+
- version: 2021.3
4+
- version: 2022.2
55
- version: trunk
6-
platforms:
6+
7+
utr_install_win: curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
8+
utr_install_nix: curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr && chmod +x utr
9+
10+
unity_downloader_install: pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
11+
12+
upm_ci_install: npm install -g upm-ci-utils@stable --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
13+
14+
platforms_win:
715
- name: win
816
type: Unity::VM
9-
image: package-ci/win10:v1.15.0-713263
17+
image: package-ci/win10:default
1018
flavor: b1.large
11-
netinstall: choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes --Source https://bfartifactory.bf.unity3d.com/artifactory/api/nuget/unity-choco-local
1219
- name: win_standalone
1320
type: Unity::VM
14-
image: package-ci/win10:v1.15.0-713263
21+
image: package-ci/win10:default
1522
flavor: b1.large
1623
runtime: StandaloneWindows64
17-
netinstall: choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes --Source https://bfartifactory.bf.unity3d.com/artifactory/api/nuget/unity-choco-local
1824
- name: win_standalone_il2cpp
1925
type: Unity::VM
20-
image: package-ci/win10:v1.15.0-713263
26+
image: package-ci/win10:default
2127
flavor: b1.large
2228
runtime: StandaloneWindows64
2329
scripting-backend: Il2Cpp
2430
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
25-
netinstall: choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes --Source https://bfartifactory.bf.unity3d.com/artifactory/api/nuget/unity-choco-local
31+
platforms_nix:
2632
- name: mac
2733
type: Unity::VM::osx
28-
image: package-ci/macos-12:latest
34+
image: package-ci/macos-12:default
2935
flavor: m1.mac
3036
- name: mac_standalone
3137
type: Unity::VM::osx
32-
image: package-ci/macos-12:latest
38+
image: package-ci/macos-12:default
3339
flavor: m1.mac
3440
runtime: StandaloneOSX
3541
- name: mac_standalone_il2cpp
3642
type: Unity::VM::osx
37-
image: package-ci/macos-12:latest
43+
image: package-ci/macos-12:default
3844
flavor: m1.mac
3945
runtime: StandaloneOSX
4046
scripting-backend: Il2Cpp

.yamato/format.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
{% metadata_file .yamato/config.metadata %}
2+
---
3+
14
check_formatting:
25
name : Check formatting
36
agent:
47
type: Unity::VM::osx
5-
image: package-ci/mac:latest
8+
image: package-ci/macos-12:default
69
flavor: m1.mac
710
commands:
8-
- hg clone -b stable http://hg-mirror-slo.hq.unity3d.com/unity-extra/unity-meta
11+
- git clone [email protected].unity3d.com:unity/unity-meta.git
912
- perl unity-meta/Tools/Format/format.pl Assets Packages --dry-run
1013
triggers:
1114
cancel_old_ci: true

.yamato/promotion.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
{% metadata_file .yamato/config.metadata %}
2+
---
3+
14
promote:
25
name: Promote to Production
36
agent:
47
type: Unity::VM
5-
image: package-ci/win10:stable
8+
image: package-ci/win10:default
69
flavor: b1.large
710
dependencies:
811
- .yamato/publish-samples.yml
@@ -12,7 +15,7 @@ promote:
1215
- move /Y .\Assets\Samples .\Packages\com.unity.inputsystem
1316
- xcopy /Y /H .\Assets\Samples.meta .\Packages\com.unity.inputsystem
1417
- del /AH .\Assets\Samples.meta
15-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
18+
- {{ upm_ci_install }}
1619
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
1720
- upm-ci package promote --package-path ./Packages/com.unity.inputsystem/
1821
artifacts:

.yamato/publish-samples.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
{% metadata_file .yamato/config.metadata %}
2+
---
3+
14
test_sample_projects:
25
name : Publish Sample Projects
36
agent:
47
type: Unity::VM::osx
5-
image: package-ci/mac:stable
8+
image: package-ci/macos-12:default
69
flavor: m1.mac
710
commands:
8-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
11+
- {{ upm_ci_install }}
912
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
1013
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u 2019.4
1114
- Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=Publish sh ExternalSampleProjects/publish.sh

.yamato/test-samples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ test_sample_projects_{{ editor.version }}:
55
name : Test Sample Projects {{ editor.version }}
66
agent:
77
type: Unity::VM::osx
8-
image: package-ci/mac:stable
8+
image: package-ci/macos-12:default
99
flavor: m1.mac
1010
commands:
11-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
11+
- {{ upm_ci_install }}
1212
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
1313
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
1414
- Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=DryRun sh ExternalSampleProjects/publish.sh

.yamato/upm-ci.yml

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,70 @@
22
---
33

44
{% for editor in editors %}
5-
{% for platform in platforms %}
5+
{% for platform in platforms_win %}
66
{{ platform.name }}_{{ editor.version }}:
77
name : Build and Test version {{ editor.version }} on {{ platform.name }}
88
agent:
99
type: {{ platform.type }}
1010
image: {{ platform.image }}
11-
flavor: {{ platform.flavor}}
11+
flavor: {{ platform.flavor }}
1212
commands:
13-
# Install any extra .NET SDK's on images that don't have them, "docfx metadata" requires a .NET SDK to work.
14-
{% if platform.netinstall %}
15-
- {{ platform.netinstall }}
16-
{% endif %}
13+
- {{ utr_install_win }}
14+
- {{ upm_ci_install }}
15+
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
16+
- '%GSUDO% choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes'
17+
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
18+
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
19+
# really work with them. Move them into the package for when we run upm-ci here.
20+
- move /Y .\Assets\Samples .\Packages\com.unity.inputsystem
21+
- move /Y .\Assets\Samples.meta .\Packages\com.unity.inputsystem
22+
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
23+
# Run upm-ci verification tests as well as tests contained in the package.
24+
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
25+
{% if platform.installscript %}
26+
- {{ unity_downloader_install }}
27+
- {{ platform.installscript }} {{ editor.version }}
28+
{% endif %}
29+
# ADBv2 on 2019.4 causes the test runner to not start on initial import when the
30+
# samples are in the package. Move the samples back into the project.
31+
- move /Y .\Packages\com.unity.inputsystem\Samples .\Assets
32+
- move /Y .\Packages\com.unity.inputsystem\Samples.meta .\Assets
33+
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
34+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
35+
artifacts:
36+
UTR_Output.zip:
37+
paths:
38+
- "upm-ci~/test-results/**/*"
39+
{% endfor %}
40+
{% for platform in platforms_nix %}
41+
{{ platform.name }}_{{ editor.version }}:
42+
name : Build and Test version {{ editor.version }} on {{ platform.name }}
43+
agent:
44+
type: {{ platform.type }}
45+
image: {{ platform.image }}
46+
flavor: {{ platform.flavor }}
47+
commands:
48+
- {{ utr_install_nix }}
49+
- {{ upm_ci_install }}
1750
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
1851
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
1952
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
2053
# really work with them. Move them into the package for when we run upm-ci here.
2154
- mv ./Assets/Samples ./Packages/com.unity.inputsystem
2255
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
23-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
2456
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
2557
# Run upm-ci verification tests as well as tests contained in the package.
2658
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
2759
{% if platform.installscript %}
28-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
60+
- {{ unity_downloader_install }}
2961
- {{ platform.installscript }} {{ editor.version }}
3062
{% endif %}
3163
# ADBv2 on 2019.4 causes the test runner to not start on initial import when the
3264
# samples are in the package. Move the samples back into the project.
3365
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
3466
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
3567
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
36-
- upm-ci~/tools/utr/utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
68+
- ./utr --testproject . --timeout=1200 --editor-location=.Editor --artifacts_path=upm-ci~/test-results/isolation-com.unity.inputsystem.tests --suite=playmode --api-profile=NET_4_6 --stdout-filter=minimal {% if platform.runtime %} --platform {{ platform.runtime }} {% endif %} {% if platform.scripting-backend %} --scripting-backend {{ platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
3769
artifacts:
3870
UTR_Output.zip:
3971
paths:
@@ -46,13 +78,12 @@ build_ios_{{ editor.version }}:
4678
name: Build Tests on {{ editor.version }} on ios
4779
agent:
4880
type: Unity::VM::osx
49-
image: package-ci/macos-12-mobile:stable
81+
image: package-ci/macos-12:default
5082
flavor: b1.large
5183
commands:
52-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
84+
- {{ utr_install_nix }}
85+
- {{ unity_downloader_install }}
5386
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --fast -w
54-
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
55-
- chmod +x ./utr
5687
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
5788
artifacts:
5889
players:
@@ -66,18 +97,14 @@ run_ios_{{ editor.version }}:
6697
name: Run Tests on {{ editor.version }} on ios
6798
agent:
6899
type: Unity::mobile::iPhone
69-
image: package-ci/macos-12-mobile:stable
100+
image: package-ci/macos-12:default
70101
model: SE
71102
flavor: b1.medium
72103
skip_checkout: true
73104
dependencies:
74105
- .yamato/upm-ci.yml#build_ios_{{ editor.version }}
75106
commands:
76-
# Download standalone UnityTestRunner
77-
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
78-
# Give UTR execution permissions
79-
- chmod +x ./utr
80-
# Run the test build on the device
107+
- {{ utr_install_nix }}
81108
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
82109
artifacts:
83110
logs:
@@ -87,14 +114,14 @@ run_ios_{{ editor.version }}:
87114
build_tvos_{{ editor.version }}:
88115
name: Build Tests on {{ editor.version }} on tvos
89116
agent:
90-
type: Unity::VM::osx
117+
type: Unity::VM::osx # Use Unity::mobile::appletv to get tvOS device
118+
# TODO this should be replaced with package-ci/macos-12:default when PETS-1172 is complete
91119
image: package-ci/macos-12-mobile:stable
92120
flavor: b1.large
93121
commands:
94-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
122+
- {{ utr_install_nix }}
123+
- {{ unity_downloader_install }}
95124
- unity-downloader-cli -c Editor -c AppleTV -u {{ editor.version }} --fast -w
96-
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
97-
- chmod +x ./utr
98125
- ./utr --suite=playmode --platform=tvOS --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --build-only --report-performance-data --performance-project-id=InputSystem
99126
artifacts:
100127
players:
@@ -109,13 +136,13 @@ build_android_{{ editor.version }}_{{ backend.name }}:
109136
name: Build Tests on {{ editor.version }} on android {{ backend.name }}
110137
agent:
111138
type: Unity::VM
112-
image: mobile/android-package-ci-win:latest
139+
image: package-ci/win10:default
113140
flavor: b1.xlarge
114141
commands:
115-
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
142+
- {{ utr_install_win }}
143+
- {{ unity_downloader_install }}
116144
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --fast -w
117-
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
118-
- ./utr.bat --suite=playmode --platform=Android --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --scripting-backend={{ backend.name }} --build-only --repository --performance-project-id=InputSystem
145+
- ./utr --suite=playmode --platform=Android --editor-location=.Editor --testproject=. --player-save-path=build/players --artifacts_path=build/logs --scripting-backend={{ backend.name }} --build-only --repository --performance-project-id=InputSystem
119146
artifacts:
120147
players:
121148
paths:
@@ -128,17 +155,16 @@ run_android_{{ editor.version }}_{{ backend.name }}:
128155
name: Run Tests on {{ editor.version }} on android {{ backend.name }}
129156
agent:
130157
type: Unity::mobile::shield
131-
image: mobile/android-package-ci-win:latest
158+
image: package-ci/win10:default
132159
flavor: b1.medium
133160
# Skip repository cloning
134161
skip_checkout: true
135162
# Set a dependency on the build job
136163
dependencies:
137164
- .yamato/upm-ci.yml#build_android_{{ editor.version }}_{{ backend.name }}
138165
commands:
166+
- {{ utr_install_win }}
139167
- |
140-
# Download standalone UnityTestRunner
141-
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
142168
# Set the IP of the device. In case device gets lost, UTR will try to recconect to ANDROID_DEVICE_CONNECTION
143169
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
144170
# Establish an ADB connection with the device
@@ -163,7 +189,10 @@ all_tests:
163189
name: All Tests
164190
dependencies:
165191
{% for editor in editors %}
166-
{% for platform in platforms %}
192+
{% for platform in platforms_win %}
193+
- .yamato/upm-ci.yml#{{ platform.name }}_{{ editor.version }}
194+
{% endfor %}
195+
{% for platform in platforms_nix %}
167196
- .yamato/upm-ci.yml#{{ platform.name }}_{{ editor.version }}
168197
{% endfor %}
169198
{% for backend in scripting_backends %}
@@ -185,14 +214,14 @@ publish{% cycle "", "_dryrun" %}:
185214
name: Publish to Internal Registry {% cycle "", "(Dry Run)" %}
186215
agent:
187216
type: Unity::VM
188-
image: package-ci/win10:stable
217+
image: package-ci/win10:default
189218
flavor: b1.large
190219
variables:
191220
UPMCI_ENABLE_PACKAGE_SIGNING: 1
192221
commands:
222+
- {{ upm_ci_install }}
193223
- move /Y .\Assets\Samples .\Packages\com.unity.inputsystem
194224
- move /Y .\Assets\Samples.meta .\Packages\com.unity.inputsystem
195-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
196225
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
197226
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u 2019.4
198227
- upm-ci package publish --package-path ./Packages/com.unity.inputsystem/ {% cycle "", "--dry-run" %}

Assets/Tests/InputSystem/Plugins/XInputTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void Devices_SupportXboxControllerOnOSX()
141141
AssertButtonPress(gamepad, new XInputControllerOSXState().WithButton(XInputControllerOSXState.Button.Select), gamepad.selectButton);
142142
}
143143

144-
// Temporary: Disables tests in standalone trunk builds (https://fogbugz.unity3d.com/f/cases/1410131/)
144+
// Disable tests in standalone builds from 2022.1+ see UUM-19622
145145
#if !UNITY_STANDALONE_OSX || !TEMP_DISABLE_STANDALONE_OSX_XINPUT_TEST
146146
[Test]
147147
[Category("Devices")]

Assets/Tests/InputSystem/Unity.InputSystem.Tests.asmdef

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,12 @@
3232
},
3333
{
3434
"name": "Unity",
35-
"expression": "[2021.1,2021.2)",
35+
"expression": "2021.1",
3636
"define": "TEMP_DISABLE_UITOOLKIT_TEST"
3737
},
3838
{
3939
"name": "Unity",
40-
"expression": "2023.1.0a1",
41-
"define": "TEMP_DISABLE_UITOOLKIT_TEST"
42-
},
43-
{
44-
"name": "Unity",
45-
"expression": "2023.1.0a1",
40+
"expression": "2022.1",
4641
"define": "TEMP_DISABLE_STANDALONE_OSX_XINPUT_TEST"
4742
}
4843
],

0 commit comments

Comments
 (0)