Skip to content

Commit d73702a

Browse files
committed
Build/Test Tools: Add some more paths restrictions to GitHub Actions 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
1 parent 784e60b commit d73702a

File tree

6 files changed

+82
-3
lines changed

6 files changed

+82
-3
lines changed

.github/workflows/end-to-end-tests.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ on:
1717
- trunk
1818
- '5.[3-9]'
1919
- '[6-9].[0-9]'
20+
paths:
21+
# Any change to a PHP, CSS, or JavaScript file should run checks.
22+
- '**.css'
23+
- '**.js'
24+
- '**.php'
25+
# These files configure npm and the task runner. Changes could affect the outcome.
26+
- 'package*.json'
27+
- 'Gruntfile.js'
28+
- 'webpack.config.js'
29+
- 'tools/webpack/**'
30+
# These files configure Composer. Changes could affect the outcome.
31+
- 'composer.*'
32+
# This files affect the e2e tests. Changes could affect the outcome.
33+
- 'tests/e2e/**'
34+
# Confirm any changes to relevant workflow files.
35+
- '.github/workflows/end-to-end-tests.yml'
36+
- '.github/workflows/reusable-end-to-end-tests-*.yml'
2037
workflow_dispatch:
2138

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

.github/workflows/javascript-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ on:
1919
paths:
2020
# Any change to a JavaScript file should run tests.
2121
- '**.js'
22-
# These files configure npm. Changes could affect the outcome.
22+
# These files configure npm and the task runner. Changes could affect the outcome.
2323
- 'package*.json'
24+
- 'Gruntfile.js'
25+
- 'webpack.config.js'
26+
- 'tools/webpack/**'
2427
# This file configures ESLint. Changes could affect the outcome.
2528
- '.eslintignore'
2629
# This file configures JSHint. Changes could affect the outcome.

.github/workflows/local-docker-environment.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ on:
1212
- 'docker-compose.yml'
1313
# Any changes to local environment related files
1414
- 'tools/local-env/**'
15-
# These files manage packages used by the local environment.
15+
# These files configure npm and the task runner. Changes could affect the outcome.
1616
- 'package*.json'
17+
- 'Gruntfile.js'
18+
- 'webpack.config.js'
19+
- 'tools/webpack/**'
1720
# These files configure Composer. Changes could affect the local environment.
1821
- 'composer.*'
1922
# These files define the versions to test.
@@ -33,8 +36,11 @@ on:
3336
- 'docker-compose.yml'
3437
# Any changes to local environment related files
3538
- 'tools/local-env/**'
36-
# These files manage packages used by the local environment.
39+
# These files configure npm and the task runner. Changes could affect the outcome.
3740
- 'package*.json'
41+
- 'Gruntfile.js'
42+
- 'webpack.config.js'
43+
- 'tools/webpack/**'
3844
# These files configure Composer. Changes could affect the local environment.
3945
- 'composer.*'
4046
# These files define the versions to test.

.github/workflows/performance.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ on:
1616
- trunk
1717
- '6.[2-9]'
1818
- '[7-9].[0-9]'
19+
paths:
20+
# Any change to a PHP, CSS, or JavaScript file should run checks.
21+
- '**.css'
22+
- '**.js'
23+
- '**.php'
24+
# These files configure npm and the task runner. Changes could affect the outcome.
25+
- 'package*.json'
26+
- 'Gruntfile.js'
27+
- 'webpack.config.js'
28+
- 'tools/webpack/**'
29+
# These files configure Composer. Changes could affect the outcome.
30+
- 'composer.*'
31+
# This files affect the performance tests. Changes could affect the outcome.
32+
- 'tests/performance/**'
33+
# Confirm any changes to relevant workflow files.
34+
- '.github/workflows/performance.yml'
35+
- '.github/workflows/reusable-performance.yml'
1936
workflow_dispatch:
2037

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

.github/workflows/phpunit-tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ on:
1414
- trunk
1515
- '3.[7-9]'
1616
- '[4-9].[0-9]'
17+
paths:
18+
# Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks.
19+
- '**.css'
20+
- '**.html'
21+
- '**.js'
22+
- '**.json'
23+
- '**.php'
24+
- 'src/license.txt'
25+
- 'src/SECURITY.md'
26+
# These files configure npm and the task runner. Changes could affect the outcome.
27+
- 'package*.json'
28+
- 'Gruntfile.js'
29+
# These files configure Composer. Changes could affect the outcome.
30+
- 'composer.*'
31+
# This files affect the phpunit tests. Changes could affect the outcome.
32+
- 'tests/phpunit/**'
33+
# Confirm any changes to relevant workflow files.
34+
- '.github/workflows/phpunit-tests.yml'
35+
- '.github/workflows/reusable-phpunit-tests-*.yml'
1736
workflow_dispatch:
1837
# Once weekly On Sundays at 00:00 UTC.
1938
schedule:

.github/workflows/test-build-processes.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ on:
1414
- trunk
1515
- '3.[7-9]'
1616
- '[4-9].[0-9]'
17+
paths:
18+
# Any change to a PHP, CSS, JavaScript, or JSON file should run checks.
19+
- '**.css'
20+
- '**.js'
21+
- '**.json'
22+
- '**.php'
23+
# These files configure npm and the task runner. Changes could affect the outcome.
24+
- 'package*.json'
25+
- 'Gruntfile.js'
26+
- 'webpack.config.js'
27+
- 'tools/webpack/**'
28+
# These files configure Composer. Changes could affect the outcome.
29+
- 'composer.*'
30+
# Confirm any changes to relevant workflow files.
31+
- '.github/workflows/test-build-processes.yml'
32+
- '.github/workflows/reusable-test-core-build-process.yml'
33+
- '.github/workflows/reusable-test-gutenberg-build-process.yml'
1734
workflow_dispatch:
1835

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

0 commit comments

Comments
 (0)