Skip to content

Commit a27411d

Browse files
committed
Merge branch 'trunk' into 21022-bcrypt-sha2
2 parents 2321412 + 9104190 commit a27411d

File tree

368 files changed

+6535
-2721
lines changed

Some content is hidden

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

368 files changed

+6535
-2721
lines changed

.github/workflows/install-testing.yml

Lines changed: 30 additions & 68 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,14 +65,14 @@ 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

@@ -125,6 +83,14 @@ jobs:
12583
- db-version: '5.0'
12684
- db-version: '5.1'
12785
- db-version: '5.5'
86+
- php: '7.2'
87+
db-version: '8.4'
88+
- php: '7.3'
89+
db-version: '8.4'
90+
- php: '7.2'
91+
db-version: '9.0'
92+
- php: '7.3'
93+
db-version: '9.0'
12894

12995
services:
13096
database:
@@ -133,13 +99,13 @@ jobs:
13399
- 3306
134100
options: >-
135101
--health-cmd="mysqladmin ping"
136-
--health-interval=30s
137-
--health-timeout=10s
138-
--health-retries=5
139-
-e MYSQL_ROOT_PASSWORD=root
140-
-e MYSQL_DATABASE=test_db
102+
--health-interval="30s"
103+
--health-timeout="10s"
104+
--health-retries="5"
105+
-e MYSQL_ROOT_PASSWORD="root"
106+
-e MYSQL_DATABASE="test_db"
141107
--entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }}
142-
-c "exec docker-entrypoint.sh mysqld${{ matrix.db-version != '5.5' && ' --default-authentication-plugin=mysql_native_password"' || '' }}
108+
-c "exec docker-entrypoint.sh mysqld${{ matrix.db-type == 'mysql' && contains( fromJSON('["7.2", "7.3"]'), matrix.php ) && ' --default-authentication-plugin=mysql_native_password' || '' }}"
143109
144110
steps:
145111
- name: Set up PHP ${{ matrix.php }}
@@ -149,10 +115,6 @@ jobs:
149115
coverage: none
150116
tools: wp-cli${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && ':2.4.0' || '' }}
151117

152-
- name: Start the database server
153-
run: |
154-
sudo systemctl start ${{ matrix.db-type }}
155-
156118
- name: Download WordPress
157119
run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }}
158120

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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+
# The MySQL 5.5 containers will not start.
92+
- db-version: '5.5'
93+
# MySQL 9.0+ will not work on PHP 7.2 & 7.3
94+
- php: '7.2'
95+
db-version: '9.0'
96+
- php: '7.3'
97+
db-version: '9.0'
98+
99+
with:
100+
os: ${{ matrix.os }}
101+
php: ${{ matrix.php }}
102+
db-type: 'mysql'
103+
db-version: ${{ matrix.db-version }}
104+
memcached: ${{ matrix.memcached }}
105+
tests-domain: ${{ matrix.tests-domain }}
106+
107+
slack-notifications:
108+
name: Slack Notifications
109+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
110+
permissions:
111+
actions: read
112+
contents: read
113+
needs: [ build-test-matrix, environment-tests-mysql ]
114+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
115+
with:
116+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
117+
secrets:
118+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
119+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
120+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
121+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
122+
123+
failed-workflow:
124+
name: Failed workflow tasks
125+
runs-on: ubuntu-latest
126+
permissions:
127+
actions: write
128+
needs: [ build-test-matrix, environment-tests-mysql, slack-notifications ]
129+
if: |
130+
always() &&
131+
github.repository == 'WordPress/wordpress-develop' &&
132+
github.event_name != 'pull_request' &&
133+
github.run_attempt < 2 &&
134+
(
135+
contains( needs.*.result, 'cancelled' ) ||
136+
contains( needs.*.result, 'failure' )
137+
)
138+
139+
steps:
140+
- name: Dispatch workflow run
141+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
142+
with:
143+
retries: 2
144+
retry-exempt-status-codes: 418
145+
script: |
146+
github.rest.actions.createWorkflowDispatch({
147+
owner: context.repo.owner,
148+
repo: context.repo.repo,
149+
workflow_id: 'failed-workflow.yml',
150+
ref: 'trunk',
151+
inputs: {
152+
run_id: '${{ github.run_id }}'
153+
}
154+
});

.github/workflows/phpunit-tests.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,50 +47,58 @@ jobs:
4747
os: [ ubuntu-latest ]
4848
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
4949
db-type: [ 'mysql' ]
50-
db-version: [ '5.7', '8.0', '8.1', '8.2', '8.3' ]
50+
db-version: [ '5.7', '8.0', '8.4', '9.0' ]
5151
tests-domain: [ 'example.org' ]
5252
multisite: [ false, true ]
5353
memcached: [ false ]
5454

5555
include:
56-
# Include jobs for PHP 7.4 with memcached.
56+
# Include jobs that test with memcached.
5757
- os: ubuntu-latest
58-
php: '7.4'
58+
php: '8.3'
5959
db-type: 'mysql'
60-
db-version: '5.7'
60+
db-version: '8.4'
6161
tests-domain: 'example.org'
6262
multisite: false
6363
memcached: true
6464
- os: ubuntu-latest
65-
php: '7.4'
65+
php: '8.3'
6666
db-type: 'mysql'
67-
db-version: '5.7'
67+
db-version: '8.4'
6868
tests-domain: 'example.org'
6969
multisite: true
7070
memcached: true
7171
# Include jobs with a port on the test domain for both single and multisite.
7272
- os: ubuntu-latest
73-
php: '7.4'
73+
php: '8.4'
7474
db-type: 'mysql'
75-
db-version: '5.7'
75+
db-version: '8.4'
7676
tests-domain: 'example.org:8889'
7777
multisite: false
7878
memcached: false
7979
- os: ubuntu-latest
80-
php: '7.4'
80+
php: '8.4'
8181
db-type: 'mysql'
82-
db-version: '5.7'
82+
db-version: '8.4'
8383
tests-domain: 'example.org:8889'
8484
multisite: true
8585
memcached: false
8686
# Report test results to the Host Test Results.
8787
- os: ubuntu-latest
8888
db-type: 'mysql'
89-
db-version: '8.0'
89+
db-version: '8.4'
9090
tests-domain: 'example.org'
9191
multisite: false
9292
memcached: false
9393
report: true
94+
95+
exclude:
96+
# MySQL 9.0+ will not work on PHP 7.2 & 7.3
97+
- php: '7.2'
98+
db-version: '9.0'
99+
- php: '7.3'
100+
db-version: '9.0'
101+
94102
with:
95103
os: ${{ matrix.os }}
96104
php: ${{ matrix.php }}
@@ -123,15 +131,15 @@ jobs:
123131
memcached: [ false ]
124132

125133
include:
126-
# Include jobs for PHP 7.4 with memcached.
134+
# Include jobs that test with memcached.
127135
- os: ubuntu-latest
128-
php: '7.4'
136+
php: '8.3'
129137
db-type: 'mariadb'
130138
db-version: '11.2'
131139
multisite: false
132140
memcached: true
133141
- os: ubuntu-latest
134-
php: '7.4'
142+
php: '8.3'
135143
db-type: 'mariadb'
136144
db-version: '11.2'
137145
multisite: true

0 commit comments

Comments
 (0)