Skip to content

Commit 97c2c7a

Browse files
Merge branch 'develop-2.0.0' into fix/v2.x/disconnect-event-notifications-2390
2 parents cff9df6 + 0e04623 commit 97c2c7a

File tree

90 files changed

+2496
-618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2496
-618
lines changed

.yamato/_run-all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ run_quick_checks:
1717
dependencies:
1818
- .yamato/package-pack.yml#package_pack_-_ngo_ubuntu
1919
- .yamato/project-standards.yml#standards_ubuntu_testproject_trunk
20+
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
21+
- .yamato/vetting-test.yml#vetting_test
2022

2123

2224
# Runs all package tests

.yamato/_triggers.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ develop_nightly:
106106
# Build player for webgl platform on trunk and 6000.0 editors
107107
- .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_ubuntu_trunk
108108
- .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_win_6000.0
109+
# Run API validation to early-detect all new APIs that would force us to release new minor version of the package. Note that for this to work the package version in package.json must correspond to "actual package state" which means that it should be higher than last released version
110+
- .yamato/vetting-test.yml#vetting_test
109111

110112

111113
# Run all tests on weekly bases

.yamato/package-pack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ package_pack_-_ngo_{{ platform.name }}:
3737
variables:
3838
XRAY_PROFILE: "gold ./pvpExceptions.json"
3939
commands:
40+
- python Tools/scripts/release.py # Needed to ensure that CHANGELOG is properly formatted for this test due to the fact that we have bumped package version (to properly perform vetting tests)
4041
- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
4142
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
4243
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://internaldocs.unity.com/yamato_continuous_integration/usage/templating/
2+
3+
NetcodeProjects:
4+
# Note that we are using internal Unity repo. This means that we may test with newest changes that are not yet released to our users (there are also public versions)
5+
# Note that for BossRoom 'main' branch supports NGOv1.X and 'develop' branch supports NGOv2.X
6+
BossRoom:
7+
GithubRepo: "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git"
8+
branch: develop
9+
manifestPath: Packages/manifest.json
10+
projectPath: '.'
11+
Asteroids:
12+
GithubRepo: "https://github.cds.internal.unity3d.com/unity/Asteroids-CMB-NGO-Sample.git"
13+
branch: main
14+
manifestPath: Packages/manifest.json
15+
projectPath: '.'
16+
SocialHub:
17+
GithubRepo: "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize.git"
18+
branch: main
19+
manifestPath: Basic/DistributedAuthoritySocialHub/Packages/manifest.json
20+
projectPath: 'Basic/DistributedAuthoritySocialHub'
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{% metadata_file .yamato/project-builders/builder.metafile %}
2+
---
3+
# The above line corresponds to https://internaldocs.unity.com/yamato_continuous_integration/usage/templating/
4+
5+
# Yamato paths disclaimer:
6+
# Note that artifacts can get only local paths and since cloned project is in different location, you need to be careful with paths
7+
# All artifact paths are defined relative to the Yamato source directory (YAMATO_SOURCE_DIR) and are case-sensitive.
8+
# !!! important “Artifact directory locations” All artifact globs are defined relative to the source directory (YAMATO_SOURCE_DIR). Yamato can’t capture artifacts from outside this directory, so if you need files from elsewhere, you should copy them into your source directory as part of job commands.
9+
10+
# Those jobs were created in order to (in most cases) speed up playtesting and development time.
11+
# The aim is to collect all possible projects that use Netcode for Entities and create a job that will build the project with the given version of N4E package.
12+
# The package is taken directly from the branch from which the job was triggered. So image triggering the job from release/2.0.0 and release/2.1.0 branch to compare differences
13+
# Example use case would be to trigger the build job on Sunday so by Monday morning all builds are ready for playtesting. This limits the time a dev/QA has to spend building projects for different configurations (win, mac, Android, scripting backends, burst etc) or simply time necessary for building huge projects (Megacity).
14+
15+
# This job takes parameters as scriptable backend configuration, burst compilation, unity editor version and platform.
16+
# Since Yamato variables can't be restricted to only specific values, the job will validate the parameters passed to it and fail quickly if those are incorrect. In order to see what options are available, please look at the variable name.
17+
18+
# Note that for now all of those builds are being made on Windows machine (so for example combination of macOS + il2cpp is expected to fail)
19+
# TODO: for now all builds are being made on Windows machine, but it would be nice to have a Mac build as well.
20+
# TODO: add iOS support
21+
{% for netcodeProject in NetcodeProjects -%}
22+
build_{{ netcodeProject[0] }}_project:
23+
name: {{ netcodeProject[0] }}
24+
agent:
25+
type: Unity::VM
26+
image: package-ci/win10:v4
27+
flavor: b1.xlarge
28+
variables:
29+
UNITY_VERSION: trunk
30+
SCRIPTING_BACKEND_IL2CPP_MONO: il2cpp
31+
BURST_ON_OFF: on
32+
PLATFORM_WIN64_MAC_ANDROID: win64
33+
commands:
34+
# Validate inputs passed via Yamato variables
35+
- python Tools/CI/scripts/BuildAutomation/validate_params.py
36+
- echo Building {{ netcodeProject[0] }} project with Unity version of %UNITY_VERSION%, Scripting backend %SCRIPTING_BACKEND_IL2CPP_MONO%, Burst %BURST_ON_OFF% for platform %PLATFORM_WIN64_MAC_ANDROID%
37+
38+
# Clone the external project repository into a specific directory. Notice that branch is also specified.
39+
- git clone --single-branch --branch {{ netcodeProject[1].branch }} {{ netcodeProject[1].GithubRepo }} C:/ClonedProject
40+
41+
# Modify the external project's manifest to use the local N4E package from current branch on which this Yamato job is running. (requires python that should be preinstalled in the image)
42+
- python Tools/CI/scripts/BuildAutomation/manifest_update.py --manifest-path C:/ClonedProject/{{ netcodeProject[1].manifestPath }} --local-package-path %YAMATO_SOURCE_DIR%/com.unity.netcode.gameobjects
43+
44+
# Run python script to update ProjectSettings.asset in order to connect the project to Unity Services/set proper values.
45+
# Notice that if a project has this already set up then in theory we don't need to run this script.
46+
- python Tools/CI/scripts/BuildAutomation/connect_services.py --project-settings-path C:/ClonedProject/{{ netcodeProject[1].projectPath }}/ProjectSettings/ProjectSettings.asset
47+
48+
# Enable or disable Burst compilation. This step is specific to Netcode package (or any package that uses Burst)
49+
- IF "%BURST_ON_OFF%"=="on" (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --enable-burst --project-path C:/ClonedProject/{{ netcodeProject[1].projectPath }})
50+
ELSE (python Tools/CI/scripts/BuildAutomation/disable-enable-burst.py --disable-burst --project-path C:/ClonedProject/{{ netcodeProject[1].projectPath }})
51+
52+
# Download the Unity Editor version specified in the UNITY_VERSION variable. Il2cpp component is downloaded only if the SCRIPTING_BACKEND_IL2CPP_MONO is set to "il2cpp".
53+
# TODO: we could download components only if needed
54+
- unity-downloader-cli --fast --wait -u %UNITY_VERSION% -p C:/TestingEditor -c Editor -c il2cpp -c Android -c macOS
55+
56+
# Add BuilderScript.cs to the project so we can modify and build the project using Unity Editor.
57+
# This is a bit tricky step, notice that we also need to include proper assembly definition in order for those scripts to compile properly.
58+
# TODO: the asmdef file can be simplified
59+
- python Tools/CI/scripts/BuildAutomation/FileCopy.py "C:/ClonedProject/{{ netcodeProject[1].projectPath }}"
60+
61+
# Build the project using Unity Editor. This will call the given static BuilderScripts method.
62+
# Ideally, it would be nice to parametrize the BuilderScripts (for example to pass scripting backend as parameter) but -executeMethod only calls static methods without parameters so for now we will have multiple configurations
63+
# Notice that for Android platform even if mono is selected, il2cpp will be used since mono is not supported for Android builds.
64+
- IF "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" (
65+
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
66+
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
67+
) ELSE (
68+
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
69+
)
70+
)
71+
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" (
72+
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
73+
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
74+
) ELSE (
75+
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
76+
)
77+
)
78+
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="android" (
79+
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget android -executeMethod BuilderScripts.BuildAndroidIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
80+
)
81+
82+
# Because of this we need to ensure that all files are copied to the source directory.
83+
# TODO: this can be omitted if I can somehow build the project in the source directory (YAMATO_SOURCE_DIR) instead of C:/CompetitiveAction
84+
- python -c "import os; os.makedirs('./build', exist_ok=True)" # --> Create the build directory if it doesn't exist
85+
- python -c "import shutil; shutil.copytree('C:/ClonedProject/{{ netcodeProject[1].projectPath }}/build', './build', dirs_exist_ok=True)" # --> Copy the build directory to the source directory (YAMATO_SOURCE_DIR). Remember to copy entire directory and not only exe file
86+
87+
artifacts:
88+
logs:
89+
paths:
90+
- '*.log'
91+
- '*.xml'
92+
- artifacts/**/*
93+
players:
94+
paths:
95+
- build/**/*
96+
{% endfor -%}

