-
Notifications
You must be signed in to change notification settings - Fork 459
Expand file tree
/
Copy path_triggers.yml
More file actions
191 lines (166 loc) · 11.3 KB
/
_triggers.yml
File metadata and controls
191 lines (166 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
---
# DESCRIPTION--------------------------------------------------------------------------
# This configuration defines three main CI trigger patterns:
# 1. Pull Request Validation: Validation performed on PR basis
# - we have mandatory minimal checks that run on all PRs (even if only docs are changed)
# - we have more extensive pr_code_changes_checks that run if code is changed
# 2. Nightly Development: Test set run nightly (validates most important test cases)
# 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any surprises)
# Each pattern represents different balance between validation depth, execution time and CI resource usage
# TRIGGER PATTERNS-------------------------------------------------------------------
# Pull Request:
# We have two PR triggers:
# 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 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
# 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
# Runs daily on develop (local configuration)
# Includes all test types but only on trunk.
# Adds platform-specific and APV validation
# Weekly:
# This test validates same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project
# Runs across all supported editor versions
# Includes code coverage analysis
# Validates all projects and standards
# CONFIGURATION STRUCTURE--------------------------------------------------------------
# Jobs configurations are generated by ensuring that all dependencies are successful.
# The dependencies are taken from _run-all.yml file where we can gather multiple tests into proper sets
# QUALITY CONSIDERATIONS---------------------------------------------------------------
# It's important to ensure that all dependencies exist (this can be verified in Yamato) since a modification in parameters may result in a given job not being generated, and thus we will not be able to run such erroneous job.
#-----------------------------------------------------------------------------------
# After some experimenting with CI setups we discovered that even though sometimes we don't need CI to run (no reason to run package tests if only Documentation is changed) there are some checks that devs may not realize but changes in seemingly unrelated files will cause their failures
# This trigger was created to ensure that ALL PRs run this minimal check even when we don't need to run full tests
pr_minimal_required_checks:
name: Minimal PR checks
dependencies:
- .yamato/project-standards.yml#standards_ubuntu_testproject_{{ validation_editors.default }}
- .yamato/package-pack.yml#package_pack_-_ngo_win
triggers:
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
cancel_old_ci: true
# 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.
# This job will FIRST run "run_quick_checks" jobs (defined in _run-all.yml) since it's the dependency of project pack jobs which is on the lowest dependency tier. This runs the fastest checks (like PVP or code standards) and ONLY IF those pass it will run the rest of the tests.
# This optimization allows to speed up feedback look for any "obvious" errors and save resources.
# Since standards job is a part of initial checks it's not present as direct dependency here!!!!!!!!!!!!!!!!!!!!
pr_code_changes_checks:
name: Code changes PR checks
# Run the following tests on a selection of different desktop platforms
dependencies:
# 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 trunk and an older supported editor (6000.0)
- .yamato/package-tests.yml#package_test_-_ngo_trunk_mac
- .yamato/package-tests.yml#package_test_-_ngo_6000.0_win
# Run testproject EditMode and Playmode project tests on trunk and an older supported editor (6000.0)
- .yamato/project-tests.yml#test_testproject_win_trunk
- .yamato/project-tests.yml#test_testproject_mac_6000.0
# 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_trunk
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk
triggers:
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/Editor/**",
"com.unity.netcode.gameobjects/Runtime/**",
"com.unity.netcode.gameobjects/Tests/**",
"testproject/**",
"com.unity.netcode.gameobjects/package.json"
] AND
NOT pull_request.changes.all match [
"**/Documentation~/**",
"**/InternalDocs~/**",
"**/*.md"
]
cancel_old_ci: true
# Run all tests on trunk on nightly basis.
# Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds
# Those tests are all running on trunk 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 6000]"
triggers:
recurring:
- 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.default }}
# 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 6000.0
- .yamato/_run-all.yml#run_all_package_tests_trunk
- .yamato/_run-all.yml#run_all_package_tests_6000
# Run project EditMode and PLaymode tests on desktop platforms on trunk and 6000.0
- .yamato/_run-all.yml#run_all_project_tests_trunk
- .yamato/_run-all.yml#run_all_project_tests_6000
# Run Runtime tests on desktop players on trunk and 6000.0 editors
- .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_trunk
- .yamato/_run-all.yml#run_all_project_tests_desktop_standalone_6000
# Run Runtime tests on mobile players on trunk and 6000.0 editors
- .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_trunk
- .yamato/_run-all.yml#run_all_project_tests_mobile_standalone_6000
# Run Runtime tests on console players on trunk and 6000.0 editors
- .yamato/_run-all.yml#run_all_project_tests_console_standalone_trunk
- .yamato/_run-all.yml#run_all_project_tests_console_standalone_6000
# Build player for webgl platform on trunk and 6000.0 editors
- .yamato/_run-all.yml#run_all_webgl_builds_trunk
- .yamato/_run-all.yml#run_all_webgl_builds_6000
# Run Runtime tests against cmb service on trunk and 6000.0 editors
- .yamato/_run-all.yml#run_all_project_tests_cmb_service_trunk
- .yamato/_run-all.yml#run_all_project_tests_cmb_service_6000
# Build player for webgl platform on trunk and 6000.0 editors
- .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_ubuntu_trunk
- .yamato/project-updated-dependencies-test.yml#updated-dependencies_testproject_NGO_win_6000.0
# 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 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
develop_weekly_trunk:
name: "\U0001F319 [Weekly] Run All Tests"
triggers:
recurring:
- branch: develop-2.0.0
frequency: weekly
rerun: always
dependencies:
# Run project standards to verify package/default project
- .yamato/_run-all.yml#run_all_projects_standards
# Run package EditMode and Playmode tests on desktop platforms
- .yamato/_run-all.yml#run_all_package_tests
# Run project EditMode and PLaymode tests on desktop platforms
- .yamato/_run-all.yml#run_all_project_tests
# Run Runtime tests on desktop players
- .yamato/_run-all.yml#run_all_project_tests_desktop_standalone
# Run Runtime tests on mobile players
- .yamato/_run-all.yml#run_all_project_tests_mobile_standalone
# Run Runtime tests on console players
- .yamato/_run-all.yml#run_all_project_tests_console_standalone
# Build player for webgl platform on trunk
- .yamato/_run-all.yml#run_all_webgl_builds
# Run Runtime tests against CMB service
- .yamato/_run-all.yml#run_all_project_tests_cmb_service
# Run code coverage test
- .yamato/code-coverage.yml#code_coverage_ubuntu_{{ validation_editors.default }}