Skip to content

Commit c3429e3

Browse files
committed
Update the image handling for the install testing and local Docker environment testing.
1 parent 569ea71 commit c3429e3

File tree

3 files changed

+54
-60
lines changed

3 files changed

+54
-60
lines changed

.github/workflows/install-testing.yml

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
# - Downloads the specified version of WordPress.
5959
# - Creates a `wp-config.php` file.
6060
# - Installs WordPress.
61-
install-tests-mysql:
62-
name: WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
61+
install-tests:
62+
name: WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ matrix.db-image }}${{ matrix.multisite && ' multisite' || '' }}
6363
permissions:
6464
contents: read
6565
runs-on: ${{ matrix.os }}
@@ -71,39 +71,32 @@ jobs:
7171
matrix:
7272
os: [ ubuntu-24.04 ]
7373
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }}
74-
db-type: [ 'mysql' ]
75-
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}
74+
db-image: ${{ fromJSON( needs.build-test-matrix.outputs.db-images ) }}
7675
multisite: [ false, true ]
7776
memcached: [ false ]
7877

79-
# Exclude some PHP and MySQL versions that cannot currently be tested with Docker containers.
78+
# Exclude some PHP and database versions that cannot currently be tested with Docker containers.
8079
exclude:
8180
# There are no local WordPress Docker environment containers for PHP <= 5.3.
8281
- php: '5.2'
8382
- php: '5.3'
84-
# MySQL containers <= 5.5 do not exist or fail to start properly.
85-
- db-version: '5.0'
86-
- db-version: '5.1'
87-
- 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.
89-
- php: '7.2'
90-
db-version: '8.4'
91-
- php: '7.3'
92-
db-version: '8.4'
93-
# Only test the latest innovation release.
94-
- db-version: '9.0'
95-
- db-version: '9.1'
96-
- db-version: '9.2'
97-
- db-version: '9.3'
98-
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
99-
- php: '7.2'
100-
db-version: '9.4'
101-
- php: '7.3'
102-
db-version: '9.4'
83+
# Containers <= 5.5 do not exist or fail to start properly.
84+
- db-image: 'mariadb:5.0'
85+
- db-image: 'mysql:5.0'
86+
- db-image: 'mariadb:5.1'
87+
- db-image: 'mysql:5.1'
88+
- db-image: 'mariadb:5.5'
89+
- db-image: 'mysql:5.5'
90+
# Only test the latest MySQL innovation release (9.5).
91+
- db-image: 'mysql:9.0'
92+
- db-image: 'mysql:9.1'
93+
- db-image: 'mysql:9.2'
94+
- db-image: 'mysql:9.3'
95+
- db-image: 'mysql:9.4'
10396

10497
services:
10598
database:
106-
image: ${{ matrix.db-type }}:${{ matrix.db-version }}
99+
image: ${{ matrix.db-image }}
107100
ports:
108101
- 3306
109102
options: >-
@@ -113,8 +106,6 @@ jobs:
113106
--health-retries="5"
114107
-e MYSQL_ROOT_PASSWORD="root"
115108
-e MYSQL_DATABASE="test_db"
116-
--entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }}
117-
-c "exec docker-entrypoint.sh mysqld${{ matrix.db-type == 'mysql' && contains( fromJSON('["7.2", "7.3"]'), matrix.php ) && ' --default-authentication-plugin=mysql_native_password' || '' }}"
118109
119110
steps:
120111
- name: Set up PHP ${{ matrix.php }}
@@ -143,7 +134,7 @@ jobs:
143134
permissions:
144135
actions: read
145136
contents: read
146-
needs: [ install-tests-mysql ]
137+
needs: [ install-tests ]
147138
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
148139
with:
149140
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
wp-version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
8383

8484
# Tests the local Docker environment.
85-
environment-tests-mysql:
85+
environment-tests:
8686
name: PHP ${{ matrix.php }}
8787
uses: ./.github/workflows/reusable-test-local-docker-environment-v1.yml
8888
permissions:
@@ -94,30 +94,33 @@ jobs:
9494
os: [ ubuntu-24.04 ]
9595
memcached: [ false, true ]
9696
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }}
97-
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}
97+
db-image: ${{ fromJSON( needs.build-test-matrix.outputs.db-images ) }}
9898

