Skip to content

Commit 60d7373

Browse files
committed
Running CI only on comment trigger
1 parent d2b321e commit 60d7373

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-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: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
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
1820

1921
# Nightly:
2022
# This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds
@@ -38,6 +40,20 @@
3840

3941
#-----------------------------------------------------------------------------------
4042

43+
# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment
44+
# Notice that I needed this job to do "something" and that's why there is a placeholder GitHub action used
45+
# TODO: In the future we could have comment like "docs" or "project" to run a specific subset of tests
46+
check_pr_issue_comments_for_trigger_keywords:
47+
name: Check PR for trigger comments of ngo or ignore. For example /ci ngo
48+
agent:
49+
type: Unity::github::action
50+
action_source: pr-keyword-check.yml
51+
triggers:
52+
expression: |-
53+
pull_request.comment eq "ngo" OR
54+
pull_request.comment eq "ignore"
55+
56+
4157
# Run all relevant tasks when a pull request targeting the develop or release branch is created or updated.
4258
# 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.
4359
# Since standards job is a part of initial checks it's not present as direct dependency here
@@ -61,15 +77,10 @@ pull_request_trigger:
6177
# Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs
6278
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_2022.3
6379
triggers:
80+
expression: |-
81+
pull_request.comment eq "ngo" AND
82+
NOT pull_request.changes.all match "**/Documentation~/**"
6483
cancel_old_ci: true
65-
pull_requests:
66-
- targets:
67-
only:
68-
- "develop"
69-
- "develop-2.0.0"
70-
- "/release\/.*/"
71-
- drafts: false
72-
7384

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

0 commit comments

Comments
 (0)