Skip to content

Commit 865b96a

Browse files
committed
Merge branch 'trunk' into 62416
# Conflicts: # .github/workflows/performance.yml
2 parents c2cd051 + 29df2d5 commit 865b96a

File tree

261 files changed

+11196
-5693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+11196
-5693
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ LOCAL_DB_TYPE=mysql
5151
# When using `mysql`, see https://hub.docker.com/_/mysql for valid versions.
5252
# When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
5353
##
54-
LOCAL_DB_VERSION=8.0
54+
LOCAL_DB_VERSION=8.4
5555

5656
# Whether or not to enable multisite.
5757
LOCAL_MULTISITE=false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Cleanup Pull Requests
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
- '4.[1-9]'
8+
- '[5-9].[0-9]'
9+
10+
# Cancels all previous workflow runs for pull requests that have not completed.
11+
concurrency:
12+
# The concurrency group contains the workflow name and the branch name for pull requests
13+
# or the commit hash for any other events.
14+
group: ${{ github.workflow }}-${{ github.sha }}
15+
cancel-in-progress: true
16+
17+
# Disable permissions for all available scopes by default.
18+
# Any needed permissions should be configured at the job level.
19+
permissions: {}
20+
21+
jobs:
22+
# Runs pull request cleanup.
23+
close-prs:
24+
name: Clean up pull requests
25+
permissions:
26+
pull-requests: write
27+
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
28+
uses: ./.github/workflows/reusable-cleanup-pull-requests.yml

.github/workflows/install-testing.yml

Lines changed: 24 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ on:
1111
paths:
1212
- '.github/workflows/install-testing.yml'
1313
- '.version-support-*.json'
14+
- '.github/workflows/reusable-support-json-reader-v1.yml'
1415
pull_request:
1516
# Always test the workflow when changes are suggested.
1617
paths:
17-
- '.github/workflows/install-testing.yml'
1818
- '.version-support-*.json'
19+
- '.github/workflows/install-testing.yml'
20+
- '.github/workflows/reusable-support-json-reader-v1.yml'
21+
1922
schedule:
2023
- cron: '0 0 * * 1'
2124
workflow_dispatch:
@@ -37,66 +40,21 @@ concurrency:
3740
permissions: {}
3841

3942
jobs:
40-
# Determines the appropriate values for PHP and database versions based on the WordPress version being tested.
41-
#
42-
# Performs the following steps:
43-
# - Checks out the repository.
44-
# - Fetches the versions of PHP to test.
45-
# - Fetches the versions of MySQL to test.
46-
build-matrix:
47-
name: Determine PHP Versions to test
48-
runs-on: ubuntu-latest
43+
# Determines the supported values for PHP and database versions based on the WordPress version being tested.
44+
build-test-matrix:
45+
name: Build Test Matrix
46+
uses: WordPress/wordpress-develop/.github/workflows/reusable-support-json-reader-v1.yml@trunk
47+
permissions:
48+
contents: read
49+
secrets: inherit
4950
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
50-
timeout-minutes: 5
51-
outputs:
52-
major-wp-version: ${{ steps.major-wp-version.outputs.version }}
53-
php-versions: ${{ steps.php-versions.outputs.versions }}
54-
mysql-versions: ${{ steps.mysql-versions.outputs.versions }}
55-
56-
steps:
57-
- name: Checkout repository
58-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
59-
with:
60-
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
61-
62-
- name: Determine the major WordPress version
63-
id: major-wp-version
64-
run: |
65-
if [ "${{ inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ]; then
66-
echo "version=$(echo "${{ inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT
67-
elif [ "${{ inputs.wp-version }}" ]; then
68-
echo "version=$(echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT
69-
else
70-
echo "version=nightly" >> $GITHUB_OUTPUT
71-
fi
72-
73-
# Look up the major version's specific PHP support policy when a version is provided.
74-
# Otherwise, use the current PHP support policy.
75-
- name: Get supported PHP versions
76-
id: php-versions
77-
run: |
78-
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then
79-
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
80-
else
81-
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
82-
fi
83-
84-
# Look up the major version's specific MySQL support policy when a version is provided.
85-
# Otherwise, use the current MySQL support policy.
86-
- name: Get supported MySQL versions
87-
id: mysql-versions
88-
run: |
89-
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then
90-
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
91-
else
92-
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
93-
fi
51+
with:
52+
wp-version: ${{ inputs.wp-version }}
9453

9554
# Test the WordPress installation process through WP-CLI.
9655
#
9756
# Performs the following steps:
9857
# - Sets up PHP.
99-
# - Starts the database server.
10058
# - Downloads the specified version of WordPress.
10159
# - Creates a `wp-config.php` file.
10260
# - Installs WordPress.
@@ -107,32 +65,38 @@ jobs:
10765
runs-on: ${{ matrix.os }}
10866
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
10967
timeout-minutes: 10
110-
needs: [ build-matrix ]
68+
needs: [ build-test-matrix ]
11169
strategy:
11270
fail-fast: false
11371
matrix:
11472
os: [ ubuntu-latest ]
115-
php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }}
73+
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }}
11674
db-type: [ 'mysql' ]
117-
db-version: ${{ fromJSON( needs.build-matrix.outputs.mysql-versions ) }}
75+
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}
11876
multisite: [ false, true ]
11977
memcached: [ false ]
12078

