Skip to content

Commit 6e194b1

Browse files
committed
Implement YAML aliases and anchors for branches and paths in workflow files.
1 parent 7a840d3 commit 6e194b1

14 files changed

+40
-121
lines changed

.github/workflows/coding-standards.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
# JSHint was introduced in WordPress 3.8.
55
# PHPCS checking was introduced in WordPress 5.1.
66
push:
7-
branches:
7+
branches: &branches
88
- trunk
99
- '3.[89]'
1010
- '[4-9].[0-9]'
@@ -13,10 +13,7 @@ on:
1313
- '[0-9]+.[0-9].[0-9]+'
1414
- '!3.7.[0-9]+'
1515
pull_request:
16-
branches:
17-
- trunk
18-
- '3.[89]'
19-
- '[4-9].[0-9]'
16+
branches: *branches
2017
paths:
2118
# Any change to a PHP or JavaScript file should run checks.
2219
- '**.js'

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: End-to-end Tests
33
on:
44
# The end-to-end test suite was introduced in WordPress 5.3.
55
push:
6-
branches:
6+
branches: &branches
77
- trunk
88
- '5.[3-9]'
99
- '[6-9].[0-9]'
@@ -13,10 +13,7 @@ on:
1313
- '![34].[0-9].[0-9]+'
1414
- '!5.[0-2].[0-9]+'
1515
pull_request:
16-
branches:
17-
- trunk
18-
- '5.[3-9]'
19-
- '[6-9].[0-9]'
16+
branches: *branches
2017
paths:
2118
# Any change to a PHP, CSS, or JavaScript file should run checks.
2219
- '**.css'

.github/workflows/install-testing.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ name: Installation Tests
55

66
on:
77
push:
8-
branches:
8+
branches: &branches
99
- trunk
1010
# Always test the workflow after it's updated.
11-
paths:
11+
paths: &paths
1212
- '.github/workflows/install-testing.yml'
1313
- '.version-support-*.json'
1414
- '.github/workflows/reusable-support-json-reader-v1.yml'
1515
pull_request:
16-
# Always test the workflow when changes are suggested.
17-
paths:
18-
- '.version-support-*.json'
19-
- '.github/workflows/install-testing.yml'
20-
- '.github/workflows/reusable-support-json-reader-v1.yml'
16+
branches: *branches
17+
paths: *paths
2118

2219
schedule:
2320
- cron: '0 0 * * 1'

.github/workflows/javascript-tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: JavaScript Tests
33
on:
44
# JavaScript testing was introduced in WordPress 3.8.
55
push:
6-
branches:
6+
branches: &branches
77
- trunk
88
- '3.[89]'
99
- '[4-9].[0-9]'
@@ -12,10 +12,7 @@ on:
1212
- '[0-9]+.[0-9].[0-9]+'
1313
- '!3.7.[0-9]+'
1414
pull_request:
15-
branches:
16-
- trunk
17-
- '3.[89]'
18-
- '[4-9].[0-9]'
15+
branches: *branches
1916
paths:
2017
# Any change to a JavaScript file should run tests.
2118
- '**.js'

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

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Local Docker Environment
22

33
on:
44
push:
5-
branches:
5+
branches: &branches
66
- trunk
77
- '6.[8-9]'
88
- '[7-9].[0-9]'
9-
paths:
9+
paths: &paths
1010
# Any changes to Docker related files.
1111
- '.env.example'
1212
- 'docker-compose.yml'
@@ -28,31 +28,8 @@ on:
2828
- '.github/workflows/reusable-support-json-reader-v1.yml'
2929
- '.github/workflows/reusable-test-docker-environment-v1.yml'
3030
pull_request:
31-
branches:
32-
- trunk
33-
- '6.[8-9]'
34-
- '[7-9].[0-9]'
35-
paths:
36-
# Any changes to Docker related files.
37-
- '.env.example'
38-
- 'docker-compose.yml'
39-
# Any changes to local environment related files
40-
- 'tools/local-env/**'
41-
# These files configure npm and the task runner. Changes could affect the outcome.
42-
- 'package*.json'
43-
- 'Gruntfile.js'
44-
- 'webpack.config.js'
45-
- 'tools/webpack/**'
46-
- '.npmrc'
47-
- '.nvmrc'
48-
# These files configure Composer. Changes could affect the local environment.
49-
- 'composer.*'
50-
# These files define the versions to test.
51-
- '.version-support-*.json'
52-
# Changes to this and related workflow files should always be verified.
53-
- '.github/workflows/local-docker-environment.yml'
54-
- '.github/workflows/reusable-support-json-reader-v1.yml'
55-
- '.github/workflows/reusable-test-docker-environment-v1.yml'
31+
branches: *branches
32+
paths: *paths
5633
workflow_dispatch:
5734

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

