Skip to content

Commit

Permalink
Merge branch 'trunk' into 56791-coding-standards
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyBiryukov authored Dec 25, 2024
2 parents 669b544 + 27bb7ac commit 9824852
Show file tree
Hide file tree
Showing 67 changed files with 6,077 additions and 4,406 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
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
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:
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
8 changes: 5 additions & 3 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down Expand Up @@ -102,7 +102,7 @@ jobs:
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 @@ -263,7 +263,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 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
36 changes: 16 additions & 20 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,66 +161,62 @@ jobs:
failure:
name: Failure notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ needs.prepare.outputs.previous_conclusion != 'first-failure' && inputs.calling_status == 'failure' || failure() }}

steps:
- name: Post failure notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

# Posts notifications the first time a workflow run succeeds after previously failing.
fixed:
name: Fixed notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ contains( fromJson( '["failure", "cancelled", "none"]' ), needs.prepare.outputs.previous_conclusion ) && inputs.calling_status == 'success' && success() }}

steps:
- name: Post failure notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}

# Posts notifications when a workflow is successful.
success:
name: Success notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ inputs.calling_status == 'success' && success() }}

steps:
- name: Post success notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}

# Posts notifications when a workflow is cancelled.
cancelled:
name: Cancelled notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ inputs.calling_status == 'cancelled' || cancelled() }}

steps:
- name: Post cancelled notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
9 changes: 8 additions & 1 deletion .github/workflows/test-old-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
schedule:
- cron: '0 0 1 * *'
- cron: '0 0 15 * *'
workflow_dispatch:
inputs:
strategy:
description: 'The branches to test. Accepts X.Y branch names, or "all". Defaults to only the currently supported branch.'
required: false
type: string
default: ''

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
Expand Down Expand Up @@ -111,7 +118,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ github.event_name == 'push' || github.event.schedule == '0 0 15 * *' || matrix.branch == env.CURRENTLY_SUPPORTED_BRANCH }}
if: ${{ github.event_name == 'push' || ( github.event_name == 'workflow_dispatch' && matrix.branch == inputs.strategy || inputs.strategy == 'all' ) || github.event.schedule == '0 0 15 * *' || matrix.branch == env.CURRENTLY_SUPPORTED_BRANCH }}
with:
retries: 2
retry-exempt-status-codes: 418
Expand Down
Loading

0 comments on commit 9824852

Please sign in to comment.