Skip to content

Commit

Permalink
Merge branch 'trunk' into 21022-bcrypt-algo-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Jan 6, 2025
2 parents 754519b + d6aa043 commit 35d1885
Show file tree
Hide file tree
Showing 85 changed files with 6,259 additions and 4,449 deletions.
2 changes: 1 addition & 1 deletion .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
4 changes: 4 additions & 0 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ jobs:

# 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'
# 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.0'
- php: '7.3'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/local-docker-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ jobs:
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}

exclude:
# The MySQL 5.5 containers will not start.
# MySQL containers <= 5.5 do not exist or fail to start properly.
- db-version: '5.5'
# MySQL 9.0+ will not work on PHP 7.2 & 7.3
# 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.0'
- php: '7.3'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ permissions: {}
jobs:
# Runs the performance test suite.
performance:
name: Performance tests ${{ matrix.memcached && '(with memcached)' || '' }}
name: ${{ matrix.multisite && 'Multisite' || 'Single site' }}
uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk
permissions:
contents: read
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
strategy:
fail-fast: false
matrix:
memcached: [ true, false ]
multisite: [ true, false ]
with:
memcached: ${{ matrix.memcached }}
multisite: ${{ matrix.multisite }}
secrets:
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}

Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
report: true

exclude:
# MySQL 9.0+ will not work on PHP 7.2 & 7.3
# 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.0'
- php: '7.3'
Expand Down Expand Up @@ -154,13 +154,36 @@ jobs:
phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
report: ${{ matrix.report || false }}

#
# Runs specific individual test groups.
#
specific-test-groups:
name: ${{ matrix.phpunit-test-groups }}
uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v3.yml@trunk
permissions:
contents: read
secrets: inherit
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
php: [ '7.2', '7.4', '8.0', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '8.4' ]
phpunit-test-groups: [ 'html-api-html5lib-tests' ]
with:
php: ${{ matrix.php }}
db-type: ${{ matrix.db-type }}
db-version: ${{ matrix.db-version }}
phpunit-test-groups: ${{ matrix.phpunit-test-groups }}

slack-notifications:
name: Slack Notifications
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
permissions:
actions: read
contents: read
needs: [ test-with-mysql, test-with-mariadb ]
needs: [ test-with-mysql, test-with-mariadb, specific-test-groups ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##
# A reusable workflow that runs the performance test suite.
##
name: Performance Tests
name: Run performance Tests

on:
workflow_call:
Expand All @@ -15,7 +15,7 @@ on:
description: 'The version being used for baseline measurements.'
required: false
type: 'string'
default: '6.1.1'
default: '6.7.0'
php-version:
description: 'The PHP version to use.'
required: false
Expand All @@ -26,6 +26,11 @@ on:
required: false
type: 'boolean'
default: false
multisite:
description: 'Whether to use Multisite.'
required: false
type: 'boolean'
default: false
secrets:
CODEVITALS_PROJECT_TOKEN:
description: 'The authorization token for https://www.codevitals.run/project/wordpress.'
Expand Down Expand Up @@ -53,6 +58,7 @@ env:

LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }}
LOCAL_MULTISITE: ${{ inputs.multisite }}

jobs:
# Performs the following steps:
Expand All @@ -65,9 +71,11 @@ jobs:
# - Install Playwright browsers.
# - Build WordPress.
# - Start Docker environment.
# - Install object cache drop-in.
# - Log running Docker containers.
# - Docker debug information.
# - Install WordPress.
# - Enable themes on Multisite.
# - Install WordPress Importer plugin.
# - Import mock data.
# - Deactivate WordPress Importer plugin.
Expand Down Expand Up @@ -98,11 +106,11 @@ jobs:
# - Publish performance results.
# - Ensure version-controlled files are not modified or deleted.
performance:
name: Run tests
name: ${{ inputs.multisite && 'Multisite' || 'Single site' }} / ${{ inputs.memcached && 'Memcached' || 'Default' }}
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
if: ${{ ! contains( github.event.before, '00000000' ) }}

steps:
- name: Configure environment variables
Expand Down Expand Up @@ -166,6 +174,14 @@ jobs:
- name: Install WordPress
run: npm run env:install