.github/workflows/performance.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Performance Tests
22

33
on:
44
push:
5-
branches:
5+
branches: &branches
66
- trunk
77
- '6.[2-9]'
88
- '[7-9].[0-9]'
@@ -12,10 +12,7 @@ on:
1212
- '![45].[0-9].[0-9]+'
1313
- '!6.[01].[0-9]+'
1414
pull_request:
15-
branches:
16-
- trunk
17-
- '6.[2-9]'
18-
- '[7-9].[0-9]'
15+
branches: *branches
1916
paths:
2017
# Any change to a PHP, CSS, or JavaScript file should run checks.
2118
- '**.css'

.github/workflows/php-compatibility.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: PHP Compatibility
33
on:
44
# PHP compatibility testing was introduced in WordPress 5.5.
55
push:
6-
branches:
6+
branches: &branches
77
- trunk
88
- '5.[5-9]'
99
- '[6-9].[0-9]'
@@ -13,10 +13,7 @@ on:
1313
- '![34].[0-9].[0-9]+'
1414
- '!5.[0-4].[0-9]+'
1515
pull_request:
16-
branches:
17-
- trunk
18-
- '5.[5-9]'
19-
- '[6-9].[0-9]'
16+
branches: *branches
2017
paths:
2118
# This workflow only scans PHP files.
2219
- '**.php'

.github/workflows/phpunit-tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ name: PHPUnit Tests
22

33
on:
44
push:
5-
branches:
5+
branches: &branches
66
- trunk
77
- '3.[7-9]'
88
- '[4-9].[0-9]'
99
tags:
1010
- '[0-9]+.[0-9]'
1111
- '[0-9]+.[0-9].[0-9]+'
1212
pull_request:
13-
branches:
14-
- trunk
15-
- '3.[7-9]'
16-
- '[4-9].[0-9]'
13+
branches: *branches
1714
paths:
1815
# Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks.
1916
- '**.css'

.github/workflows/test-and-zip-default-themes.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Test Default Themes & Create ZIPs
22

33
on:
44
push:
5-
branches:
5+
branches: &branches
66
- trunk
77
- '3.[89]'
88
- '[4-9].[0-9]'
9-
paths:
9+
paths: &paths
1010
# Changing the preferred version of Node.js could affect themes with build processes.
1111
- '.npmrc'
1212
- '.nvmrc'
@@ -19,22 +19,8 @@ on:
1919
# Changes to this workflow file should always verify success.
2020
- '.github/workflows/test-and-zip-default-themes.yml'
2121
pull_request:
22-
branches:
23-
- trunk
24-
- '3.[89]'
25-
- '[4-9].[0-9]'
26-
paths:
27-
# Changing the preferred version of Node.js could affect themes with build processes.
28-
- '.npmrc'
29-
- '.nvmrc'
30-
# Changes to any themes with a build script should be confirmed.
31-
- 'src/wp-content/themes/twentynineteen/**'
32-
- 'src/wp-content/themes/twentytwenty/**'
33-
- 'src/wp-content/themes/twentytwentyone/**'
34-
- 'src/wp-content/themes/twentytwentytwo/**'
35-
- 'src/wp-content/themes/twentytwentyfive/**'
36-
# Changes to this workflow file should always verify success.
37-
- '.github/workflows/test-and-zip-default-themes.yml'
22+
branches: *branches
23+
paths: *paths
3824
workflow_dispatch:
3925
inputs:
4026
branch:

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ name: Test Build Processes
22

33
on:
44
push:
5-
branches:
5+
branches: &branches
66
- trunk
77
- '3.[7-9]'
88
- '[4-9].[0-9]'
99
tags:
1010
- '[0-9]+.[0-9]'
1111
- '[0-9]+.[0-9].[0-9]+'
1212
pull_request:
13-
branches:
14-
- trunk
15-
- '3.[7-9]'
16-
- '[4-9].[0-9]'
13+
branches: *branches
1714
paths:
1815
# Any change to a PHP, CSS, JavaScript, or JSON file should run checks.
1916
- '**.css'

0 commit comments

Comments
 (0)