Skip to content

Commit

Permalink
Build/Test Tools: Add some more paths restrictions to GitHub Action…
Browse files Browse the repository at this point in the history
…s workflow files to minimise unnecessary workflow runs.

Props mukesh27, johnbillion

See #62280

git-svn-id: https://develop.svn.wordpress.org/trunk@59725 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
johnbillion committed Jan 28, 2025
1 parent 784e60b commit d73702a
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ on:
- trunk
- '5.[3-9]'
- '[6-9].[0-9]'
paths:
# Any change to a PHP, CSS, or JavaScript file should run checks.
- '**.css'
- '**.js'
- '**.php'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the e2e tests. Changes could affect the outcome.
- 'tests/e2e/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/end-to-end-tests.yml'
- '.github/workflows/reusable-end-to-end-tests-*.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ on:
paths:
# Any change to a JavaScript file should run tests.
- '**.js'
# These files configure npm. Changes could affect the outcome.
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# This file configures ESLint. Changes could affect the outcome.
- '.eslintignore'
# This file configures JSHint. Changes could affect the outcome.
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/local-docker-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ on:
- 'docker-compose.yml'
# Any changes to local environment related files
- 'tools/local-env/**'
# These files manage packages used by the local environment.
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the local environment.
- 'composer.*'
# These files define the versions to test.
Expand All @@ -33,8 +36,11 @@ on:
- 'docker-compose.yml'
# Any changes to local environment related files
- 'tools/local-env/**'
# These files manage packages used by the local environment.
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the local environment.
- 'composer.*'
# These files define the versions to test.
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ on:
- trunk
- '6.[2-9]'
- '[7-9].[0-9]'
paths:
# Any change to a PHP, CSS, or JavaScript file should run checks.
- '**.css'
- '**.js'
- '**.php'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the performance tests. Changes could affect the outcome.
- 'tests/performance/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/performance.yml'
- '.github/workflows/reusable-performance.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ on:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
paths:
# Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks.
- '**.css'
- '**.html'
- '**.js'
- '**.json'
- '**.php'
- 'src/license.txt'
- 'src/SECURITY.md'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the phpunit tests. Changes could affect the outcome.
- 'tests/phpunit/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/phpunit-tests.yml'
- '.github/workflows/reusable-phpunit-tests-*.yml'
workflow_dispatch:
# Once weekly On Sundays at 00:00 UTC.
schedule:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test-build-processes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ on:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
paths:
# Any change to a PHP, CSS, JavaScript, or JSON file should run checks.
- '**.css'
- '**.js'
- '**.json'
- '**.php'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# Confirm any changes to relevant workflow files.
- '.github/workflows/test-build-processes.yml'
- '.github/workflows/reusable-test-core-build-process.yml'
- '.github/workflows/reusable-test-gutenberg-build-process.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down

0 comments on commit d73702a

Please sign in to comment.