Skip to content

Commit 5010a96

Browse files
authored
ci: unify CI variables via UnityToonShader.metafile (#514)
* rename file * use metafile * separate publish from test yml * separate pack and test job * add common test_platforms
1 parent 1bc3ac3 commit 5010a96

File tree

5 files changed

+110
-87
lines changed

5 files changed

+110
-87
lines changed

.yamato/UnityToonShader-pack.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% metadata_file .yamato/UnityToonShader.metafile %}
2+
3+
#
4+
#
5+
#
6+
7+
---
8+
pack:
9+
name: Pack {{ yamato_name }}
10+
agent:
11+
type: {{ pack_platform.type }}
12+
image: {{ pack_platform.image }}
13+
flavor: {{ pack_platform.flavor }}
14+
commands:
15+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
16+
- upm-ci package pack --package-path com.unity.toonshader
17+
artifacts:
18+
{{ yamato_name }}_pack_artifacts:
19+
paths:
20+
- "upm-ci~/**/*"
21+
22+
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
yamato_name: uts2
2-
test_editors:
3-
- version: 2021.3
4-
test_platforms:
5-
- name: win
6-
type: Unity::VM
7-
image: package-ci/win10:v4
8-
flavor: b1.large
1+
{% metadata_file .yamato/UnityToonShader.metafile %}
2+
3+
#
4+
#
5+
#
6+
97
---
108
{% for editor in test_editors %}
119
{% for platform in test_platforms %}
@@ -25,7 +23,7 @@ promotion_test_{{ platform.name }}_{{ editor.version }}:
2523
paths:
2624
- "upm-ci~/test-results/**/*"
2725
dependencies:
28-
- .yamato/upm-ci-{{ yamato_name }}.yml#pack
26+
- .yamato/{{ yamato_name }}-pack.yml#pack
2927
{% endfor %}
3028
{% endfor %}
3129

@@ -52,6 +50,6 @@ promote:
5250
- .yamato/upm-ci-{{ yamato_name }}.yml#pack
5351
{% for editor in test_editors %}
5452
{% for platform in test_platforms %}
55-
- .yamato/promotion-{{ yamato_name }}.yml#promotion_test_{{ platform.name }}_{{ editor.version }}
53+
- .yamato/{{ yamato_name }}-promotion.yml#promotion_test_{{ platform.name }}_{{ editor.version }}
5654
{% endfor %}
5755
{% endfor %}
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,64 @@
1-
yamato_name: uts2
2-
test_editors:
3-
- version: 2021.3
4-
test_platforms:
5-
- name: win
6-
type: Unity::VM
7-
image: package-ci/win10:v4
8-
flavor: b1.large
9-
- name: mac
10-
type: Unity::VM::osx
11-
image: package-ci/macos-13:v4
12-
flavor: m1.mac
1+
{% metadata_file .yamato/UnityToonShader.metafile %}
2+
3+
#
4+
#
5+
#
6+
137
---
14-
pack:
15-
name: Pack {{ yamato_name }}
16-
agent:
17-
type: Unity::VM
18-
image: package-ci/ubuntu-22.04:v4
19-
flavor: b1.medium
20-
commands:
21-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
22-
- upm-ci package pack --package-path com.unity.toonshader
23-
artifacts:
24-
{{ yamato_name }}_pack_artifacts:
25-
paths:
26-
- "upm-ci~/**/*"
278

28-
{% for editor in test_editors %}
29-
{% for platform in test_platforms %}
30-
test_{{ platform.name }}_{{ editor.version }}:
31-
name : Test {{ yamato_name }} using {{ editor.version }} on {{ platform.name }}
9+
publish:
10+
name: Publish {{ yamato_name }} to Internal Registry
3211
agent:
33-
type: {{ platform.type }}
34-
image: {{ platform.image }}
35-
flavor: {{ platform.flavor}}
12+
type: Unity::VM
13+
image: package-ci/win10:v4
14+
flavor: b1.large
3615
commands:
3716
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
38-
- upm-ci package test --unity-version {{ editor.version }} --package-path com.unity.toonshader
17+
- upm-ci package publish --package-path com.unity.toonshader
3918
triggers:
40-
branches:
19+
tags:
4120
only:
42-
- "/.*/"
21+
- /^(r|R)(c|C)-\d+\.\d+\.\d+(-preview(\.\d+)?)?$/
4322
artifacts:
44-
{{ yamato_name }}_test_results:
23+
{{ yamato_name }}_publish_artifacts:
4524
paths:
46-
- "upm-ci~/test-results/**/*"
25+
- "upm-ci~/packages/*.tgz"
4726
dependencies:
48-
- .yamato/upm-ci-{{ yamato_name }}.yml#pack
49-
{% endfor %}
50-
{% endfor %}
27+
- .yamato/{{ yamato_name }}-pack.yml#pack
28+
{% for editor in test_editors %}
29+
{% for platform in test_platforms %}
30+
- .yamato/{{ yamato_name }}-test-package.yml#test_{{ platform.name }}_{{ editor.version }}
31+
{% endfor %}
32+
{% endfor %}
5133