.yamato/project.metafile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ validation_editors:
159159
- 6000.1
160160
- 6000.2
161161
- trunk
162+
minimal:
163+
- 6000.0
162164

163165

164166
# Scripting backends used by Standalone RunTimeTests---------------------------------------------------

.yamato/vetting-test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
2+
---
3+
# DESCRIPTION--------------------------------------------------------------------------
4+
# This configuration defines vetting tests for the Tools package which allows to validate if the package is in releasable state. This is important in particular because of API validation that allows to detect if we are introducing any new APIs that will force us to bump package version to new minor
5+
# If this test fails with new API error we should either make those API internal OR bump package version to new minor (note that the package version reflects the current package state)
6+
7+
# Note that we are packing the package only (no project context) so if package have any soft dependencies then project should be used to test it (to enable those APIs)
8+
{% for editor in validation_editors.minimal -%}
9+
vetting_test:
10+
name: MP Tools - Vetting Test (Win, {{editor}} LTS)
11+
agent: { type: Unity::VM, flavor: b1.large, image: package-ci/win11:v4 }
12+
commands:
13+
- python Tools/scripts/release.py # Needed to ensure that CHANGELOG is properly formatted for this test
14+
- npm install -g "upm-ci-utils@stable" --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
15+
- unity-downloader-cli --fast --wait --unity-version {{ editor }} --components editor --arch x64
16+
- upm-ci package pack --package-path com.unity.netcode.gameobjects
17+
- upm-ci package test -u .Editor --package-path com.unity.netcode.gameobjects --type vetting-tests
18+
artifacts:
19+
logs:
20+
paths:
21+
- pvp-results/*
22+
- test-results/**
23+
- upm-ci~/test-results/**
24+
- upm-ci~/upm-ci.log
25+
{% endfor -%}

0 commit comments

Comments
 (0)