Skip to content

Draft CI refactoring to remove duplication #1581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
59 changes: 59 additions & 0 deletions .yamato/draft-android-playmode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% metadata_file .yamato/draft-config.metadata %}
---

{% for editor in editors %}
{% for backend in scripting_backends %}

draft_build_android_{{ editor.version }}_{{ backend.name }}:
name: "[Draft] Build Playmode Tests [android, {{ backend.name }}, {{ editor.version }}]"
agent:
type: Unity::VM
image: mobile/android-package-ci-win:latest
flavor: b1.xlarge
commands:
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --fast -w
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
- ./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
artifacts:
players:
paths:
- "build/players/**"
logs:
paths:
- "build/logs/**"

draft_run_android_{{ editor.version }}_{{ backend.name }}:
name: "[Draft] Run Playmode Tests [android, {{ backend.name }}, {{ editor.version }}]"
agent:
type: Unity::mobile::shield
image: mobile/android-package-ci-win:latest
flavor: b1.medium
# Skip repository cloning
skip_checkout: true
# Set a dependency on the build job
dependencies:
- .yamato/draft-android-playmode.yml#draft_build_android_{{ editor.version }}_{{ backend.name }}
commands:
- |
# Download standalone UnityTestRunner
curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
# Set the IP of the device. In case device gets lost, UTR will try to recconect to ANDROID_DEVICE_CONNECTION
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
# Establish an ADB connection with the device
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
# List the connected devices
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices
./utr --suite=playmode --platform=android --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
after:
- start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
- if not exist build\test-results mkdir build\test-results
- powershell %ANDROID_SDK_ROOT%\platform-tools\adb.exe logcat -d > build/test-results/device_log.txt
# Set uploadable artifact paths
artifacts:
logs:
paths:
- "build/test-results/**"

{% endfor %} # scripting_backends
{% endfor %} # editors
95 changes: 95 additions & 0 deletions .yamato/draft-config.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
editors:
- version: 2019.4
- version: 2020.3
- version: 2021.2
- version: trunk

upm_ci_pinned_stable_version: stable
upm_ci_install_registry: https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
unity_downloader_cli_registry: https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple

editor_platforms:
- name: win
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
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
- name: mac
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac

standalone_platforms:
- name: win_standalone
platform: win
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
runtime: StandaloneWindows64
installscript: unity-downloader-cli -c editor -c mono -w -u
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
- name: win_standalone_il2cpp
platform: win
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
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
- name: mac_standalone
platform: mac
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac
runtime: StandaloneOSX
installscript: unity-downloader-cli -c editor -c mono -w -u
- name: mac_standalone_il2cpp
platform: mac
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac
runtime: StandaloneOSX
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u

platforms:
- name: win
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
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
- name: win_standalone
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
runtime: StandaloneWindows64
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
- name: win_standalone_il2cpp
type: Unity::VM
image: package-ci/win10:v1.15.0-713263
flavor: b1.large
runtime: StandaloneWindows64
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u
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
- name: mac
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac
- name: mac_standalone
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac
runtime: StandaloneOSX
- name: mac_standalone_il2cpp
type: Unity::VM::osx
image: package-ci/macos-12:latest
flavor: m1.mac
runtime: StandaloneOSX
scripting-backend: Il2Cpp
installscript: unity-downloader-cli -c editor -c StandaloneSupport-IL2CPP -w -u

scripting_backends:
- name: mono
- name: il2cpp
68 changes: 68 additions & 0 deletions .yamato/draft-editor-playmode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{% metadata_file .yamato/draft-config.metadata %}
---

{% for editor in editors %}
{% for editor_platform in editor_platforms %}
draft_editor_playmode_andisolation_{{ editor_platform.name }}_{{ editor.version }}:
name : "Editor Playmode (And Isolation) Tests [{{ editor_platform.name }}, {{ editor.version }}]"
agent:
type: {{ editor_platform.type }}
image: {{ editor_platform.image }}
flavor: {{ editor_platform.flavor}}
commands:
# Install any extra .NET SDK's on images that don't have them, "docfx metadata" requires a .NET SDK to work.
{% if editor_platform.netinstall %}
- {{ editor_platform.netinstall }}
{% endif %}
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
# really work with them. Move them into the package for when we run upm-ci here.
- mv ./Assets/Samples ./Packages/com.unity.inputsystem
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
- npm install upm-ci-utils@{{ upm_ci_pinned_stable_version }} --registry {{ upm_ci_install_registry }} -g
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
# Run upm-ci verification tests as well as tests contained in the package.
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
# ADBv2 on 2019.4 causes the test runner to not start on initial import when the
# samples are in the package. Move the samples back into the project.
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- 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 --report-performance-data --performance-project-id=InputSystem
artifacts:
UTR_Editor_Playmode_AndPack.zip:
paths:
- "upm-ci~/test-results/**/*"
{% endfor %}
{% endfor %}