52-
publish:
53-
name: Publish {{ yamato_name }} to Internal Registry
34+
35+
publish_dry_run:
36+
name: Publish Dry Run {{ yamato_name }} to Internal Registry
5437
agent:
5538
type: Unity::VM
5639
image: package-ci/win10:v4
5740
flavor: b1.large
5841
commands:
5942
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
60-
- upm-ci package publish --package-path com.unity.toonshader
43+
- upm-ci package publish --dry-run --package-path com.unity.toonshader
6144
triggers:
6245
tags:
6346
only:
6447
- /^(r|R)(c|C)-\d+\.\d+\.\d+(-preview(\.\d+)?)?$/
6548
artifacts:
66-
{{ yamato_name }}_publish_artifacts:
49+
{{ yamato_name }}_publish_dry_run_artifacts:
6750
paths:
6851
- "upm-ci~/packages/*.tgz"
6952
dependencies:
70-
- .yamato/upm-ci-{{ yamato_name }}.yml#pack
71-
{% for editor in test_editors %}
72-
{% for platform in test_platforms %}
73-
- .yamato/upm-ci-{{ yamato_name }}.yml#test_{{ platform.name }}_{{ editor.version }}
53+
- .yamato/{{ yamato_name }}-pack.yml#pack
54+
{% for test_config in test_configs %}
55+
{% for test_platform in test_config.test_platforms %}
56+
{% for step in test_platform.test_type.steps %}
57+
- .yamato/{{ yamato_name }}-test-package.yml#test_{{ test_platform.platform_type.name }}_{{ test_config.editor_version }}_{{step.name}}
7458
{% endfor %}
7559
{% endfor %}
60+
{% endfor %}
61+
7662

7763
prerelease:
7864
name: Create a prerelease {{ yamato_name }}
@@ -117,34 +103,6 @@ prerelease:
117103
echo "End"
118104
119105
dependencies:
120-
- .yamato/upm-ci-uts2.yml#publish
121-
122-
publish_dry_run:
123-
name: Publish Dry Run {{ yamato_name }} to Internal Registry
124-
agent:
125-
type: Unity::VM
126-
image: package-ci/win10:v4
127-
flavor: b1.large
128-
commands:
129-
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
130-
- upm-ci package publish --dry-run --package-path com.unity.toonshader
131-
triggers:
132-
tags:
133-
only:
134-
- /^(r|R)(c|C)-\d+\.\d+\.\d+(-preview(\.\d+)?)?$/
135-
artifacts:
136-
{{ yamato_name }}_publish_dry_run_artifacts:
137-
paths:
138-
- "upm-ci~/packages/*.tgz"
139-
dependencies:
140-
- .yamato/{{ yamato_name }}-pack.yml#pack
141-
{% for test_config in test_configs %}
142-
{% for test_platform in test_config.test_platforms %}
143-
{% for step in test_platform.test_type.steps %}
144-
- .yamato/{{ yamato_name }}-test.yml#test_{{ test_platform.platform_type.name }}_{{ test_config.editor_version }}_{{step.name}}
145-
{% endfor %}
146-
{% endfor %}
147-
{% endfor %}
148-
106+
- .yamato/UnityToonShader-publish.yml#publish
149107

150108

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% metadata_file .yamato/UnityToonShader.metafile %}
2+
3+
#
4+
#
5+
#
6+
---
7+
8+
{% for editor in test_editors %}
9+
{% for platform in test_platforms %}
10+
test_{{ platform.name }}_{{ editor.version }}:
11+
name : Test {{ yamato_name }} using {{ editor.version }} on {{ platform.name }}
12+
agent:
13+
type: {{ platform.type }}
14+
image: {{ platform.image }}
15+
flavor: {{ platform.flavor}}
16+
commands:
17+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
18+
- upm-ci package test --unity-version {{ editor.version }} --package-path com.unity.toonshader
19+
triggers:
20+
branches:
21+
only:
22+
- "/.*/"
23+
artifacts:
24+
{{ yamato_name }}_test_results:
25+
paths:
26+
- "upm-ci~/test-results/**/*"
27+
dependencies:
28+
- .yamato/{{ yamato_name }}-pack.yml#pack
29+
{% endfor %}
30+
{% endfor %}
31+

.yamato/UnityToonShader.metafile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ win_test_platform:
6767
image: graphics-foundation/win10-dxr:stable
6868
model: gtx1080
6969
flavor: b1.large
70+
71+
test_editors:
72+
- version: 2022.3
73+
- version: 6000.0
74+
75+
test_platforms:
76+
- name: win
77+
type: Unity::VM
78+
image: package-ci/win10:v4
79+
flavor: b1.large
80+
- name: mac
81+
type: Unity::VM::osx
82+
image: package-ci/macos-13:v4
83+
flavor: m1.mac

0 commit comments

Comments
 (0)