- name: Enable themes on Multisite
if: ${{ inputs.multisite }}
run: |
npm run env:cli -- theme enable twentytwentyone --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentythree --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentyfour --network --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- theme enable twentytwentyfive --network --path=/var/www/${{ env.LOCAL_DIR }}
- name: Install WordPress Importer plugin
run: npm run env:cli -- plugin install wordpress-importer --activate --path=/var/www/${{ env.LOCAL_DIR }}

Expand Down Expand Up @@ -263,7 +279,9 @@ jobs:
- name: Set the environment to the baseline version
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }}
run: |
npm run env:cli -- core update --version=${{ env.BASE_TAG }} --force --path=/var/www/${{ env.LOCAL_DIR }}
VERSION="${{ env.BASE_TAG }}"
VERSION="${VERSION%.0}"
npm run env:cli -- core update --version=$VERSION --force --path=/var/www/${{ env.LOCAL_DIR }}
npm run env:cli -- core version --path=/var/www/${{ env.LOCAL_DIR }}
- name: Run any database upgrades
Expand All @@ -288,7 +306,7 @@ jobs:
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: performance-artifacts${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
name: performance-artifacts${{ inputs.multisite && '-multisite' || '' }}${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
path: artifacts
if-no-files-found: ignore
include-hidden-files: true
Expand All @@ -301,7 +319,7 @@ jobs:

- name: Set the base sha
# Only needed when publishing results.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: base-sha
with:
Expand All @@ -312,7 +330,7 @@ jobs:
- name: Set commit details
# Only needed when publishing results.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: commit-timestamp
with:
Expand All @@ -323,7 +341,7 @@ jobs:
- name: Publish performance results
# Only publish results on pushes to trunk.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
env:
BASE_SHA: ${{ steps.base-sha.outputs.result }}
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/reusable-phpunit-tests-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ jobs:
node --version
curl --version
git --version
svn --version
- name: Log running Docker containers
run: docker ps -a
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
description: 'Database version'
required: false
type: 'string'
default: '8.0'
default: '8.4'
multisite:
description: 'Whether to run tests as multisite'
required: false
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
# - Checks out the WordPress Test reporter repository.
# - Submit the test results to the WordPress.org host test results.
phpunit-tests:
name: PHP ${{ inputs.php }} ${{ ! inputs.coverage-report && '/ ' || 'with ' }}${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.phpunit-test-groups && format( ' ({0})', inputs.phpunit-test-groups ) || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
name: ${{ inputs.phpunit-test-groups && format( '{0} / ', inputs.phpunit-test-groups ) || '' }}PHP ${{ inputs.php }} ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report && '/ ' || 'with ' }}${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
runs-on: ${{ inputs.os }}
timeout-minutes: ${{ inputs.coverage-report && 120 || 20 }}

Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:

- name: Upload test coverage report to Codecov
if: ${{ inputs.coverage-report }}
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: wp-code-coverage${{ inputs.multisite && '-multisite' || '-single' }}-${{ github.sha }}.xml
Expand All @@ -226,15 +226,15 @@ jobs:
run: git diff --exit-code

- name: Checkout the WordPress Test Reporter
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: 'WordPress/phpunit-test-runner'
path: 'test-runner'
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Submit test results to the WordPress.org host test results
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
if: ${{ github.ref == 'refs/heads/trunk' && inputs.report }}
env:
WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
run: docker compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
3 changes: 0 additions & 3 deletions .github/workflows/reusable-support-json-reader-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
major-wp-version:
name: Determine major WordPress version
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
timeout-minutes: 5
outputs:
version: ${{ steps.major-wp-version.outputs.version }}
Expand Down Expand Up @@ -69,7 +68,6 @@ jobs:
php-versions:
name: Determine PHP versions
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
needs: [ major-wp-version ]
timeout-minutes: 5
outputs:
Expand Down Expand Up @@ -102,7 +100,6 @@ jobs:
mysql-versions:
name: Determine MySQL versions
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
needs: [ major-wp-version ]
timeout-minutes: 5
outputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
description: 'Database version'
required: false
type: 'string'
default: '8.0'
default: '8.4'
memcached:
description: 'Whether to enable memcached'
required: false
Expand Down
Loading

0 comments on commit 35d1885

Please sign in to comment.