mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into fix-remove-logged-in-check-for-cache-control
- Loading branch information
Showing
1,026 changed files
with
65,770 additions
and
57,143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Cleanup Pull Requests | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
- '4.[1-9]' | ||
- '[5-9].[0-9]' | ||
|
||
# Cancels all previous workflow runs for pull requests that have not completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name for pull requests | ||
# or the commit hash for any other events. | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
# Disable permissions for all available scopes by default. | ||
# Any needed permissions should be configured at the job level. | ||
permissions: {} | ||
|
||
jobs: | ||
# Runs pull request cleanup. | ||
close-prs: | ||
name: Clean up pull requests | ||
permissions: | ||
pull-requests: write | ||
if: ${{ github.repository == 'WordPress/wordpress-develop' }} | ||
uses: ./.github/workflows/reusable-cleanup-pull-requests.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,14 @@ on: | |
paths: | ||
- '.github/workflows/install-testing.yml' | ||
- '.version-support-*.json' | ||
- '.github/workflows/reusable-support-json-reader-v1.yml' | ||
pull_request: | ||
# Always test the workflow when changes are suggested. | ||
paths: | ||
- '.github/workflows/install-testing.yml' | ||
- '.version-support-*.json' | ||
- '.github/workflows/install-testing.yml' | ||
- '.github/workflows/reusable-support-json-reader-v1.yml' | ||
|
||
schedule: | ||
- cron: '0 0 * * 1' | ||
workflow_dispatch: | ||
|
@@ -37,65 +40,21 @@ concurrency: | |
permissions: {} | ||
|
||
jobs: | ||
# Determines the appropriate values for PHP and database versions based on the WordPress version being tested. | ||
# | ||
# Performs the following steps: | ||
# - Checks out the repository. | ||
# - Fetches the versions of PHP to test. | ||
# - Fetches the versions of MySQL to test. | ||
build-matrix: | ||
name: Determine PHP Versions to test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
outputs: | ||
major-wp-version: ${{ steps.major-wp-version.outputs.version }} | ||
php-versions: ${{ steps.php-versions.outputs.versions }} | ||
mysql-versions: ${{ steps.mysql-versions.outputs.versions }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
with: | ||
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} | ||
|
||
- name: Determine the major WordPress version | ||
id: major-wp-version | ||
run: | | ||
if [ "${{ inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ]; then | ||
echo "version=$(echo "${{ inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT | ||
elif [ "${{ inputs.wp-version }}" ]; then | ||
echo "version=$(echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT | ||
else | ||
echo "version=nightly" >> $GITHUB_OUTPUT | ||
fi | ||
# Look up the major version's specific PHP support policy when a version is provided. | ||
# Otherwise, use the current PHP support policy. | ||
- name: Get supported PHP versions | ||
id: php-versions | ||
run: | | ||
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then | ||
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT | ||
else | ||
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT | ||
fi | ||
# Look up the major version's specific MySQL support policy when a version is provided. | ||
# Otherwise, use the current MySQL support policy. | ||
- name: Get supported MySQL versions | ||
id: mysql-versions | ||
run: | | ||
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then | ||
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT | ||
else | ||
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT | ||
fi | ||
# Determines the supported values for PHP and database versions based on the WordPress version being tested. | ||
build-test-matrix: | ||
name: Build Test Matrix | ||
uses: ./.github/workflows/reusable-support-json-reader-v1.yml | ||
permissions: | ||
contents: read | ||
secrets: inherit | ||
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} | ||
with: | ||
wp-version: ${{ inputs.wp-version }} | ||
|
||
# Test the WordPress installation process through WP-CLI. | ||
# | ||
# Performs the following steps: | ||
# - Sets up PHP. | ||
# - Starts the database server. | ||
# - Downloads the specified version of WordPress. | ||
# - Creates a `wp-config.php` file. | ||
# - Installs WordPress. | ||
|
@@ -104,25 +63,40 @@ jobs: | |
permissions: | ||
contents: read | ||
runs-on: ${{ matrix.os }} | ||
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} | ||
timeout-minutes: 10 | ||
needs: [ build-matrix ] | ||
needs: [ build-test-matrix ] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }} | ||
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }} | ||
db-type: [ 'mysql' ] | ||
db-version: ${{ fromJSON( needs.build-matrix.outputs.mysql-versions ) }} | ||
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }} | ||
multisite: [ false, true ] | ||
memcached: [ false ] | ||
|
||
# Exclude some PHP and MySQL versions that cannot currently be tested with Docker containers. | ||
exclude: | ||
# There are no local WordPress Docker environment containers for PHP <= 5.3. | ||
- php: '5.2' | ||
- php: '5.3' | ||
# MySQL containers <= 5.5 do not exist or fail to start properly. | ||
- db-version: '5.0' | ||
- db-version: '5.1' | ||
- db-version: '5.5' | ||
# 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. | ||
- php: '7.2' | ||
db-version: '8.4' | ||
- php: '7.3' | ||
db-version: '8.4' | ||
# Only test the latest innovation release. | ||
- db-version: '9.0' | ||
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218. | ||
- php: '7.2' | ||
db-version: '9.1' | ||
- php: '7.3' | ||
db-version: '9.1' | ||
|
||
services: | ||
database: | ||
|
@@ -131,38 +105,38 @@ jobs: | |
- 3306 | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=30s | ||
--health-timeout=10s | ||
--health-retries=5 | ||
-e MYSQL_ROOT_PASSWORD=root | ||
-e MYSQL_DATABASE=test_db | ||
--health-interval="30s" | ||
--health-timeout="10s" | ||
--health-retries="5" | ||
-e MYSQL_ROOT_PASSWORD="root" | ||
-e MYSQL_DATABASE="test_db" | ||
--entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }} | ||
-c "exec docker-entrypoint.sh mysqld${{ matrix.db-version != '5.5' && ' --default-authentication-plugin=mysql_native_password"' || '' }} | ||
-c "exec docker-entrypoint.sh mysqld${{ matrix.db-type == 'mysql' && contains( fromJSON('["7.2", "7.3"]'), matrix.php ) && ' --default-authentication-plugin=mysql_native_password' || '' }}" | ||
steps: | ||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 | ||
with: | ||
php-version: '${{ matrix.php }}' | ||
coverage: none | ||
tools: wp-cli${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && ':2.4.0' || '' }} | ||
|
||
- name: Start the database server | ||
run: | | ||
sudo systemctl start ${{ matrix.db-type }} | ||
tools: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && 'wp-cli:2.4.0' || 'wp-cli' }} | ||
|
||
- name: Download WordPress | ||
run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }} | ||
run: wp core download --version="${WP_VERSION}" | ||
env: | ||
WP_VERSION: ${{ inputs.wp-version || 'nightly' }} | ||
|
||
- name: Create wp-config.php file | ||
run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost=127.0.0.1:${{ job.services.database.ports['3306'] }} | ||
run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost="127.0.0.1:${DB_PORT}" | ||
env: | ||
DB_PORT: ${{ job.services.database.ports['3306'] }} | ||
|
||
- name: Install WordPress | ||
run: wp core ${{ matrix.multisite && 'multisite-' || '' }}install --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password [email protected] --skip-email | ||
run: wp core ${{ matrix.multisite && 'multisite-install' || 'install' }} --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password [email protected] --skip-email | ||
|
||
slack-notifications: | ||
name: Slack Notifications | ||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk | ||
uses: ./.github/workflows/slack-notifications.yml | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
@@ -205,6 +179,6 @@ jobs: | |
workflow_id: 'failed-workflow.yml', | ||
ref: 'trunk', | ||
inputs: { | ||
run_id: '${{ github.run_id }}' | ||
run_id: `${context.runId}`, | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.