9999
exclude:
100-
# MySQL containers <= 5.5 do not exist or fail to start properly.
101-
- db-version: '5.5'
102-
# Only test the latest innovation release.
103-
- db-version: '9.0'
104-
- db-version: '9.1'
105-
- db-version: '9.2'
106-
- db-version: '9.3'
107-
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
108-
- php: '7.2'
109-
db-version: '9.4'
110-
- php: '7.3'
111-
db-version: '9.4'
100+
# There are no local WordPress Docker environment containers for PHP <= 5.3.
101+
- php: '5.2'
102+
- php: '5.3'
103+
# Containers <= 5.5 do not exist or fail to start properly.
104+
- db-image: 'mariadb:5.0'
105+
- db-image: 'mysql:5.0'
106+
- db-image: 'mariadb:5.1'
107+
- db-image: 'mysql:5.1'
108+
- db-image: 'mariadb:5.5'
109+
- db-image: 'mysql:5.5'
110+
# Only test the latest MySQL innovation release (9.5).
111+
- db-image: 'mysql:9.0'
112+
- db-image: 'mysql:9.1'
113+
- db-image: 'mysql:9.2'
114+
- db-image: 'mysql:9.3'
115+
- db-image: 'mysql:9.4'
112116
# No PHP 8.5 + Memcached support yet.
113117
- php: '8.5'
114118
memcached: true
115119

116120
with:
117121
os: ${{ matrix.os }}
118122
php: ${{ matrix.php }}
119-
db-type: 'mysql'
120-
db-version: ${{ matrix.db-version }}
123+
db-image: ${{ matrix.db-image }}
121124
memcached: ${{ matrix.memcached }}
122125

123126
slack-notifications:
@@ -126,7 +129,7 @@ jobs:
126129
permissions:
127130
actions: read
128131
contents: read
129-
needs: [ build-test-matrix, environment-tests-mysql ]
132+
needs: [ build-test-matrix, environment-tests ]
130133
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
131134
with:
132135
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
@@ -141,7 +144,7 @@ jobs:
141144
runs-on: ubuntu-24.04
142145
permissions:
143146
actions: write
144-
needs: [ build-test-matrix, environment-tests-mysql, slack-notifications ]
147+
needs: [ build-test-matrix, environment-tests, slack-notifications ]
145148
if: |
146149
always() &&
147150
github.repository == 'WordPress/wordpress-develop' &&

.github/workflows/reusable-support-json-reader-v1.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ on:
2222
php-versions:
2323
description: "The PHP versions to test for the given wp-version"
2424
value: ${{ jobs.php-versions.outputs.versions }}
25-
mysql-versions:
25+
db-images:
2626
description: "The MySQL versions to test for the given wp-version"
27-
value: ${{ jobs.mysql-versions.outputs.versions }}
27+
value: ${{ jobs.db-images.outputs.versions }}
2828

2929
# Disable permissions for all available scopes by default.
3030
# Any needed permissions should be configured at the job level.
@@ -111,21 +111,21 @@ jobs:
111111
env:
112112
WP_VERSION: ${{ needs.major-wp-version.outputs.version }}
113113

114-
# Determines the versions of MySQL supported for a version of WordPress.
114+
# Determines the names of database images for MariaDB and MySQL that are supported for a version of WordPress.
115115
#
116116
# Performs the following steps:
117117
# - Checks out the repository
118-
# - Returns the versions of MySQL supported for the major version of WordPress by parsing the
119-
# .version-support-mysql.json file and returning the values in that version's index.
120-
mysql-versions:
121-
name: Determine MySQL versions
118+
# - Returns the database image names of MariaDB and MySQL supported for the major version of WordPress by parsing the
119+
# .version-support-mysql.json file and returning the values in that version's index as image names.
120+
db-images:
121+
name: Determine database images
122122
permissions:
123123
contents: read
124124
runs-on: ubuntu-24.04
125125
needs: [ major-wp-version ]
126126
timeout-minutes: 5
127127
outputs:
128-
versions: ${{ steps.mysql-versions.outputs.versions }}
128+
versions: ${{ steps.db-images.outputs.versions }}
129129

130130
steps:
131131
- name: Checkout repository
@@ -135,10 +135,10 @@ jobs:
135135
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
136136
persist-credentials: false
137137

138-
# Look up the major version's specific MySQL support policy when a version is provided.
139-
# Otherwise, use the current MySQL support policy.
140-
- name: Get supported MySQL versions
141-
id: mysql-versions
138+
# Look up the major version's specific MariaDB and MySQL support policy when a version is provided.
139+
# Otherwise, use the current MariaDB and MySQL support policy.
140+
- name: Get supported database images
141+
id: db-images
142142
run: |
143143
if [ "${WP_VERSION}" != "latest" ] && [ "${WP_VERSION}" != "nightly" ]; then
144144
VERSIONS="$( jq \
@@ -151,7 +151,7 @@ jobs:
151151
end | @json' \
152152
.version-support-mysql.json
153153
)"
154-
echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT"
154+
echo "images=$VERSIONS" >> "$GITHUB_OUTPUT"
155155
else
156156
VERSIONS="$( jq \
157157
-r \
@@ -162,7 +162,7 @@ jobs:
162162
end | @json' \
163163
.version-support-mysql.json
164164
)"
165-
echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT"
165+
echo "images=$VERSIONS" >> "$GITHUB_OUTPUT"
166166
fi
167167
env:
168168
WP_VERSION: ${{ needs.major-wp-version.outputs.version }}

0 commit comments

Comments
 (0)