Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/trunk' into add/mysql-8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
desrosj committed Oct 22, 2024
2 parents d092765 + 5b3f0bc commit dd5533f
Show file tree
Hide file tree
Showing 977 changed files with 56,044 additions and 52,396 deletions.
File renamed without changes.
5 changes: 3 additions & 2 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 Down
2 changes: 2 additions & 0 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
build-matrix:
name: Determine PHP Versions to test
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
timeout-minutes: 5
outputs:
major-wp-version: ${{ steps.major-wp-version.outputs.version }}
Expand Down Expand Up @@ -104,6 +105,7 @@ 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 ]
strategy:
Expand Down
5 changes: 3 additions & 2 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 Down
2 changes: 2 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
memcached: [ true, false ]
with:
memcached: ${{ matrix.memcached }}
secrets:
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}

slack-notifications:
name: Slack Notifications
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ on:
- 'composer.*'
# This file configures PHP compatibility scanning. Changes could affect the outcome.
- 'phpcompat.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/php-compatibility.yml'
- '.github/workflows/reusable-php-compatibility.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4' ]
tests-domain: [ 'example.org' ]
Expand Down Expand Up @@ -85,9 +85,8 @@ jobs:
memcached: false
# Report test results to the Host Test Results.
- os: ubuntu-latest
php: '7.4'
db-type: 'mysql'
db-version: '5.7'
db-version: '8.0'
tests-domain: 'example.org'
multisite: false
memcached: false
Expand Down Expand Up @@ -117,7 +116,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mariadb' ]
db-version: [ '10.4', '10.6', '10.11', '11.2' ]
multisite: [ false, true ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/props-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
# You cannot filter this event for PR comments only.
# However, the logic below does short-circuit the workflow for issues.
issue_comment:
type:
types:
- created
# This event will run everytime a new PR review is initially submitted.
pull_request_review:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/pull-request-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pull Request Comments

on:
pull_request_target:
types: [ 'opened' ]
types: [ 'opened', 'synchronize', 'reopened', 'edited' ]
workflow_run:
workflows: [ 'Test Build Processes' ]
types:
Expand Down Expand Up @@ -164,16 +164,16 @@ jobs:
github.rest.issues.createComment( commentInfo );
# Leaves a comment on a pull request when no Trac ticket is included in the pull request description.
# Manages comments reminding contributors to include a Trac ticket link when opening a pull request.
trac-ticket-check:
name: Comment on a pull request when no Trac ticket is included
name: Manage Trac ticket reminders for pull requests
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' && ! github.event.pull_request.draft && github.event.pull_request.state == 'open' }}
steps:
- name: Check for Trac ticket and comment if missing
- name: Check for Trac ticket and manage comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand All @@ -183,19 +183,21 @@ jobs:
// Check for the presence of a comment and bail early.
const comments = ( await github.rest.issues.listComments( { owner, repo, issue_number: number } ) ).data;
const hasMissingTicketComment = comments.some( comment =>
comment.user.type === 'Bot' && comment.body.includes( 'Trac Ticket Missing' )
);
const hasMissingTicketComment = comments.find( comment => comment.user.type === 'Bot' && comment.body.includes( 'Trac Ticket Missing' ) );
if ( hasMissingTicketComment ) return;
if ( hasMissingTicketComment ) {
// Trac ticket link found, delete existing "Trac Ticket Missing" comment.
await github.rest.issues.deleteComment( { owner, repo, comment_id: hasMissingTicketComment.id } );
return;
}
// No comment was found. Create one.
const pr = ( await github.rest.pulls.get( { owner, repo, pull_number: number } ) ).data;
const prBody = pr.body ?? '';
const prTitle = pr.title ?? '';
const tracTicketRegex = new RegExp( 'https?://core.trac.wordpress.org/ticket/([0-9]+)', 'g' );
const tracTicketRegex = new RegExp( '(https?://core.trac.wordpress.org/ticket/|Core-|ticket:)([0-9]+)', 'g' );
const tracTicketMatches = prBody.match( tracTicketRegex ) || prTitle.match( tracTicketRegex );
if ( ! tracTicketMatches ) {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-coding-standards-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-coding-standards-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHPCS scan cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: |
.cache/phpcs-src.json
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/reusable-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
required: false
type: 'boolean'
default: true
gutenberg-version:
description: 'A specific version of Gutenberg to install.'
required: false
type: 'string'

env:
LOCAL_DIR: build
Expand Down Expand Up @@ -68,7 +72,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down Expand Up @@ -113,7 +117,7 @@ jobs:

- name: Install Gutenberg
if: ${{ inputs.install-gutenberg }}
run: npm run env:cli -- plugin install gutenberg --path=/var/www/${{ env.LOCAL_DIR }}
run: npm run env:cli -- plugin install gutenberg${{ inputs.gutenberg-version && format( ' --version={0}', inputs.gutenberg-version ) || '' }} --path=/var/www/${{ env.LOCAL_DIR }}

- name: Install additional languages
run: |
Expand All @@ -125,12 +129,13 @@ jobs:
run: npm run test:e2e

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: failures-artifacts${{ inputs.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}
path: artifacts
if-no-files-found: ignore
include-hidden-files: true

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/reusable-javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
required: false
type: 'boolean'
default: false
secrets:
CODEVITALS_PROJECT_TOKEN:
description: 'The authorization token for https://www.codevitals.run/project/wordpress.'
required: false

env:
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
Expand Down Expand Up @@ -118,7 +122,7 @@ jobs:
run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> $GITHUB_ENV

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down Expand Up @@ -281,12 +285,13 @@ jobs:
run: npm run test:performance

- name: Archive artifacts
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: performance-artifacts${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
path: artifacts
if-no-files-found: ignore
include-hidden-files: true

- name: Compare results
run: node ./tests/performance/compare-results.js ${{ runner.temp }}/summary.md
Expand Down Expand Up @@ -324,7 +329,12 @@ jobs:
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
HOST_NAME: "www.codevitals.run"
run: node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME
run: |
if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then
echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set" >> $GITHUB_OUTPUT
exit 1
fi
node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME
- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/reusable-php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHP compatibility scan cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: .cache/phpcompat.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-phpunit-tests-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand All @@ -108,7 +108,7 @@ jobs:

- name: Cache Composer dependencies
if: ${{ env.COMPOSER_INSTALL == true }}
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
env:
cache-name: cache-composer-dependencies
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-phpunit-tests-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Install Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand All @@ -111,7 +111,7 @@ jobs:
run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
env:
cache-name: cache-composer-dependencies
with:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ on:
required: false
type: 'string'
default: 'phpunit.xml.dist'
phpunit-test-groups:
description: 'A list of test groups to run.'
required: false
type: 'string'
default: ''
tests-domain:
description: 'The domain to use for the tests'
required: false
Expand Down Expand Up @@ -87,7 +92,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 }} / ${{ '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 || '' }}
name: PHP ${{ inputs.php }} / ${{ '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 || '' }}
runs-on: ${{ inputs.os }}
timeout-minutes: 20

Expand All @@ -103,7 +108,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down Expand Up @@ -162,27 +167,28 @@ jobs:
- name: Install WordPress
run: npm run env:install

- name: Run PHPUnit tests
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}${{ inputs.phpunit-test-groups && format( ' --group {0}', inputs.phpunit-test-groups ) || '' }}

- name: Run AJAX tests
if: ${{ ! inputs.phpunit-test-groups }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax

- name: Run ms-files tests as a multisite install
if: ${{ inputs.multisite }}
if: ${{ inputs.multisite && ! inputs.phpunit-test-groups }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ms-files

- name: Run external HTTP tests
if: ${{ ! inputs.multisite }}
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http

# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
- name: Run (Xdebug) tests
if: ${{ inputs.php != '8.3' }}
if: ${{ inputs.php != '8.4' && ! inputs.phpunit-test-groups }}
continue-on-error: ${{ inputs.allow-errors }}
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__

Expand Down
Loading

0 comments on commit dd5533f

Please sign in to comment.