Build/Test Tools: Add path detection when running GitHub Actions on pull_request.

This change adds a list of paths to check when determining which workflows to run on `pull_request`. This will prevent certain workflows from running unnecessarily when the files updated are not related to the tests and checks being performed.

Props peterwilsoncc, johnbillion.
Fixes #52667.

git-svn-id: https://develop.svn.wordpress.org/trunk@50479 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2021-03-02 19:57:15 +00:00
parent fdbffbd2bd
commit 481bdeebdf
4 changed files with 46 additions and 0 deletions

View File

@ -18,6 +18,20 @@ on:
- trunk
- '3.[89]'
- '[4-9].[0-9]'
paths:
# Any change to a PHP or JavaScript file should run checks.
- '**.js'
- '**.php'
# These files configure NPM. Changes could affect the outcome.
- 'package*.json'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures JSHint. Changes could affect the outcome.
- '.jshintrc'
# This file configures PHPCS. Changes could affect the outcome.
- 'phpcs.xml.dist'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
jobs:
# Runs PHP coding standards checks.

View File

@ -17,6 +17,19 @@ on:
- trunk
- '3.[89]'
- '[4-9].[0-9]'
paths:
# Any change to a JavaScript file should run tests.
- '**.js'
# These files configure NPM. Changes could affect the outcome.
- 'package*.json'
# This file configures ESLint. Changes could affect the outcome.
- '.eslintignore'
# This file configures JSHint. Changes could affect the outcome.
- '.jshintrc'
# Any change to the QUnit directory should run tests.
- 'tests/qunit/**'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
jobs:
# Runs the QUnit tests for WordPress.

View File

@ -17,6 +17,15 @@ on:
- trunk
- '5.[5-9]'
- '[6-9].[0-9]'
paths:
# This workflow only scans PHP files.
- '**.php'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures PHP Compatibility scanning. Changes could affect the outcome.
- 'phpcompat.xml.dist'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
jobs:

View File

@ -13,6 +13,16 @@ on:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
paths:
# These files configure NPM. Changes could affect the outcome.
- 'package*.json'
# JavaScript files are built using NPM.
- '**.js'
# CSS and SCSS files are built using NPM.
- '**.scss'
- '**.css'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/**.yml'
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}