12179
# Exclude some PHP and MySQL versions that cannot currently be tested with Docker containers.
12280
exclude:
81+
# There are no local WordPress Docker environment containers for PHP <= 5.3.
12382
- php: '5.2'
12483
- php: '5.3'
84+
# MySQL containers <= 5.5 do not exist or fail to start properly.
12585
- db-version: '5.0'
12686
- db-version: '5.1'
12787
- db-version: '5.5'
88+
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
12889
- php: '7.2'
12990
db-version: '8.4'
13091
- php: '7.3'
13192
db-version: '8.4'
93+
# Only test the latest innovation release.
94+
- db-version: '9.0'
95+
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
13296
- php: '7.2'
133-
db-version: '9.0'
97+
db-version: '9.1'
13498
- php: '7.3'
135-
db-version: '9.0'
99+
db-version: '9.1'
136100

137101
services:
138102
database:
@@ -157,10 +121,6 @@ jobs:
157121
coverage: none
158122
tools: wp-cli${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && ':2.4.0' || '' }}
159123

160-
- name: Start the database server
161-
run: |
162-
sudo systemctl start ${{ matrix.db-type }}
163-
164124
- name: Download WordPress
165125
run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }}
166126

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: Local Docker Environment
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
- '6.[8-9]'
8+
- '[7-9].[0-9]'
9+
paths:
10+
# Any changes to Docker related files.
11+
- '.env.example'
12+
- 'docker-compose.yml'
13+
# Any changes to local environment related files
14+
- 'tools/local-env/**'
15+
# These files manage packages used by the local environment.
16+
- 'package*.json'
17+
# These files configure Composer. Changes could affect the local environment.
18+
- 'composer.*'
19+
# These files define the versions to test.
20+
- '.version-support-*.json'
21+
# Changes to this and related workflow files should always be verified.
22+
- '.github/workflows/local-docker-environment.yml'
23+
- '.github/workflows/reusable-support-json-reader-v1.yml'
24+
- '.github/workflows/reusable-test-docker-environment-v1.yml'
25+
pull_request:
26+
branches:
27+
- trunk
28+
- '6.[8-9]'
29+
- '[7-9].[0-9]'
30+
paths:
31+
# Any changes to Docker related files.
32+
- '.env.example'
33+
- 'docker-compose.yml'
34+
# Any changes to local environment related files
35+
- 'tools/local-env/**'
36+
# These files manage packages used by the local environment.
37+
- 'package*.json'
38+
# These files configure Composer. Changes could affect the local environment.
39+
- 'composer.*'
40+
# These files define the versions to test.
41+
- '.version-support-*.json'
42+
# Changes to this and related workflow files should always be verified.
43+
- '.github/workflows/local-docker-environment.yml'
44+
- '.github/workflows/reusable-support-json-reader-v1.yml'
45+
- '.github/workflows/reusable-test-docker-environment-v1.yml'
46+
workflow_dispatch:
47+
48+
# Cancels all previous workflow runs for pull requests that have not completed.
49+
concurrency:
50+
# The concurrency group contains the workflow name and the branch name for pull requests
51+
# or the commit hash for any other events.
52+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
53+
cancel-in-progress: true
54+
55+
# Disable permissions for all available scopes by default.
56+
# Any needed permissions should be configured at the job level.
57+
permissions: {}
58+
59+
jobs:
60+
#
61+
# Determines the appropriate supported values for PHP and database versions based on the WordPress
62+
# version being tested.
63+
#
64+
build-test-matrix:
65+
name: Build Test Matrix
66+
uses: WordPress/wordpress-develop/.github/workflows/reusable-support-json-reader-v1.yml@trunk
67+
permissions:
68+
contents: read
69+
secrets: inherit
70+
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
71+
with:
72+
wp-version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
73+
74+
# Tests the local Docker environment.
75+
environment-tests-mysql:
76+
name: PHP ${{ matrix.php }}
77+
uses: WordPress/wordpress-develop/.github/workflows/reusable-test-local-docker-environment-v1.yml@trunk
78+
permissions:
79+
contents: read
80+
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
81+
needs: [ build-test-matrix ]
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
os: [ ubuntu-latest ]
86+
memcached: [ false, true ]
87+
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }}
88+
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}
89+
90+
exclude:
91+
# MySQL containers <= 5.5 do not exist or fail to start properly.
92+
- db-version: '5.5'
93+
# Only test the latest innovation release.
94+
- db-version: '9.0'
95+
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
96+
- php: '7.2'
97+
db-version: '9.1'
98+
- php: '7.3'
99+
db-version: '9.1'
100+
101+
with:
102+
os: ${{ matrix.os }}
103+
php: ${{ matrix.php }}
104+
db-type: 'mysql'
105+
db-version: ${{ matrix.db-version }}
106+
memcached: ${{ matrix.memcached }}
107+
tests-domain: ${{ matrix.tests-domain }}
108+
109+
slack-notifications:
110+
name: Slack Notifications
111+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
112+
permissions:
113+
actions: read
114+
contents: read
115+
needs: [ build-test-matrix, environment-tests-mysql ]
116+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
117+
with:
118+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
119+
secrets:
120+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
121+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
122+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
123+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
124+
125+
failed-workflow:
126+
name: Failed workflow tasks
127+
runs-on: ubuntu-latest
128+
permissions:
129+
actions: write
130+
needs: [ build-test-matrix, environment-tests-mysql, slack-notifications ]
131+
if: |
132+
always() &&
133+
github.repository == 'WordPress/wordpress-develop' &&
134+
github.event_name != 'pull_request' &&
135+
github.run_attempt < 2 &&
136+
(
137+
contains( needs.*.result, 'cancelled' ) ||
138+
contains( needs.*.result, 'failure' )
139+
)
140+
141+
steps:
142+
- name: Dispatch workflow run
143+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
144+
with:
145+
retries: 2
146+
retry-exempt-status-codes: 418
147+
script: |
148+
github.rest.actions.createWorkflowDispatch({
149+
owner: context.repo.owner,
150+
repo: context.repo.repo,
151+
workflow_id: 'failed-workflow.yml',
152+
ref: 'trunk',
153+
inputs: {
154+
run_id: '${{ github.run_id }}'
155+
}
156+
});

.github/workflows/performance.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ permissions: {}
3232
jobs:
3333
# Runs the performance test suite.
3434
performance:
35-
name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }}
35+
name: ${{ matrix.multisite && 'Multisite' || 'Single site' }}
3636
uses: ./.github/workflows/reusable-performance.yml
3737
permissions:
3838
contents: read
39-
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
39+
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
4040
strategy:
4141
fail-fast: false
4242
matrix:
4343
memcached: [ true, false ]
44+
multisite: [ true, false ]
4445
with:
4546
memcached: ${{ matrix.memcached }}
47+
multisite: ${{ matrix.multisite }}
4648
secrets:
4749
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
4850

0 commit comments

Comments
 (0)