From c9797508ba773ece205287f66bb9191ea0942687 Mon Sep 17 00:00:00 2001 From: Marek Turski Date: Thu, 8 Sep 2022 09:59:17 +0200 Subject: [PATCH] Draft CI refactoring to remove duplication --- .yamato/draft-android-playmode.yml | 59 +++++++++++++++++ .yamato/draft-config.metadata | 95 +++++++++++++++++++++++++++ .yamato/draft-editor-playmode.yml | 68 +++++++++++++++++++ .yamato/draft-ios-playmode.yml | 48 ++++++++++++++ .yamato/draft-standalone-playmode.yml | 76 +++++++++++++++++++++ .yamato/draft-test-samples.yml | 53 +++++++++++++++ .yamato/draft-triggers.yml | 86 ++++++++++++++++++++++++ .yamato/draft-tvos-playmode.yml | 26 ++++++++ .yamato/draft-upm-isolation.yml | 47 +++++++++++++ .yamato/draft-upm-pack.yml | 38 +++++++++++ .yamato/draft-upm-publish.yml | 52 +++++++++++++++ .yamato/upm-ci.yml | 12 ++-- 12 files changed, 654 insertions(+), 6 deletions(-) create mode 100644 .yamato/draft-android-playmode.yml create mode 100644 .yamato/draft-config.metadata create mode 100644 .yamato/draft-editor-playmode.yml create mode 100644 .yamato/draft-ios-playmode.yml create mode 100644 .yamato/draft-standalone-playmode.yml create mode 100644 .yamato/draft-test-samples.yml create mode 100644 .yamato/draft-triggers.yml create mode 100644 .yamato/draft-tvos-playmode.yml create mode 100644 .yamato/draft-upm-isolation.yml create mode 100644 .yamato/draft-upm-pack.yml create mode 100644 .yamato/draft-upm-publish.yml diff --git a/.yamato/draft-android-playmode.yml b/.yamato/draft-android-playmode.yml new file mode 100644 index 0000000000..2470e2f105 --- /dev/null +++ b/.yamato/draft-android-playmode.yml @@ -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 diff --git a/.yamato/draft-config.metadata b/.yamato/draft-config.metadata new file mode 100644 index 0000000000..234fc61b72 --- /dev/null +++ b/.yamato/draft-config.metadata @@ -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 \ No newline at end of file diff --git a/.yamato/draft-editor-playmode.yml b/.yamato/draft-editor-playmode.yml new file mode 100644 index 0000000000..4a7f5cecb4 --- /dev/null +++ b/.yamato/draft-editor-playmode.yml @@ -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 git@github.cds.internal.unity3d.com: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 git@github.cds.internal.unity3d.com: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 %} diff --git a/.yamato/draft-ios-playmode.yml b/.yamato/draft-ios-playmode.yml new file mode 100644 index 0000000000..89538d56d1 --- /dev/null +++ b/.yamato/draft-ios-playmode.yml @@ -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 diff --git a/.yamato/draft-standalone-playmode.yml b/.yamato/draft-standalone-playmode.yml new file mode 100644 index 0000000000..1934bc532a --- /dev/null +++ b/.yamato/draft-standalone-playmode.yml @@ -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 git@github.cds.internal.unity3d.com: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 git@github.cds.internal.unity3d.com: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 %} \ No newline at end of file diff --git a/.yamato/draft-test-samples.yml b/.yamato/draft-test-samples.yml new file mode 100644 index 0000000000..53df3b9f67 --- /dev/null +++ b/.yamato/draft-test-samples.yml @@ -0,0 +1,53 @@ +{% metadata_file .yamato/draft-config.metadata %} + +sample_publish_agent: + type: Unity::VM::osx + image: package-ci/mac:stable + flavor: m1.mac + +--- + +{% for editor in editors %} +draft_test_sample_projects_andisolation_{{ editor.version }}: + name : "[Draft] Test Publishing Sample Projects (And Isolation) [{{ editor.version }}]" + agent: + type: {{ sample_publish_agent.type }} + image: {{ sample_publish_agent.image }} + flavor: {{ sample_publish_agent.flavor }} + commands: + - 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/ + - upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }} + - Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=DryRun sh ExternalSampleProjects/publish.sh + triggers: + cancel_old_ci: true + expression: ( NOT pull_request.draft ) AND ( pull_request.target eq "develop" ) + artifacts: + UTR_Output.zip: + paths: + - "upm-ci~/**/*" +{% endfor %} + +{% for editor in editors %} +draft_test_sample_projects_{{ editor.version }}: + name : "[Draft] Test Publishing Sample Projects [{{ editor.version }}]" + agent: + type: {{ sample_publish_agent.type }} + image: {{ sample_publish_agent.image }} + flavor: {{ sample_publish_agent.flavor }} + commands: + - npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm + - upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }} + - pip install unity-downloader-cli --index-url {{ unity_downloader_cli_registry }} + - unity-downloader-cli -c editor -w -u {{ editor.version }} + - Editor=.Editor/Unity.app/Contents/MacOS/Unity Method=DryRun sh ExternalSampleProjects/publish.sh + triggers: + cancel_old_ci: true + expression: ( NOT pull_request.draft ) AND ( pull_request.target eq "develop" ) + dependencies: + - .yamato/draft-upm-pack.yml#draft_pack + artifacts: + UTR_Output.zip: + paths: + - "upm-ci~/**/*" +{% endfor %} diff --git a/.yamato/draft-triggers.yml b/.yamato/draft-triggers.yml new file mode 100644 index 0000000000..c762f6887a --- /dev/null +++ b/.yamato/draft-triggers.yml @@ -0,0 +1,86 @@ +{% metadata_file .yamato/draft-config.metadata %} +--- + +draft_run_all_tests: + name: "[Draft] Run All Tests" + dependencies: + - .yamato/draft-triggers.yml#draft_run_upm_isolation_tests + - .yamato/draft-triggers.yml#draft_run_upm_isolation_andpack_tests + - .yamato/draft-triggers.yml#draft_run_editor_playmode_tests + - .yamato/draft-triggers.yml#draft_run_editor_playmode_andisolation_tests + - .yamato/draft-triggers.yml#draft_run_standalone_playmode_tests + - .yamato/draft-triggers.yml#draft_run_standalone_playmode_andisolation_tests + - .yamato/draft-triggers.yml#draft_run_device_playmode_tests + - .yamato/draft-upm-publish.yml#publish_andisolation_dryrun + - .yamato/draft-upm-publish.yml#publish_dryrun + triggers: + cancel_old_ci: true + expression: ( NOT pull_request.draft ) AND ( pull_request.target eq "develop" ) + +# temp +draft_run_upm_isolation_andpack_tests: + name: "[Draft] Run UPM Isolation (And Pack) Tests" + dependencies: + {% for editor in editors %} + {% for editor_platform in editor_platforms %} + - .yamato/draft-upm-isolation.yml#draft_upm_isolation_andpack_{{ editor_platform.name }}_{{ editor.version }} + {% endfor %} # editor_platforms + {% endfor %} # editors + +# temp +draft_run_editor_playmode_andisolation_tests: + name: "[Draft] Run Editor Playmode (And Isolation) Tests" + dependencies: + {% for editor in editors %} + {% for editor_platform in editor_platforms %} + - .yamato/draft-editor-playmode.yml#draft_editor_playmode_andisolation_{{ editor_platform.name }}_{{ editor.version }} + {% endfor %} # editor_platforms + {% endfor %} # editors + +# temp +draft_run_standalone_playmode_andisolation_tests: + name: "[Draft] Run Standalone Playmode (And Isolation) Tests" + dependencies: + {% for editor in editors %} + {% for standalone_platform in standalone_platforms %} + - .yamato/draft-standalone-playmode.yml#draft_standalone_playmode_andisolation_{{ standalone_platform.name }}_{{ editor.version }} + {% endfor %} # standalone_platforms + {% endfor %} # editors + +draft_run_upm_isolation_tests: + name: "[Draft] Run UPM Isolation Tests" + dependencies: + {% for editor in editors %} + {% for editor_platform in editor_platforms %} + - .yamato/draft-upm-isolation.yml#draft_upm_isolation_{{ editor_platform.name }}_{{ editor.version }} + {% endfor %} # editor_platforms + {% endfor %} # editors + +draft_run_editor_playmode_tests: + name: "[Draft] Run Editor Playmode Tests" + dependencies: + {% for editor in editors %} + {% for editor_platform in editor_platforms %} + - .yamato/draft-editor-playmode.yml#draft_editor_playmode_{{ editor_platform.name }}_{{ editor.version }} + {% endfor %} # editor_platforms + {% endfor %} # editors + +draft_run_standalone_playmode_tests: + name: "[Draft] Run Standalone Playmode Tests" + dependencies: + {% for editor in editors %} + {% for standalone_platform in standalone_platforms %} + - .yamato/draft-standalone-playmode.yml#draft_standalone_playmode_{{ standalone_platform.name }}_{{ editor.version }} + {% endfor %} # standalone_platforms + {% endfor %} # editors + +draft_run_device_playmode_tests: + name: "[Draft] Run Device Playmode Tests" + dependencies: + {% for editor in editors %} + {% for backend in scripting_backends %} + - .yamato/draft-android-playmode.yml#draft_run_android_{{ editor.version }}_{{ backend.name }} + {% endfor %} # scripting_backends + - .yamato/draft-ios-playmode.yml#draft_run_ios_{{ editor.version }} + - .yamato/draft-tvos-playmode.yml#draft_build_tvos_{{ editor.version }} + {% endfor %} # editors diff --git a/.yamato/draft-tvos-playmode.yml b/.yamato/draft-tvos-playmode.yml new file mode 100644 index 0000000000..bd0237f734 --- /dev/null +++ b/.yamato/draft-tvos-playmode.yml @@ -0,0 +1,26 @@ +{% metadata_file .yamato/draft-config.metadata %} +--- + +{% for editor in editors %} + +draft_build_tvos_{{ editor.version }}: + name: "[Draft] Build Playmode Tests [tvos, {{ 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 AppleTV -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=tvOS --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/**" + +{% endfor %} # editors diff --git a/.yamato/draft-upm-isolation.yml b/.yamato/draft-upm-isolation.yml new file mode 100644 index 0000000000..94dc630171 --- /dev/null +++ b/.yamato/draft-upm-isolation.yml @@ -0,0 +1,47 @@ +{% metadata_file .yamato/draft-config.metadata %} +--- + +{% for editor in editors %} +{% for editor_platform in editor_platforms %} +draft_upm_isolation_andpack_{{ editor_platform.name }}_{{ editor.version }}: + name : "UPM Isolation (And Pack) Tests [{{ editor_platform.name }}, {{ editor.version }}]" + agent: + type: {{ editor_platform.type }} + image: {{ editor_platform.image }} + flavor: {{ editor_platform.flavor}} + commands: + # 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 }} + artifacts: + UPM_Isolation_AndPack.zip: + paths: + - "upm-ci~/test-results/**/*" +{% endfor %} +{% endfor %} + +{% for editor in editors %} +{% for editor_platform in editor_platforms %} +draft_upm_isolation_{{ editor_platform.name }}_{{ editor.version }}: + name : "UPM Isolation Tests [{{ editor_platform.name }}, {{ editor.version }}]" + agent: + type: {{ editor_platform.type }} + image: {{ editor_platform.image }} + flavor: {{ editor_platform.flavor}} + commands: + - npm install upm-ci-utils@{{ upm_ci_pinned_stable_version }} --registry {{ upm_ci_install_registry }} -g + # 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 }} + dependencies: + - .yamato/draft-upm-pack.yml#draft_pack_with_samples + artifacts: + UPM_Isolation.zip: + paths: + - "upm-ci~/test-results/**/*" +{% endfor %} +{% endfor %} diff --git a/.yamato/draft-upm-pack.yml b/.yamato/draft-upm-pack.yml new file mode 100644 index 0000000000..d4d4709c91 --- /dev/null +++ b/.yamato/draft-upm-pack.yml @@ -0,0 +1,38 @@ +{% metadata_file .yamato/draft-config.metadata %} + +pack_agent: + type: Unity::VM + image: package-ci/ubuntu:stable + flavor: b1.small + +--- + +draft_pack: + name: "[Draft] Pack" + agent: + type: {{ pack_agent.type }} + image: {{ pack_agent.image }} + flavor: {{ pack_agent.flavor }} + commands: + - 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/ + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" + +draft_pack_with_samples: + name: "[Draft] Pack with Samples" + agent: + type: {{ pack_agent.type }} + image: {{ pack_agent.image }} + flavor: {{ pack_agent.flavor }} + commands: + - 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/ + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" diff --git a/.yamato/draft-upm-publish.yml b/.yamato/draft-upm-publish.yml new file mode 100644 index 0000000000..92d0b9b52a --- /dev/null +++ b/.yamato/draft-upm-publish.yml @@ -0,0 +1,52 @@ +{% metadata_file .yamato/draft-config.metadata %} + +publish_agent: + type: Unity::VM + image: package-ci/win10:stable + flavor: b1.large + +--- + +{% for run in (1..2) %} +publish_andisolation{% cycle "", "_dryrun" %}: + name: Publish to Internal Registry {% cycle "", "(Dry Run)" %} + agent: + type: {{ publish_agent.type }} + image: {{ publish_agent.image }} + flavor: {{ publish_agent.flavor }} + variables: + UPMCI_ENABLE_PACKAGE_SIGNING: 1 + commands: + - move /Y .\Assets\Samples .\Packages\com.unity.inputsystem + - move /Y .\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/ + - upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u 2019.4 + - upm-ci package publish --package-path ./Packages/com.unity.inputsystem/ {% cycle "", "--dry-run" %} + artifacts: + artifacts: + paths: + - "upm-ci~/packages/*.tgz" +{% endfor %} + +{% for run in (1..2) %} +publish{% cycle "", "_dryrun" %}: + name: Publish to Internal Registry {% cycle "", "(Dry Run)" %} + agent: + type: {{ publish_agent.type }} + image: {{ publish_agent.image }} + flavor: {{ publish_agent.flavor }} + variables: + UPMCI_ENABLE_PACKAGE_SIGNING: 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 test --package-path ./Packages/com.unity.inputsystem/ -u 2019.4 + - upm-ci package publish --package-path ./Packages/com.unity.inputsystem/ {% cycle "", "--dry-run" %} + dependencies: + - .yamato/draft-upm-pack.yml#draft_pack_with_samples + artifacts: + artifacts: + paths: + - "upm-ci~/packages/*.tgz" +{% endfor %} + diff --git a/.yamato/upm-ci.yml b/.yamato/upm-ci.yml index b9507a1c95..0fd6370dbc 100644 --- a/.yamato/upm-ci.yml +++ b/.yamato/upm-ci.yml @@ -173,12 +173,12 @@ all_tests: - .yamato/upm-ci.yml#build_tvos_{{ editor.version }} {% endfor %} - .yamato/upm-ci.yml#publish_dryrun - triggers: - cancel_old_ci: true - pull_requests: - - targets: - only: - - "develop" +# triggers: +# cancel_old_ci: true +# pull_requests: +# - targets: +# only: +# - "develop" {% for run in (1..2) %} publish{% cycle "", "_dryrun" %}: