Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ PublishScripts/
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# Except Unity testproject Packages
!/testproject/Packages/**
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
Expand Down Expand Up @@ -184,7 +186,6 @@ _pkginfo.txt
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
Expand Down Expand Up @@ -259,4 +260,7 @@ __pycache__/
*.pyc

# Docs
docs/LastBuild.log
docs/LastBuild.log

# Unity Package Manager CI output
upm-ci~
17 changes: 17 additions & 0 deletions .yamato/project-pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% metadata_file .yamato/project.metafile %}
---
{% for project in projects -%}
pack_{{ project.name }}:
name: Pack {{ project.name }}
agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.small
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project pack --project-path {{ project.path }}
artifacts:
packages:
paths:
- "upm-ci~/packages/**/*"
{% endfor -%}
66 changes: 66 additions & 0 deletions .yamato/project-promotion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% metadata_file .yamato/project.metafile %}
---
{% for project in projects -%}
{% for package in project.packages -%}
# Validation job for package {{ package.name }}, only using the first entry in the
# platform and editor meta data
promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Project {{ project.name }} - Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
flavor: {{ test_platforms.first.flavor}}
variables:
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ test_editors.first }} --project-path {{ project.path }} --type vetting-tests --package-filter {{ package.name }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}

promote_{{ project.name }}_{{ package.name }}:
name: Promote Project {{ project.name }} - Package {{ package.name }} to Production
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.small
variables:
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package promote --package-path {{ package.path }}
artifacts:
artifacts:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}

{% endfor -%}

promote_{{ project.name }}:
name: Promote ALL {{ project.name }} packages to Production
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.small
variables:
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project promote --project-path {{ project.path }}
artifacts:
artifacts:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
{% for package in packages -%}
- .yamato/project-promotion.yml#promotion_validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% endfor -%}
{% endfor -%}
46 changes: 46 additions & 0 deletions .yamato/project-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% metadata_file .yamato/project.metafile %}
---
{% for project in projects -%}
{% for package in project.packages -%}
publish_{{ project.name }}_{{ package.name }}:
name: Publish Project {{project.name }} - Package {{ package.name }} to Internal Registry
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package publish --package-path {{ package.path }} --dry-run
artifacts:
artifacts:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-test.yml#validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-test.yml#test_{{ project.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
{% endfor -%}

{% endfor -%}

publish_{{ project.name }}:
name: Publish ALL {{ project.name }} packages to Internal Registry
agent:
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project publish --project-path {{ project.path }}
artifacts:
artifacts:
paths:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-test.yml#all_tests_trigger

{% endfor -%}
134 changes: 134 additions & 0 deletions .yamato/project-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{% metadata_file .yamato/project.metafile %}
---
# Go through all platforms, editors and packages in the metadata
# to generate its independent package tests and validation tests.
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
test_{{ projects.first.name}}_{{ package.name }}_{{ platform.name }}_{{ editor }}:
name : Test Project {{ projects.first.name }} - Package {{ package.name }} - {{ editor }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --project-path {{ projects.first.path }} --type package-tests --package-filter {{ package.name }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ projects.first.name }}

{% endfor -%}
{% endfor -%}

# Validation job for package {{ package.name }}, only using the first entry in the
# platform and editor meta data
# Validation only occurs in editmode.
validate_{{ projects.first.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Project {{ projects.first.name }} - Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
flavor: {{ test_platforms.first.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ test_editors.first }} --project-path {{ projects.first.path }} --type vetting-tests --package-filter {{ package.name }} --platform editmode
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ projects.first.name }}
{% endfor -%}

# For every platform and editor version, run its project tests without
# running package tests too since they are handled on their respective
# jobs
{% for project in projects -%}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
name : Test Project {{ project.name }} - {{ editor }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --project-path {{ project.path }} --type project-tests
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}

{% endfor -%}
{% endfor -%}
{% endfor -%}

# Currently, we need to have a trigger to updated badges
# Only package badges currently exist
badges_test_trigger:
name: Badges Tests Trigger
agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.small
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package izon -t
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
packages:
paths:
- "upm-ci~/packages/**/*"
dependencies:
{% for project in projects -%}
{% for package in projects.first.packages -%}
- .yamato/project-test.yml#validate_{{ projects.first.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-test.yml#test_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}

all_tests_trigger:
name: Repository Tests Trigger
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/project-test.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
- .yamato/project-test.yml#test_{{ project.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}

# Run all relevant tasks when a pull request targeting the develop
# branch is created or updated. Currently only mlapi package tests are
# enabled, since the others are missing test coverage and will fail CI.
develop_pull_request_trigger:
name: Develop Branch Triggers
dependencies:
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-test.yml#test_{{ projects.first.name }}_com.unity.multiplayer.mlapi_{{ platform.name }}_{{ editor }}
{% endfor -%}
{% endfor -%}
triggers:
cancel_old_ci: true
pull_requests:
- targets:
only:
- "develop"
59 changes: 59 additions & 0 deletions .yamato/project-updated-dependencies-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% metadata_file .yamato/project.metafile %}
---
# Go through all platforms, editors and packages in the metadata
# to generate its independent package tests and validation tests.
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}:
name : Dependency Test of Project {{ projects.first.name }} - Package {{ package.name }} - {{ editor }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ editor }} --project-path {{ projects.first.path }} --type updated-dependencies-tests --package-filter {{ package.name }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
triggers:
recurring:
- branch: master
frequency: 20 * * ?
dependencies:
- path: .yamato/project-pack.yml#pack_{{ projects.first.name }}
rerun: always

{% endfor -%}
{% endfor -%}
{% endfor -%}

dependency_test_trigger_{{ projects.first.name }}:
name: Project {{ projects.first.name }} Dependency Tests Trigger
agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.small
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project izon -d --project-path {{ projects.first.path }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
triggers:
recurring:
- branch: master
frequency: 22 * * ?
dependencies:
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-updated-dependencies-test.yml#dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
35 changes: 35 additions & 0 deletions .yamato/project.metafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Editors where tests will happen. The first entry of this array is also used
# for validation
test_editors:
- 2020.1
- trunk

# Platforms that will be tested. The first entry in this array will also
# be used for validation
test_platforms:
- name: win
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
- name: mac
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: m1.mac
- name: ubuntu
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.large

# Projects within the repository that will be tested. Name will be used
# for job ids, so it should not contain spaces/non-supported characters
projects:
- name: project
path: testproject
# Packages within a project that will be tested
packages:
- name: com.unity.multiplayer.mlapi
path: com.unity.multiplayer.mlapi
- name: com.unity.multiplayer.transport.enet
name: com.unity.multiplayer.transport.enet
- name: com.unity.multiplayer.transport.utp
path: com.unity.multiplayer.transport.utp
Loading