diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index a789382c8d..d0585d925f 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -11,10 +11,13 @@ # TRIGGER PATTERNS------------------------------------------------------------------- # Pull Request: # This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered - # Triggers on PRs to develop, develop, and release branches - # Focuses on critical validation paths that we should validate before merging PRs - # Cancels previous runs on new commits - # Excludes draft PRs + # Focuses on critical validation paths that we should validate before merging PRs. It also cancels previous runs on new commits + # By default it's triggered if + # 1) PR targets develop, develop-2.0.0 or release branches + # 2) PR is not a draft + # 3) PR changes files in package or testproject folders (doesn't run on for example DOCS only changes) + + # Note that in other cases you can trigger it by writing a comment "/ci ngo" in the PR thread # Nightly: # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds @@ -38,6 +41,7 @@ #----------------------------------------------------------------------------------- + # Run all relevant tasks when a pull request targeting the develop or release branch is created or updated. # In order to have better coverage we run desktop standalone tests with different configurations which allows to mostly cover for different platforms, scripting backends and editor versions. # Since standards job is a part of initial checks it's not present as direct dependency here @@ -61,15 +65,18 @@ pull_request_trigger: # Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_2022.3 triggers: + # Note that PR tests will run ONLY if we are changing package/sample code. If changes are let's say docs only no tests will be triggered + # TODO: consider setting up and running tests from Examples/ + # TODO: or docs only changes are spelling/link check + expression: |- + pull_request.comment eq "ngo" OR + ((pull_request.target eq "develop" OR + pull_request.target eq "develop-2.0.0" OR + pull_request.target match "release/*") AND + NOT pull_request.draft AND + (pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR + pull_request.changes.any match "testproject/**")) cancel_old_ci: true - pull_requests: - - targets: - only: - - "develop" - - "develop-2.0.0" - - "/release\/.*/" - - drafts: false - # Run all tests on 6000.2 (latest supported editor) on nightly basis. # Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds diff --git a/.yamato/disable-burst-if-requested.py b/.yamato/disable-burst-if-requested.py deleted file mode 100644 index edf84d3f26..0000000000 --- a/.yamato/disable-burst-if-requested.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was used before for mobiles and Webgl but was removed (around end of January 2025). The file itself was left here for now in case we would need to use it. -# This Python script is used to manage Burst AOT (Ahead-Of-Time) compilation settings for Unity builds. -# An example usage would be "- python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform WebGL" - -import argparse -import json -import os - - -args = None -platform_plugin_definition = None - - -def resolve_target(platform): - resolved_target = platform - if 'StandaloneWindows' in platform: - resolved_target = 'StandaloneWindows' - elif 'StandaloneLinux' in platform: - resolved_target = 'StandaloneLinux64' - - return resolved_target - - -def create_config(settings_path, platform): - config_name = os.path.join(settings_path, 'BurstAotSettings_{}.json'.format(resolve_target(platform))) - monobehaviour = { - 'm_Enabled': True, - 'm_EditorHideFlags': 0, - 'm_Name': "", - 'm_EditorClassIdentifier': 'Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings', - 'DisableOptimisations': False, - 'DisableSafetyChecks': True, - 'DisableBurstCompilation': False - } - - data = {'MonoBehaviour': monobehaviour} - with open(config_name, 'w') as f: - json.dump(data, f) - return config_name - - -def get_or_create_AOT_config(project_path, platform): - settings_path = os.path.join(project_path, 'ProjectSettings') - if not os.path.isdir(settings_path): - os.mkdir(settings_path) - config_names = [os.path.join(settings_path, filename) for filename in os.listdir(settings_path) if filename.startswith("BurstAotSettings_{}".format(resolve_target(platform)))] - if not config_names: - return [create_config(settings_path, platform)] - return config_names - - -def disable_AOT(project_path, platform): - config_names = get_or_create_AOT_config(project_path, platform) - for config_name in config_names: - set_AOT(config_name, True) - - -def enable_AOT(project_path, platform): - config_names = get_or_create_AOT_config(project_path, platform) - for config_name in config_names: - set_AOT(config_name, False) - - -def set_AOT(config_file, status): - config = None - with open(config_file, 'r') as f: - config = json.load(f) - - assert config is not None, 'AOT settings not found; did the burst-enabled build finish successfully?' - - config['MonoBehaviour']['DisableBurstCompilation'] = status - with open(config_file, 'w') as f: - json.dump(config, f) - - -def main(): - enable_burst = os.environ.get('ENABLE_BURST_COMPILATION', 'true').strip().lower() - if enable_burst == 'true': - print('BURST COMPILATION: ENABLED') - elif enable_burst == 'false': - print('BURST COMPILATION: DISABLED') - disable_AOT(args.project_path, args.platform) - else: - sys.exit('BURST COMPILATION: unexpected value: {}'.format(enable_burst)) - - -def parse_args(): - global args - parser = argparse.ArgumentParser(description='This tool disables burst AOT compilation') - parser.add_argument('--project-path', help='Specify the location of the unity project.') - parser.add_argument('--platform', help="Platform to be used to run the build.") - args = parser.parse_args() - - -if __name__ == '__main__': - parse_args() - main() \ No newline at end of file