From 4a09e7d87767b768589b940c8ca0f5fbea98cfd1 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 24 Feb 2021 19:34:41 +0000 Subject: [PATCH] Build/Test Tools: Limit when GitHub Action workflows run on `pull_request`. Different branches have support for different types of testing based on the tooling that was in place at the time each version was branched. The workflows currently in place have patterns configured to match the relevant `branches` and `tags` for each workflow, but only for `push` events. This copies the patterns for matching supported `branches` over to the `pull_request` event to prevent workflows from running for a pull request to a branch that does not support that workflow. Fixes #52643. git-svn-id: https://develop.svn.wordpress.org/trunk@50432 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/coding-standards.yml | 8 ++++++-- .github/workflows/end-to-end-tests.yml | 6 +++++- .github/workflows/javascript-tests.yml | 6 +++++- .github/workflows/php-compatibility.yml | 6 +++++- .github/workflows/phpunit-tests.yml | 4 ++++ .github/workflows/verify-npm-on-windows.yml | 4 ++++ 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ab319f77d6..e5117f737d 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -1,17 +1,21 @@ name: Coding Standards on: + # JSHint was introduced in WordPress 3.8. + # PHPCS checking was introduced in WordPress 5.1. push: branches: - master - # JSHint was introduced in WordPress 3.8. - # PHPCS checking was introduced in WordPress 5.1. - '3.[89]' - '[4-9].[0-9]' tags: - '3.[89]*' - '[4-9].[0-9]*' pull_request: + branches: + - master + - '3.[89]' + - '[4-9].[0-9]' jobs: # Runs PHP coding standards checks. diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 1dce7cd414..f99d5ead10 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -1,16 +1,20 @@ name: End-to-end Tests on: + # The end to end test suite was introduced in WordPress 5.3. push: branches: - master - # The end to end test suite was introduced in WordPress 5.3. - '5.[3-9]' - '[6-9].[0-9]' tags: - '5.[3-9]*' - '[6-9].[0-9]*' pull_request: + branches: + - master + - '5.[3-9]' + - '[6-9].[0-9]' env: LOCAL_DIR: build diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 3bfa95e2d9..b873c5ac33 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -1,16 +1,20 @@ name: JavaScript Tests on: + # JavaScript testing was introduced in WordPress 3.8. push: branches: - master - # JavaScript testing was introduced in WordPress 3.8. - '3.[89]' - '[4-9].[0-9]' tags: - '3.[89]*' - '[4-9].[0-9]*' pull_request: + branches: + - master + - '3.[89]' + - '[4-9].[0-9]' jobs: # Runs the QUnit tests for WordPress. diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index d213c2612f..0506dad5b2 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -1,16 +1,20 @@ name: PHP Compatibility on: + # PHP compatibility testing was introduced in WordPress 5.5. push: branches: - master - # The PHP compatibility testing was introduced in WordPress 5.5. - '5.[5-9]' - '[6-9].[0-9]' tags: - '5.[5-9]*' - '[6-9].[0-9]*' pull_request: + branches: + - master + - '5.[5-9]' + - '[6-9].[0-9]' jobs: diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index ae61625478..4d0cbea7c1 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -10,6 +10,10 @@ on: - '3.[7-9]*' - '[4-9].[0-9]*' pull_request: + branches: + - master + - '3.[7-9]' + - '[4-9].[0-9]' # Once weekly On Sundays at 00:00 UTC. schedule: - cron: '0 0 * * 0' diff --git a/.github/workflows/verify-npm-on-windows.yml b/.github/workflows/verify-npm-on-windows.yml index 70d2109539..fb4218c681 100644 --- a/.github/workflows/verify-npm-on-windows.yml +++ b/.github/workflows/verify-npm-on-windows.yml @@ -7,6 +7,10 @@ on: - '3.[7-9]' - '[4-9].[0-9]' pull_request: + branches: + - master + - '3.[7-9]' + - '[4-9].[0-9]' env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}