Skip to content

Commit b25dc5a

Browse files
authored
Turns physics modules into optional dependencies. (#5112)
1 parent b350e7e commit b25dc5a

22 files changed

+375
-198
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{% metadata_file .yamato/coverage_tests.metafile %}
2+
---
3+
{% for package in coverage_test_packages %}
4+
{% for editor in coverage_test_editors %}
5+
{% for platform in coverage_test_platforms %}
6+
{% capture coverageOptions %} --enable-code-coverage --code-coverage-options 'generateHtmlReport;assemblyFilters:+{{ package.assembly }}'{% endcapture %}
7+
8+
test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
9+
name : Coverage {{ package.name }} test {{ editor.version }} on {{ platform.name }}
10+
agent:
11+
type: {{ platform.type }}
12+
image: {{ platform.image }}
13+
flavor: {{ 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 project test -u {{ editor.version }} --type project-tests --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
17+
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
18+
artifacts:
19+
logs:
20+
paths:
21+
- "upm-ci~/test-results/**/*"
22+
dependencies:
23+
- .yamato/com.unity.ml-agents-pack.yml#pack
24+
triggers:
25+
cancel_old_ci: true
26+
{% if platform.name == "linux" %}
27+
expression: |
28+
(pull_request.target eq "main" OR
29+
pull_request.target match "release.+") AND
30+
NOT pull_request.draft AND
31+
(pull_request.changes.any match "com.unity.ml-agents/**" OR
32+
pull_request.changes.any match " {{ editor.testProject }}/**" OR
33+
{% if package.name == "com.unity.ml-agents.extensions" %}
34+
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
35+
{% endif %}
36+
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml")
37+
{% endif %}
38+
{% endfor %}
39+
{% endfor %}
40+
{% endfor %}
Lines changed: 64 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,65 @@
1-
OptionalDependencyTestsLinux:
2-
name : LinuxOptionalDependenciesTests
3-
agent:
4-
type: Unity::VM
5-
image: package-ci/ubuntu:stable
6-
flavor: b1.medium
7-
commands:
8-
- |
9-
curl -L https://artifactory.prd.it.unity3d.com/artifactory/api/gpg/key/public | sudo apt-key add -
10-
sudo sh -c "echo 'deb https://artifactory.prd.it.unity3d.com/artifactory/unity-apt-local bionic main' > /etc/apt/sources.list.d/unity.list"
11-
sudo apt update
12-
sudo apt install -y unity-config
13-
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
14-
unity-config settings editor-path ./.Editor
15-
unity-config project create opt-deps-test
16-
unity-config project add dependency com.unity.ml-agents/
17-
unity-config project add testable com.unity.ml-agents
18-
unity-config project add dependency com.unity.modules.imageconversion@1.0.0
19-
unity-config project add dependency com.unity.modules.jsonserialize@1.0.0
20-
unity-config project add dependency com.unity.modules.physics@1.0.0
21-
unity-config project add dependency com.unity.modules.physics2d@1.0.0
22-
upm-ci project test -u 2019.4 --type project-tests --project-path opt-deps-test --package-filter com.unity.ml-agents
23-
artifacts:
24-
logs:
25-
paths:
26-
- "upm-ci~/test-results/**/*"
27-
dependencies:
28-
- .yamato/com.unity.ml-agents-pack.yml#pack
29-
triggers:
30-
cancel_old_ci: true
31-
expression: |
32-
(pull_request.target eq "main" OR
33-
pull_request.target match "release.+") AND
34-
NOT pull_request.draft AND
35-
(pull_request.changes.any match "com.unity.ml-agents/**" OR
36-
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml")
1+
optional_deps:
2+
- name: Analytics
3+
project: "OptionalDepedencyTests/NoAnalyticsModule"
4+
version: 2020.2
5+
- name: Physics
6+
project: OptionalDepedencyTests/NoPhysicsModule
7+
version: 2020.2
8+
- name: Physics2D
9+
project: OptionalDepedencyTests/NoPhysics2DModule
10+
version: 2020.2
11+
---
12+
13+
{% for optional_dep in optional_deps %}
14+
OptionalDependencyTests_{{ optional_dep.name }}:
15+
name : Test Optional Package Dependencies {{ optional_dep.name }}
16+
agent:
17+
type: Unity::VM
18+
image: package-ci/ubuntu:stable
19+
flavor: b1.medium
20+
commands:
21+
- |
22+
curl -L https://artifactory.prd.it.unity3d.com/artifactory/api/gpg/key/public | sudo apt-key add -
23+
sudo sh -c "echo 'deb https://artifactory.prd.it.unity3d.com/artifactory/unity-apt-local bionic main' > /etc/apt/sources.list.d/unity.list"
24+
sudo apt update
25+
sudo apt install -y unity-config
26+
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
27+
unity-config settings editor-path ./.Editor
28+
unity-config project create opt-deps-test
29+
unity-config project add dependency com.unity.ml-agents/
30+
unity-config project add testable com.unity.ml-agents
31+
unity-config project add dependency com.unity.modules.imageconversion@1.0.0
32+
unity-config project add dependency com.unity.modules.jsonserialize@1.0.0
33+
{% unless optional_dep.name == "Physics" %}
34+
unity-config project add dependency com.unity.modules.physics@1.0.0
35+
{% endunless %}
36+
{% unless optional_dep.name == "Physics2D" %}
37+
unity-config project add dependency com.unity.modules.physics2d@1.0.0
38+
{% endunless %}
39+
{% unless optional_dep.name == "Analytics" %}
40+
unity-config project add dependency com.unity.modules.unityanalytics@1.0.0
41+
{% endunless %}
42+
upm-ci project test -u {{ optional_dep.version }} --type project-tests --project-path opt-deps-test --package-filter com.unity.ml-agents
43+
artifacts:
44+
logs:
45+
paths:
46+
- "upm-ci~/test-results/**/*"
47+
dependencies:
48+
- .yamato/com.unity.ml-agents-pack.yml#pack
49+
{% for coverage_editor in coverage_test_editors %}
50+
{% for coverage_plathform in coverage_test_platforms %}
51+
{% for coverage_package in coverage_test_packages %}
52+
- .yamato/com.unity.ml-agents-coverage.yml#test_coverage_{{ coverage_package.name }}_{{ coverage_platform.name }}_{{ coverage_editor.version }}
53+
{% endfor %}
54+
{% endfor %}
55+
{% endfor %}
56+
triggers:
57+
cancel_old_ci: true
58+
expression: |
59+
(pull_request.target eq "main" OR
60+
pull_request.target match "release.+") AND
61+
NOT pull_request.draft AND
62+
(pull_request.changes.any match "com.unity.ml-agents/**" OR
63+
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml")
64+
{% endfor %}
3765

0 commit comments

Comments
 (0)