{% for editor in editors %}
{% for editor_platform in editor_platforms %}
draft_editor_playmode_{{ editor_platform.name }}_{{ editor.version }}:
name : "Editor Playmode Tests [{{ editor_platform.name }}, {{ editor.version }}]"
agent:
type: {{ editor_platform.type }}
image: {{ editor_platform.image }}
flavor: {{ editor_platform.flavor}}
commands:
# Install any extra .NET SDK's on images that don't have them, "docfx metadata" requires a .NET SDK to work.
{% if editor_platform.netinstall %}
- {{ editor_platform.netinstall }}
{% endif %}
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
- npm install upm-ci-utils@{{ upm_ci_pinned_stable_version }} --registry {{ upm_ci_install_registry }} -g
- pip install unity-downloader-cli --index-url {{ unity_downloader_cli_registry }}
- unity-downloader-cli -c editor -w -u {{ editor.version }}
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- 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 --report-performance-data --performance-project-id=InputSystem
dependencies:
- .yamato/draft-upm-isolation.yml#draft_upm_isolation_{{ editor_platform.name }}_{{ editor.version }}
artifacts:
UTR_Editor_Playmode.zip:
paths:
- "upm-ci~/test-results/**/*"
{% endfor %}
{% endfor %}
48 changes: 48 additions & 0 deletions .yamato/draft-ios-playmode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% metadata_file .yamato/draft-config.metadata %}
---

{% for editor in editors %}

draft_build_ios_{{ editor.version }}:
name: "[Draft] Build Playmode Tests [ios, {{ editor.version }}]"
agent:
type: Unity::VM::osx
image: package-ci/macos-12-mobile:stable
flavor: b1.large
commands:
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --fast -w
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
- chmod +x ./utr
- ./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
artifacts:
players:
paths:
- "build/players/**"
logs:
paths:
- "build/logs/**"

draft_run_ios_{{ editor.version }}:
name: "[Draft] Run Playmode Tests [ios, {{ editor.version }}]"
agent:
type: Unity::mobile::iPhone
image: package-ci/macos-12-mobile:stable
model: SE
flavor: b1.medium
skip_checkout: true
dependencies:
- .yamato/draft-ios-playmode.yml#draft_build_ios_{{ editor.version }}
commands:
# Download standalone UnityTestRunner
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
# Give UTR execution permissions
- chmod +x ./utr
# Run the test build on the device
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --report-performance-data --performance-project-id=InputSystem
artifacts:
logs:
paths:
- "build/test-results/**"

{% endfor %} # editors
76 changes: 76 additions & 0 deletions .yamato/draft-standalone-playmode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{% metadata_file .yamato/draft-config.metadata %}
---

{% for editor in editors %}
{% for standalone_platform in standalone_platforms %}
draft_standalone_playmode_andisolation_{{ standalone_platform.name }}_{{ editor.version }}:
name : "Standalone Playmode [{{ standalone_platform.name }}, {{ editor.version }}]"
agent:
type: {{ standalone_platform.type }}
image: {{ standalone_platform.image }}
flavor: {{ standalone_platform.flavor}}
commands:
# Install any extra .NET SDK's on images that don't have them, "docfx metadata" requires a .NET SDK to work.
{% if standalone_platform.netinstall %}
- {{ standalone_platform.netinstall }}
{% endif %}
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
# really work with them. Move them into the package for when we run upm-ci here.
- mv ./Assets/Samples ./Packages/com.unity.inputsystem
- mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package pack --package-path ./Packages/com.unity.inputsystem/
# Run upm-ci verification tests as well as tests contained in the package.
- upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }}
{% if standalone_platform.installscript %}
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- {{ standalone_platform.installscript }} {{ editor.version }}
{% endif %}
# ADBv2 on 2019.4 causes the test runner to not start on initial import when the
# samples are in the package. Move the samples back into the project.
- mv ./Packages/com.unity.inputsystem/Samples ./Assets
- mv ./Packages/com.unity.inputsystem/Samples.meta ./Assets
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- 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 standalone_platform.runtime %} --platform {{ standalone_platform.runtime }} {% endif %} {% if standalone_platform.scripting-backend %} --scripting-backend {{ standalone_platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
artifacts:
UTR_Standalone_Playmode.zip:
paths:
- "upm-ci~/test-results/**/*"
{% endfor %}
{% endfor %}

{% for editor in editors %}
{% for standalone_platform in standalone_platforms %}
draft_standalone_playmode_{{ standalone_platform.name }}_{{ editor.version }}:
name : "Standalone Playmode [{{ standalone_platform.name }}, {{ editor.version }}]"
agent:
type: {{ standalone_platform.type }}
image: {{ standalone_platform.image }}
flavor: {{ standalone_platform.flavor}}
commands:
# Install any extra .NET SDK's on images that don't have them, "docfx metadata" requires a .NET SDK to work.
#{% if standalone_platform.netinstall %}
# - {{ standalone_platform.netinstall }}
#{% endif %}
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
# - git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
# really work with them. Move them into the package for when we run upm-ci here.
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
# Run upm-ci verification tests as well as tests contained in the package.
{% if standalone_platform.installscript %}
- pip install unity-downloader-cli --index-url {{ unity_downloader_cli_registry }}
- {{ standalone_platform.installscript }} {{ editor.version }}
{% endif %}
# Now run our full test suite that sits in Assets/Tests by running UTR on our project.
- 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 standalone_platform.runtime %} --platform {{ standalone_platform.runtime }} {% endif %} {% if standalone_platform.scripting-backend %} --scripting-backend {{ standalone_platform.scripting-backend }} {% endif %} --report-performance-data --performance-project-id=InputSystem
dependencies:
- .yamato/draft-upm-isolation.yml#draft_upm_isolation_{{ standalone_platform.platform }}_{{ editor.version }}
artifacts:
UTR_Standalone_Playmode.zip:
paths:
- "upm-ci~/test-results/**/*"
{% endfor %}
{% endfor %}
Loading