Skip to content

ci: Setting up conditional CI runs depending on PR comment trigger #3580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop-2.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/pr-keyword-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: PR keyword check
on:
workflow_dispatch:

# 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
jobs:
pr-keyword-check:
runs-on: unity-linux-runner
steps:
- run: ls
28 changes: 20 additions & 8 deletions .yamato/_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# Focuses on critical validation paths that we should validate before merging PRs
# Cancels previous runs on new commits
# Excludes draft PRs
# Excludes running when changes ONLY touching documentation files
# 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


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

#-----------------------------------------------------------------------------------

# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment
# Notice that I needed this job to do "something" and that's why there is a placeholder GitHub action used
# TODO: In the future we could have comment like "docs" or "project" to run a specific subset of tests
check_pr_issue_comments_for_trigger_keywords:
name: Check PR for trigger comments of ngo or ignore. For example /ci ngo
agent:
type: Unity::github::action
action_source: pr-keyword-check.yml
triggers:
expression: |-
pull_request.comment eq "ngo" OR
pull_request.comment eq "ignore"


# 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.
Expand All @@ -60,15 +77,10 @@ pull_request_trigger:
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_win_il2cpp_6000.0
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk
triggers:
expression: |-
pull_request.comment eq "ngo" AND
NOT pull_request.changes.all match "**/Documentation~/**"
cancel_old_ci: true
pull_requests:
- targets:
only:
- "develop"
- "develop-2.0.0"
- "/release\/.*/"
- drafts: false


# Run all tests on trunk on nightly basis.
# Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds
Expand Down
97 changes: 0 additions & 97 deletions .yamato/disable-burst-if-requested.py

This file was deleted.

Loading