Skip to content

Commit

Permalink
Merge branch 'trunk' into fix-remove-logged-in-check-for-cache-control
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Jan 27, 2025
2 parents e876e85 + 1b57f98 commit 2bd23e4
Show file tree
Hide file tree
Showing 1,026 changed files with 65,770 additions and 57,143 deletions.
2 changes: 1 addition & 1 deletion .env → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ LOCAL_DB_TYPE=mysql
# When using `mysql`, see https://hub.docker.com/_/mysql for valid versions.
# When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
##
LOCAL_DB_VERSION=8.0
LOCAL_DB_VERSION=8.4

# Whether or not to enable multisite.
LOCAL_MULTISITE=false
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/cleanup-pull-requests.yml
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
13 changes: 7 additions & 6 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ on:
- '.jshintrc'
# This file configures PHPCS. Changes could affect the outcome.
- 'phpcs.xml.dist'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
# Confirm any changes to relevant workflow files.
- '.github/workflows/coding-standards.yml'
- '.github/workflows/reusable-coding-standards-*.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand All @@ -48,22 +49,22 @@ jobs:
# Runs the PHP coding standards checks.
phpcs:
name: PHP coding standards
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
uses: ./.github/workflows/reusable-coding-standards-php.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

# Runs the JavaScript coding standards checks.
jshint:
name: JavaScript coding standards
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
uses: ./.github/workflows/reusable-coding-standards-javascript.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

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
Expand Down Expand Up @@ -106,6 +107,6 @@ jobs:
workflow_id: 'failed-workflow.yml',
ref: 'trunk',
inputs: {
run_id: '${{ github.run_id }}'
run_id: `${context.runId}`,
}
});
6 changes: 3 additions & 3 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# Runs the end-to-end test suite.
e2e-tests:
name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk
uses: ./.github/workflows/reusable-end-to-end-tests.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
Expand All @@ -51,7 +51,7 @@ jobs:

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
Expand Down Expand Up @@ -93,6 +93,6 @@ jobs:
workflow_id: 'failed-workflow.yml',
ref: 'trunk',
inputs: {
run_id: '${{ github.run_id }}'
run_id: `${context.runId}`,
}
});
6 changes: 4 additions & 2 deletions .github/workflows/failed-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
const workflow_run = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ inputs.run_id }},
run_id: process.env.RUN_ID,
});
// Only rerun after the first run attempt.
Expand All @@ -49,6 +49,8 @@ jobs:
const rerun = await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ inputs.run_id }},
run_id: process.env.RUN_ID,
enable_debug_logging: true
});
env:
RUN_ID: ${{ inputs.run_id }}
122 changes: 48 additions & 74 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -205,6 +179,6 @@ jobs:
workflow_id: 'failed-workflow.yml',
ref: 'trunk',
inputs: {
run_id: '${{ github.run_id }}'
run_id: `${context.runId}`,
}
});
11 changes: 6 additions & 5 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ on:
- '.jshintrc'
# Any change to the QUnit directory should run tests.
- 'tests/qunit/**'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
# Confirm any changes to relevant workflow files.
- '.github/workflows/javascript-tests.yml'
- '.github/workflows/reusable-javascript-tests.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand All @@ -46,14 +47,14 @@ jobs:
# Runs the WordPress Core JavaScript tests.
test-js:
name: QUnit Tests
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
uses: ./.github/workflows/reusable-javascript-tests.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

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
Expand Down Expand Up @@ -96,6 +97,6 @@ jobs:
workflow_id: 'failed-workflow.yml',
ref: 'trunk',
inputs: {
run_id: '${{ github.run_id }}'
run_id: `${context.runId}`,
}
});
Loading

0 comments on commit 2bd23e4

Please sign in to comment.