diff --git a/.github/workflows/pr-supervisor.yaml b/.github/workflows/pr-supervisor.yaml index e2429a3a4e..b1660c2522 100644 --- a/.github/workflows/pr-supervisor.yaml +++ b/.github/workflows/pr-supervisor.yaml @@ -2,8 +2,8 @@ # We are using https://cli.github.com/manual/gh_pr_checks # The aim is to ensure that conditionally triggered Yamato jobs are completed successfully before allowing merges -# This job will be required in branch protection rules for develop, develop-2.0.0, develop-3.x.x, and release/* branches. It's only goal will be to ensure that Yamato jobs are completed successfully before allowing Pr to merge. -# Note that conditional jobs will have 30s to show which is always the cas since they are showing up as soon as in distribution stage. +# This job will be required in branch protection rules for develop and release/* branches. It's only goal will be to ensure that Yamato jobs are completed successfully before allowing Pr to merge. +# Note that conditional jobs will have 30s to show which is always the case since they are showing up as soon as in distribution stage. name: Yamato PR Supervisor @@ -24,36 +24,51 @@ jobs: yamato-supervisor: runs-on: ubuntu-latest timeout-minutes: 720 + permissions: + actions: read + checks: read + statuses: read + pull-requests: read + contents: read steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@v4 + + - name: Wait and Verify Yamato Job Status env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} run: | set -e - - + + MAX_ATTEMPTS=$((12*60)) INTERVAL=60 - + sleep $INTERVAL for ((i=1;i<=MAX_ATTEMPTS;i++)); do echo "Polling PR checks (attempt $i/$MAX_ATTEMPTS)..." + + # gh pr checks exits non-zero while checks are pending (8) or failing (1); we evaluate state ourselves, so don't let that abort the loop. + checks=$(gh pr checks $PR_NUMBER --json name,state --jq '[ .[] | select(.name != "yamato-supervisor") ]') || true - # We want to watch for pending checks beside this check - checks=$(gh pr checks $PR_NUMBER --json name,state --jq '[ .[] | select(.name != "yamato-supervisor") ]') + if [[ -z "$checks" ]]; then + echo "No non-supervisor checks reported yet; waiting..." + sleep $INTERVAL + continue + fi pending=$(echo "$checks" | jq '[.[] | select(.state == "PENDING")] | length') skipping=$(echo "$checks" | jq '[.[] | select(.state == "SKIPPED")] | length') passed=$(echo "$checks" | jq '[.[] | select(.state == "SUCCESS")] | length') failed=$(echo "$checks" | jq '[.[] | select(.state == "FAILURE")] | length') - - echo "Pending checks: $pending, Skipping checks: $skipping", Passed checks: $passed, Failed checks: $failed - + + echo "Pending checks: $pending; Skipping checks: $skipping, Passed checks: $passed, Failed checks: $failed" + if [[ "$failed" -gt 0 ]]; then echo "A check has failed! Failing fast." + echo "If you rerun the job and everything is green then just rerun this job as well." exit 1 fi @@ -61,6 +76,6 @@ jobs: echo "All non-supervisor checks are completed!" exit 0 fi - + sleep $INTERVAL - done + done \ No newline at end of file diff --git a/.yamato/_run-all.yml b/.yamato/_run-all.yml index 67e9cf22e4..fad7923322 100644 --- a/.yamato/_run-all.yml +++ b/.yamato/_run-all.yml @@ -16,7 +16,7 @@ run_quick_checks: name: Run Quick Initial Checks dependencies: # Ensure the code is running to our current standards - - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.minimal }} + - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.standards }} # This is needed for most of the jobs to execute tests + it runs xray PVP checks (all fast checks) - .yamato/package-pack.yml#package_pack_-_ngo_win @@ -27,41 +27,25 @@ run_all_package_tests: dependencies: {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} - - .yamato/package-tests.yml#package_test_-_ngo_{{ editor }}_{{ platform.name }} + - .yamato/package-tests.yml#package_test_-_ngo_{{ platform.name }}_{{ editor }} {% endfor -%} {% endfor -%} -# Runs all package tests on trunk editor -run_all_package_tests_trunk: - name: Run All Package Tests [Trunk only] +# Runs all package tests on latest supported editor +run_all_package_tests_{{ validation_editors.latest }}: + name: Run All Package Tests [{{ validation_editors.latest }} only] dependencies: {% for platform in test_platforms.desktop -%} - - .yamato/package-tests.yml#package_test_-_ngo_trunk_{{ platform.name }} + - .yamato/package-tests.yml#package_test_-_ngo_{{ platform.name }}_{{ validation_editors.latest }} {% endfor -%} -# Runs all package tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_package_tests_pinnedTrunk: - name: Run All Package Tests [Pinned Trunk only] - dependencies: -{% for platform in test_platforms.desktop -%} - - .yamato/package-tests.yml#package_test_-_ngo_{{ pinnedTrunk }}_{{ platform.name }} -{% endfor -%} - -# Runs all package tests on minimum supported editor -run_all_package_tests_minimum_editor: +# Runs all package tests on minimal supported editor +run_all_package_tests_{{ validation_editors.minimal }}: name: Run All Package Tests [{{ validation_editors.minimal }}] dependencies: {% for platform in test_platforms.desktop -%} - - .yamato/package-tests.yml#package_test_-_ngo_{{ validation_editors.minimal }}_{{ platform.name }} -{% endfor -%} - -# Runs all package tests on default editor -run_all_package_tests_default: - name: Run All Package Tests [{{ validation_editors.default }}] - dependencies: -{% for platform in test_platforms.desktop -%} - - .yamato/package-tests.yml#package_test_-_ngo_{{ validation_editors.default }}_{{ platform.name }} + - .yamato/package-tests.yml#package_test_-_ngo_{{ platform.name }}_{{ validation_editors.minimal }} {% endfor -%} @@ -80,32 +64,20 @@ run_all_project_tests: {% endfor -%} -# Runs all projects tests on trunk editor -run_all_project_tests_trunk: - name: Run All Project Tests [Trunk only] +# Runs all projects tests on latest supported editor +run_all_project_tests_{{ validation_editors.latest }}: + name: Run All Project Tests [{{ validation_editors.latest }} only] dependencies: {% for project in projects.all -%} {% if project.has_tests == "true" -%} {% for platform in test_platforms.desktop -%} - - .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_trunk + - .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.latest }} {% endfor -%} {% endif -%} {% endfor -%} -# Runs all projects tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_project_tests_pinnedTrunk: - name: Run All Project Tests [Pinned Trunk only] - dependencies: -{% for project in projects.all -%} -{% if project.has_tests == "true" -%} -{% for platform in test_platforms.desktop -%} - - .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_{{ pinnedTrunk }} -{% endfor -%} -{% endif -%} -{% endfor -%} - -# Runs all projects tests on minimum supported editor -run_all_project_tests_minimum_editor: +# Runs all projects tests on minimal supported editor +run_all_project_tests_{{ validation_editors.minimal }}: name: Run All Project Tests [{{ validation_editors.minimal }}] dependencies: {% for project in projects.all -%} @@ -116,18 +88,6 @@ run_all_project_tests_minimum_editor: {% endif -%} {% endfor -%} -# Runs all projects tests on default editor -run_all_project_tests_default: - name: Run All Project Tests [{{ validation_editors.default }}] - dependencies: -{% for project in projects.all -%} -{% if project.has_tests == "true" -%} -{% for platform in test_platforms.desktop -%} - - .yamato/project-tests.yml#test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }} -{% endfor -%} -{% endif -%} -{% endfor -%} - # Runs all project standards check run_all_projects_standards: @@ -135,7 +95,7 @@ run_all_projects_standards: dependencies: {% for platform in test_platforms.default -%} {% for project in projects.all -%} -{% for editor in validation_editors.minimal -%} +{% for editor in validation_editors.standards -%} - .yamato/project-standards.yml#standards_{{ platform.name }}_{{ project.name }}_{{ editor }} {% endfor -%} {% endfor -%} @@ -155,29 +115,19 @@ run_all_webgl_builds: {% endfor -%} -# Runs all WebGL builds on trunk editor -run_all_webgl_builds_trunk: - name: Run All WebGl Build [Trunk only] +# Runs all WebGL builds on latest supported editor +run_all_webgl_builds_{{ validation_editors.latest }}: + name: Run All WebGl Build [{{ validation_editors.latest }} only] dependencies: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} - - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_trunk + - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ validation_editors.latest }} {% endfor -%} {% endfor -%} -# Runs all WebGL builds on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_webgl_builds_pinnedTrunk: - name: Run All WebGl Build [Pinned Trunk only] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.desktop -%} - - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ pinnedTrunk }} -{% endfor -%} -{% endfor -%} - -# Runs all WebGL builds on minimum supported editor -run_all_webgl_builds_minimum_editor: +# Runs all WebGL builds on minimal supported editor +run_all_webgl_builds_{{ validation_editors.minimal }}: name: Run All WebGl Build [{{ validation_editors.minimal }}] dependencies: {% for project in projects.default -%} @@ -186,16 +136,6 @@ run_all_webgl_builds_minimum_editor: {% endfor -%} {% endfor -%} -# Runs all WebGL builds on default editor -run_all_webgl_builds_default: - name: Run All WebGl Build [{{ validation_editors.default }}] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.desktop -%} - - .yamato/webgl-build.yml#webgl_build_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }} -{% endfor -%} -{% endfor -%} - # Runs all Desktop tests run_all_project_tests_desktop_standalone: @@ -212,32 +152,20 @@ run_all_project_tests_desktop_standalone: {% endfor -%} -# Runs all Desktop tests on trunk editor -run_all_project_tests_desktop_standalone_trunk: - name: Run All Standalone Tests - Desktop [Trunk only] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.desktop -%} -{% for backend in scripting_backends -%} - - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_trunk -{% endfor -%} -{% endfor -%} -{% endfor -%} - -# Runs all Desktop tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_project_tests_desktop_standalone_pinnedTrunk: - name: Run All Standalone Tests - Desktop [Pinned Trunk only] +# Runs all Desktop tests on latest supported editor +run_all_project_tests_desktop_standalone_{{ validation_editors.latest }}: + name: Run All Standalone Tests - Desktop [{{ validation_editors.latest }} only] dependencies: {% for project in projects.default -%} {% for platform in test_platforms.desktop -%} {% for backend in scripting_backends -%} - - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ pinnedTrunk }} + - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ validation_editors.latest }} {% endfor -%} {% endfor -%} {% endfor -%} -# Runs all Desktop tests on minimum supported editor -run_all_project_tests_desktop_standalone_minimum_editor: +# Runs all Desktop tests on minimal supported editor +run_all_project_tests_desktop_standalone_{{ validation_editors.minimal }}: name: Run All Standalone Tests - Desktop [{{ validation_editors.minimal }}] dependencies: {% for project in projects.default -%} @@ -248,18 +176,6 @@ run_all_project_tests_desktop_standalone_minimum_editor: {% endfor -%} {% endfor -%} -# Runs all Desktop tests on default editor -run_all_project_tests_desktop_standalone_default: - name: Run All Standalone Tests - Desktop [{{ validation_editors.default }}] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.desktop -%} -{% for backend in scripting_backends -%} - - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ validation_editors.default }} -{% endfor -%} -{% endfor -%} -{% endfor -%} - # Runs all Mobile tests run_all_project_tests_mobile_standalone: name: Run All Standalone Tests - Mobile @@ -273,28 +189,19 @@ run_all_project_tests_mobile_standalone: {% endfor -%} -# Runs all Mobile tests on trunk editor -run_all_project_tests_mobile_standalone_trunk: - name: Run All Standalone Tests - Mobile [Trunk only] +# Runs all Mobile tests on latest supported editor +run_all_project_tests_mobile_standalone_{{ validation_editors.latest }}: + name: Run All Standalone Tests - Mobile [{{ validation_editors.latest }} only] dependencies: {% for project in projects.default -%} {% for platform in test_platforms.mobile_test -%} - - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_trunk + - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.latest }} {% endfor -%} {% endfor -%} -# Runs all Mobile tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_project_tests_mobile_standalone_pinnedTrunk: - name: Run All Standalone Tests - Mobile [Pinned Trunk only] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.mobile_test -%} - - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ pinnedTrunk }} -{% endfor -%} -{% endfor -%} -# Runs all Mobile tests on minimum supported editor -run_all_project_tests_mobile_standalone_minimum_editor: +# Runs all Mobile tests on minimal supported editor +run_all_project_tests_mobile_standalone_{{ validation_editors.minimal }}: name: Run All Standalone Tests - Mobile [{{ validation_editors.minimal }}] dependencies: {% for project in projects.default -%} @@ -303,16 +210,6 @@ run_all_project_tests_mobile_standalone_minimum_editor: {% endfor -%} {% endfor -%} -# Runs all Mobile tests on default editor -run_all_project_tests_mobile_standalone_default: - name: Run All Standalone Tests - Mobile [{{ validation_editors.default }}] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.mobile_test -%} - - .yamato/mobile-standalone-test.yml#mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }} -{% endfor -%} -{% endfor -%} - # Runs all Console tests run_all_project_tests_console_standalone: @@ -327,28 +224,18 @@ run_all_project_tests_console_standalone: {% endfor -%} -# Runs all Console tests on trunk editor -run_all_project_tests_console_standalone_trunk: - name: Run All Standalone Tests - Console [Trunk only] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.console_test -%} - - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_trunk -{% endfor -%} -{% endfor -%} - -# Runs all Console tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_project_tests_console_standalone_pinnedTrunk: - name: Run All Standalone Tests - Console [Pinned Trunk only] +# Runs all Console tests on latest supported editor +run_all_project_tests_console_standalone_{{ validation_editors.latest }}: + name: Run All Standalone Tests - Console [{{ validation_editors.latest }} only] dependencies: {% for project in projects.default -%} {% for platform in test_platforms.console_test -%} - - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ pinnedTrunk }} + - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.latest }} {% endfor -%} {% endfor -%} -# Runs all Console tests on minimum supported editor -run_all_project_tests_console_standalone_minimum_editor: +# Runs all Console tests on minimal supported editor +run_all_project_tests_console_standalone_{{ validation_editors.minimal }}: name: Run All Standalone Tests - Console [{{ validation_editors.minimal }}] dependencies: {% for project in projects.default -%} @@ -357,31 +244,6 @@ run_all_project_tests_console_standalone_minimum_editor: {% endfor -%} {% endfor -%} -# Runs all Console tests on default editor -run_all_project_tests_console_standalone_default: - name: Run All Standalone Tests - Console [{{ validation_editors.default }}] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.console_test -%} - - .yamato/console-standalone-test.yml#console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }} -{% endfor -%} -{% endfor -%} - - -# Runs all unified (NGO + N4E) tests -# These run on their own pinned editor (validation_editors) rather than the validation_editors, because -# they need an editor that bundles a com.unity.netcode with the unified API. See unified-tests.yml. -run_all_unified_tests: - name: Run All Unified Tests - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.default -%} -{% for editor in validation_editors.default -%} - - .yamato/unified-tests.yml#unified_test_{{ project.name }}_{{ platform.name }}_{{ editor }} -{% endfor -%} -{% endfor -%} -{% endfor -%} - # Runs all CMB service tests run_all_project_tests_cmb_service: @@ -397,32 +259,20 @@ run_all_project_tests_cmb_service: {% endfor -%} {% endfor -%} -# Runs all CMB service tests on trunk editor -run_all_project_tests_cmb_service_trunk: - name: Run All CMB Service Tests [Trunk only] +# Runs all CMB service tests on latest supported editor +run_all_project_tests_cmb_service_{{ validation_editors.latest }}: + name: Run All CMB Service Tests [{{ validation_editors.latest }} only] dependencies: {% for project in projects.default -%} {% for platform in test_platforms.default -%} {% for backend in scripting_backends -%} - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_trunk + - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ validation_editors.latest }} {% endfor -%} {% endfor -%} {% endfor -%} -# Runs all CMB service tests on pinned trunk editor (This is used for PR testing as we want to avoid blocking failures) -run_all_project_tests_cmb_service_pinnedTrunk: - name: Run All CMB Service Tests [Pinned Trunk only] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.default -%} -{% for backend in scripting_backends -%} - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ pinnedTrunk }} -{% endfor -%} -{% endfor -%} -{% endfor -%} - -# Runs all CMB service tests on minimum supported editor -run_all_project_tests_cmb_service_minimum_editor: +# Runs all CMB service tests on minimal supported editor +run_all_project_tests_cmb_service_{{ validation_editors.minimal }}: name: Run All CMB Service Tests [{{ validation_editors.minimal }}] dependencies: {% for project in projects.default -%} @@ -432,26 +282,3 @@ run_all_project_tests_cmb_service_minimum_editor: {% endfor -%} {% endfor -%} {% endfor -%} - -# Runs all CMB service tests on default editor -run_all_project_tests_cmb_service_default: - name: Run All CMB Service Tests [{{ validation_editors.default }}] - dependencies: -{% for project in projects.default -%} -{% for platform in test_platforms.default -%} -{% for backend in scripting_backends -%} - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ validation_editors.default }} -{% endfor -%} -{% endfor -%} -{% endfor -%} - - -# Runs the NGO 2.x -> 3.x editor script upgrade validation (see api-updater-test.yml) -run_all_api_updater_tests: - name: Run All API Updater Tests - dependencies: -{% for platform in test_platforms.default -%} -{% for editor in validation_editors.default -%} - - .yamato/api-updater-test.yml#api_updater_test_{{ platform.name }}_{{ editor }} -{% endfor -%} -{% endfor -%} diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index ce221f4e24..11a49d2f99 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -17,7 +17,7 @@ # 1) Minimal PR checks that run on all PRs (even if only docs are changed) # 2) More extensive pr_code_changes_checks that run if code is changed. This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered # By default pr_minimal_required_checks it's triggered if - # 1) PR targets develop, develop-2.0.0, develop-3.x.x or release branches + # 1) PR targets develop, develop-2.0., develop-3.x.x or release branches # 2) PR is not a draft # Then pr_code_changes_checks it's triggered if the same conditions apply plus: # 1) PR changes code in com.unity.netcode.gameobjects package (Editor, Runtime or Tests folders) or in testproject folder or package.json file @@ -27,7 +27,7 @@ # Nightly: # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds # Runs daily on develop (local configuration) - # Includes all test types but only on trunk and the default editor. + # Includes all test types but only on trunk. # Adds platform-specific and APV validation # Weekly: @@ -51,7 +51,7 @@ pr_minimal_required_checks: name: Minimal PR checks dependencies: - - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.minimal }} + - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.standards }} - .yamato/package-pack.yml#package_pack_-_ngo_win triggers: expression: |- @@ -76,24 +76,22 @@ pr_code_changes_checks: # 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 - .yamato/vetting-test.yml#vetting_test - # Run package EditMode and Playmode package tests on pinned trunk and the minimal supported editor - - .yamato/package-tests.yml#package_test_-_ngo_{{ pinnedTrunk }}_mac - - .yamato/package-tests.yml#package_test_-_ngo_{{ validation_editors.minimal }}_win + # Run package EditMode and Playmode package tests + - .yamato/package-tests.yml#package_test_-_ngo_mac_{{ validation_editors.default }} + - .yamato/package-tests.yml#package_test_-_ngo_win_{{ validation_editors.minimal }} - # Run testproject EditMode and Playmode project tests on pinned trunk and the minimal supported editor - - .yamato/project-tests.yml#test_testproject_win_{{ pinnedTrunk }} + # Run testproject EditMode and Playmode project tests + - .yamato/project-tests.yml#test_testproject_win_{{ validation_editors.default }} - .yamato/project-tests.yml#test_testproject_mac_{{ validation_editors.minimal }} # Run standalone test. We run it only on Ubuntu since it's the fastest machine, and it was noted that for example distribution on macOS is taking 40m since we switched to Apple Silicon # Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs # desktop_standalone_test and cmb_service_standalone_test are both reusing desktop_standalone_build dependency so we run those in the same configuration on PRs to reduce waiting time. # Note that our daily tests will anyway run both test configurations in "minimal supported" and "trunk" configurations - - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_{{ pinnedTrunk }} - - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_{{ pinnedTrunk }} - # The unified (NGO + N4E) tests are no longer a PR check: the unified API is behind N4E's own - # experimental define, so it is not part of what NGO ships. Still run nightly and on "/ci unified". - # Run code coverage test (PRs use the pinned "safe" trunk) - - .yamato/code-coverage.yml#code_coverage_project_test_testproject_ubuntu_{{ pinnedTrunk }} + - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_{{ validation_editors.default }} + - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_{{ validation_editors.default }} + # Run code coverage test + - .yamato/code-coverage.yml#code_coverage_project_test_testproject_ubuntu_{{ validation_editors.default }} triggers: expression: |- (pull_request.comment eq "ngo" OR @@ -117,87 +115,64 @@ pr_code_changes_checks: cancel_old_ci: true -# Unified (NGO + N4E) validation, on demand. -# This job allows the Unified tests to be kicked off by commenting "/ci unified". -# This is useful for PRs where pr_code_changes_checks doesn't trigger. -unified_pr_checks: - name: Unified (NGO + N4E) checks [on demand] - dependencies: - - .yamato/_run-all.yml#run_all_unified_tests - triggers: - expression: |- - pull_request.comment eq "unified" - cancel_old_ci: true -# NGO 2.x -> 3.x on demand editor script upgrade validation. -# This job allows the API updater test to be kicked off by commenting "/ci apiupdater". -api_updater_pr_checks: - name: API Updater checks [on demand] - dependencies: - - .yamato/_run-all.yml#run_all_api_updater_tests - triggers: - expression: |- - pull_request.comment eq "apiupdater" - cancel_old_ci: true -# Run all tests on nightly basis. + +# Run all tests on minimal and latest editors on nightly basis (rest of editors runs weekly) # Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds -# Those tests are all running on trunk and the default editor (since it's daily and running all of them would add a lot of overhead) develop_nightly: - name: "\U0001F319 [Nightly] Run All Tests [Trunk and Default]" + name: "\U0001F319 [Nightly] Run All Tests [Latest Editor and Minimal Editor]" triggers: recurring: - - branch: develop-3.x.x + - branch: develop-2.0.0 frequency: daily rerun: always dependencies: # Run project standards to verify package/default project - - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.minimal }} + - .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.standards }} # Run APV jobs to make sure the change won't break any dependants - .yamato/wrench/preview-a-p-v.yml#all_preview_apv_jobs - # Run package EditMode and Playmode tests on desktop platforms on trunk and default editor - - .yamato/_run-all.yml#run_all_package_tests_trunk - - .yamato/_run-all.yml#run_all_package_tests_default - # Run project EditMode and PLaymode tests on desktop platforms on trunk and default editor - - .yamato/_run-all.yml#run_all_project_tests_trunk - - .yamato/_run-all.yml#run_all_project_tests_default - # Run Runtime tests on desktop players on trunk and default editors - - .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_trunk - - .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_default - # Run Runtime tests on mobile players on trunk and default editors - - .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_trunk - - .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_default - # Run Runtime tests on console players on trunk and default editors - - .yamato/_run-all.yml#run_all_project_tests_console_standalone_trunk - - .yamato/_run-all.yml#run_all_project_tests_console_standalone_default - # Build player for webgl platform on trunk and default editors - - .yamato/_run-all.yml#run_all_webgl_builds_trunk - - .yamato/_run-all.yml#run_all_webgl_builds_default - # Run Runtime tests against cmb service on trunk and default editors - - .yamato/_run-all.yml#run_all_project_tests_cmb_service_trunk - - .yamato/_run-all.yml#run_all_project_tests_cmb_service_default - # Run the unified (NGO + N4E) tests on their own pinned editor (see .yamato/unified-tests.yml) - - .yamato/_run-all.yml#run_all_unified_tests - # Build player for webgl platform on trunk and default editors - - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_ubuntu_trunk - - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_win_{{ validation_editors.default }} + # Run package EditMode and Playmode tests on desktop platforms + - .yamato/_run-all.yml#run_all_package_tests_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_package_tests_{{ validation_editors.minimal }} + # Run project EditMode and PLaymode tests on desktop platforms + - .yamato/_run-all.yml#run_all_project_tests_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_project_tests_{{ validation_editors.minimal }} + # Run Runtime tests on desktop players + - .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_{{ validation_editors.minimal }} + # Run Runtime tests on mobile players + - .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_{{ validation_editors.minimal }} + # Run Runtime tests on console players + - .yamato/_run-all.yml#run_all_project_tests_console_standalone_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_project_tests_console_standalone_{{ validation_editors.minimal }} + # Build player for webgl platform + - .yamato/_run-all.yml#run_all_webgl_builds_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_webgl_builds_{{ validation_editors.minimal }} + # Run Runtime tests against cmb service + - .yamato/_run-all.yml#run_all_project_tests_cmb_service_{{ validation_editors.latest }} + - .yamato/_run-all.yml#run_all_project_tests_cmb_service_{{ validation_editors.minimal }} + # Build player for webgl platform on trunk + - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_ubuntu_{{ validation_editors.latest }} + - .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_win_{{ validation_editors.minimal }} # 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 - .yamato/vetting-test.yml#vetting_test - # Run code coverage test (nightly uses actual trunk) - - .yamato/code-coverage.yml#code_coverage_project_test_testproject_ubuntu_trunk + # Run code coverage test + - .yamato/code-coverage.yml#code_coverage_project_test_testproject_ubuntu_{{ validation_editors.minimal }} # Run all tests on weekly bases # Same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project # It's not running wrench jobs since those will run either way in nightly test run -# This in contrast to nightly checks will run tests on all editors (not only trunk). Running those on weekly basis and trunk tests nightly should be a good balance between making sure that tests are passing and overhead of running lots of tests +# This in contrast to nightly checks will run tests on all editors. Running those on weekly basis and trunk tests nightly should be a good balance between making sure that tests are passing and overhead of running lots of tests develop_weekly_trunk: name: "\U0001F319 [Weekly] Run All Tests" triggers: recurring: - - branch: develop-3.x.x + - branch: develop-2.0.0 frequency: weekly rerun: always dependencies: diff --git a/.yamato/code-coverage.yml b/.yamato/code-coverage.yml index 18adbef416..3b2062b399 100644 --- a/.yamato/code-coverage.yml +++ b/.yamato/code-coverage.yml @@ -13,8 +13,7 @@ # CONFIGURATION STRUCTURE-------------------------------------------------------------- # Jobs are generated for: # 1. Default platform only (Ubuntu) since coverage would not vary between platforms (no need for checks on more platforms) - # 2. Two editors: actual "trunk" (used by nightly) and the "pinnedTrunk" safe version (used by PRs). - # Occasionally trunk breaks our tests, so PRs run against a pinned "safe" trunk while nightly runs actual trunk. + # 2. Default (most used) editor which is 6000.3 #TECHNICAL CONSIDERATIONS--------------------------------------------------------------- # Requires Unity Editor installation @@ -23,16 +22,12 @@ # QUALITY CONSIDERATIONS-------------------------------------------------------------------- # To see where this job is included (in trigger job definitions) look into _triggers.yml file. Currently: - # [Code Coverage] Project Test runs on PR changes (pr_code_changes_checks, pinnedTrunk) and nightly (develop_nightly, trunk) - -{% assign coverage_editors = "trunk," | append: pinnedTrunk | split: "," -%} + # [Code Coverage] Project Test runs on PR changes (pr_code_changes_checks) and nightly (develop_nightly) {% for platform in test_platforms.default -%} {% for project in projects.default -%} -{% for editor in coverage_editors -%} -{% if editor == "trunk" -%}{% assign editor_label = "trunk" -%}{% else -%}{% assign editor_label = "pinnedTrunk" -%}{% endif -%} -code_coverage_project_test_{{ project.name }}_{{ platform.name }}_{{ editor }}: - name: '[Code Coverage] Project Test - NGO {{ project.name }} [{{ platform.name }}, {{ editor }}]' +code_coverage_project_test_{{ project.name }}_{{ platform.name }}_{{ validation_editors.default }}: + name: '[Code Coverage] Project Test - NGO {{ project.name }} [{{ platform.name }}, {{ validation_editors.default }}]' agent: type: {{ platform.type }} image: {{ platform.image }} @@ -41,8 +36,8 @@ code_coverage_project_test_{{ project.name }}_{{ platform.name }}_{{ editor }}: model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile) {% endif %} commands: - - unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models - - UnifiedTestRunner --testproject={{ project.path }} --suite=editor --suite=playmode --editor-location=.Editor --enable-code-coverage --coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGOv2_project_{{ project.name }}_{{ platform.name }}_{{ editor_label }};flags:NGOv2_project_{{ project.name }}_{{ platform.name }}_{{ editor_label }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout={{ test_timeout }} --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --artifacts-path=test-results + - unity-downloader-cli --fast --wait -u {{ validation_editors.default }} -c Editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models + - UnifiedTestRunner --testproject={{ project.path }} --suite=editor --suite=playmode --editor-location=.Editor --enable-code-coverage --coverage-upload-options="reportsDir:$PWD/test-results/CoverageResults;name:NGOv2_project_{{ project.name }}_{{ platform.name }};flags:NGOv2_project_{{ project.name }}_{{ platform.name }};verbose" --coverage-results-path=$PWD/test-results/CoverageResults --coverage-options="generateHtmlReport;generateAdditionalMetrics;assemblyFilters:+Unity.Netcode.Editor,+Unity.Netcode.Runtime" --extra-editor-arg=--burst-disable-compilation --timeout={{ test_timeout }} --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --artifacts-path=test-results artifacts: logs: paths: @@ -52,4 +47,3 @@ code_coverage_project_test_{{ project.name }}_{{ platform.name }}_{{ editor }}: - .yamato/package-pack.yml#package_pack_-_ngo_{{ platform.name }} {% endfor -%} {% endfor -%} -{% endfor -%} diff --git a/.yamato/package-tests.yml b/.yamato/package-tests.yml index 50799533dd..5d6364c526 100644 --- a/.yamato/package-tests.yml +++ b/.yamato/package-tests.yml @@ -26,7 +26,7 @@ {% for platform in test_platforms.desktop -%} {% for editor in validation_editors.all -%} -package_test_-_ngo_{{ editor }}_{{ platform.name }}: +package_test_-_ngo_{{ platform.name }}_{{ editor }}: name : Package Test - NGO [{{ platform.name }}, {{ editor }}] agent: type: {{ platform.type }} diff --git a/.yamato/project-standards.yml b/.yamato/project-standards.yml index 137a9f1c50..2ebae81b5e 100644 --- a/.yamato/project-standards.yml +++ b/.yamato/project-standards.yml @@ -30,7 +30,7 @@ {% for project in projects.all -%} {% for platform in test_platforms.default -%} -{% for editor in validation_editors.minimal -%} +{% for editor in validation_editors.standards -%} standards_{{ platform.name }}_{{ project.name }}_{{ editor }}: name: Standards Check - NGO {{ project.name }} [{{ platform.name }}, {{ editor }}] agent: diff --git a/.yamato/project.metafile b/.yamato/project.metafile index 1930066b7b..0622567aec 100644 --- a/.yamato/project.metafile +++ b/.yamato/project.metafile @@ -172,20 +172,24 @@ test_platforms: standalone: GameCoreScarlett # EDITOR CONFIGURATIONS------------------------------------------------------------------------------- -# Editors to be used for testing. NGOv3.X official support started from 6000.7 editor +# Editors to be used for testing. NGOv3.X official support started from 6000.7.0b1 editor # TODO: When a new editor will be released it should be added to this list +# standards editor is used for standards check so we won't get random manifest changes due to newer editor being used validation_editors: default: - 6000.7 - all: - - 6000.7.0b1 + minimal: - 6000.7 + latest: - trunk + all: + - 6000.7 - dfdad7ed5522da345003b66ed78dc5e725357037 - minimal: + - trunk + standards: - 6000.7.0b1 -pinnedTrunk: dfdad7ed5522da345003b66ed78dc5e725357037 + pinnedTrunk: dfdad7ed5522da345003b66ed78dc5e725357037 # Scripting backends used by Standalone RunTimeTests--------------------------------------------------- diff --git a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md index c1e0a62f11..217a8c0c2e 100644 --- a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md +++ b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md @@ -22,14 +22,15 @@ To upgrade an existing project from version 2.x to version 3.x, follow these ste 1. Back up your project, or commit your work to source control. 2. Open your project with the Unity Editor version 6.7 or later. -3. Your project's manifest will be updated with NGO v3.x.x prior to the API updater running. +3. Your project's manifest will be updated with Netcode for GameObjects version 3.x.x prior to the API updater running. 4. The API updater should catch any issues and ask if you want to allow it to make changes to your script(s). 5. If you allow the API updater to make changes for you, then it should auto-update your project's scripts with the correct namespace changes. -6. If you do not allow the API updater to make changes for you, then the editor will enter safe mode. Open the **Console** window to review the remaining compile errors and resolve the errors. (_[Review the Update Editor assembly definition references section below.](#update-editor-assembly-definition-references)_). - +6. If you don't allow the API updater to make changes for you, then the Editor will enter safe mode. Open the **Console** window to review the remaining compile errors and resolve the errors manually. ([Refer to the Update Editor assembly definition references section below.](#update-editor-assembly-definition-references)). + After the API updater finishes and you resolve the compile errors, your project compiles against version 3.x. If the API updater doesn't resolve every reference, refer to [Continue an incomplete API update](#continue-an-incomplete-api-update). -_** If, at any point, you decide to downgrade to the editor version you were using prior to updating to 6.7, then make sure to restore or delete the packages-lock.json file (_assures you are not referencing 6.7 specific packages_), restore your backed up version, and delete your Library folder prior to opening your project with the editor version you were using prior to upgrading to 6.7._ +> [!NOTE] +> If you decide to downgrade to the Editor version you were using before updating to 6.7, then make sure to restore or delete the `packages-lock.json` file (which ensures you're not referencing any 6.7 specific packages), restore your backed up version, and delete your `Library` folder before opening your project with the Editor version you were using before upgrading to 6.7. ### Continue an incomplete API update diff --git a/testproject/Packages/manifest-unified.json b/testproject/Packages/manifest-unified.json index bffa344441..a8a2219ae9 100644 --- a/testproject/Packages/manifest-unified.json +++ b/testproject/Packages/manifest-unified.json @@ -12,6 +12,7 @@ "com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects", "com.unity.package-validation-suite": "0.49.0-preview", "com.unity.services.authentication": "3.7.4", + "com.unity.services.multiplayer": "2.3.3", "com.unity.test-framework": "1.9.0", "com.unity.test-framework.performance": "6.7.0", "com.unity.timeline": "6.7.0", diff --git a/testproject/Packages/manifest.json b/testproject/Packages/manifest.json index 667015e6db..864b9d586a 100644 --- a/testproject/Packages/manifest.json +++ b/testproject/Packages/manifest.json @@ -11,6 +11,7 @@ "com.unity.netcode.gameobjects": "file:../../com.unity.netcode.gameobjects", "com.unity.package-validation-suite": "0.49.0-preview", "com.unity.services.authentication": "3.7.4", + "com.unity.services.multiplayer": "2.3.3", "com.unity.test-framework": "1.9.0", "com.unity.test-framework.performance": "6.7.0", "com.unity.timeline": "6.7.0",