Skip to content

Commit c4184e5

Browse files
committed
Running CI only on comment trigger
1 parent e14de9a commit c4184e5

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: PR keyword check
2+
on:
3+
workflow_dispatch:
4+
5+
# This workflow deliberately does nothing of value. The branch rules require the associated "Check PR issue comments for trigger keywords" job to have run before the PR being merged
6+
jobs:
7+
pr-keyword-check:
8+
runs-on: unity-linux-runner
9+
steps:
10+
- run: ls

.yamato/_triggers.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
# Focuses on critical validation paths that we should validate before merging PRs
1616
# Cancels previous runs on new commits
1717
# Excludes draft PRs
18+
# Excludes running when changes ONLY touching documentation files
19+
# Requires `/ci ngo` or `/ci ignore` comment to trigger the job. This was implemented and explained in https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3577
20+
1821

1922
# Nightly:
2023
# This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds
@@ -38,6 +41,20 @@
3841

3942
#-----------------------------------------------------------------------------------
4043

44+
# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment
45+
# Notice that I needed this job to do "something" and that's why there is a placeholder GitHub action used
46+
# TODO: In the future we could have comment like "docs" or "project" to run a specific subset of tests
47+
check_pr_issue_comments_for_trigger_keywords:
48+
name: Check PR for trigger comments of ngo or ignore. For example /ci ngo
49+
agent:
50+
type: Unity::github::action
51+
action_source: pr-keyword-check.yml
52+
triggers:
53+
expression: |-
54+
pull_request.comment eq "ngo" OR
55+
pull_request.comment eq "ignore"
56+
57+
4158
# Run all relevant tasks when a pull request targeting the develop or release branch is created or updated.
4259
# 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.
4360
# 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.
@@ -60,15 +77,10 @@ pull_request_trigger:
6077
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_win_il2cpp_6000.0
6178
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk
6279
triggers:
80+
expression: |-
81+
pull_request.comment eq "ngo" AND
82+
NOT pull_request.changes.all match "**/Documentation~/**"
6383
cancel_old_ci: true
64-
pull_requests:
65-
- targets:
66-
only:
67-
- "develop"
68-
- "develop-2.0.0"
69-
- "/release\/.*/"
70-
- drafts: false
71-
7284

7385
# Run all tests on trunk on nightly basis.
7486
# Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds

0 commit comments

Comments
 (0)