Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakrohillas authored Nov 19, 2024
2 parents 7176f6f + 11e4c7c commit 77f77e0
Show file tree
Hide file tree
Showing 202 changed files with 2,269 additions and 1,252 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ jobs:
#
# 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 Down Expand Up @@ -157,10 +156,6 @@ jobs:
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 }}
- name: Download WordPress
run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }}

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pull-request-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' }}
steps:
- name: Post a welcome comment
uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0
uses: wow-actions/welcome@68019c2c271561f63162fea75bb7707ef8a02c85 # v1.3.1
with:
FIRST_PR_REACTIONS: 'hooray'
FIRST_PR_COMMENT: >
Expand Down Expand Up @@ -123,6 +123,7 @@ jobs:

- name: Leave a comment about testing with Playground
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ github.actor != 'dependabot' }}
with:
script: |
const fs = require( 'fs' );
Expand Down Expand Up @@ -171,7 +172,7 @@ jobs:
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' }}
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' && ! github.event.pull_request.draft && github.event.pull_request.state == 'open' && github.actor != 'dependabot' }}
steps:
- name: Check for Trac ticket and manage comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
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@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.cache/phpcs-src.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
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@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> $GITHUB_ENV

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
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@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
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@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
env:
cache-name: cache-composer-dependencies
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/reusable-upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
#
# 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 @@ -68,7 +67,6 @@ jobs:
--entrypoint sh ${{ inputs.db-type }}:${{ inputs.db-version }}
-c "exec docker-entrypoint.sh mysqld${{ inputs.db-type == 'mysql' && contains( fromJSON('["7.2", "7.3"]'), inputs.php ) && ' --default-authentication-plugin=mysql_native_password' || '' }}"
steps:
- name: Set up PHP ${{ inputs.php }}
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
Expand All @@ -77,10 +75,6 @@ jobs:
coverage: none
tools: wp-cli

- name: Start the database server
run: |
sudo systemctl start ${{ inputs.db-type }}
- name: Download WordPress ${{ inputs.wp }}
run: wp core download --version=${{ inputs.wp }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-and-zip-default-themes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- trunk
paths:
- '.github/workflows/test-coverage.yml'
- '.github/workflows/reusable-phpunit-tests-v3.yml'
- 'docker-compose.yml'
- 'phpunit.xml.dist'
- 'tests/phpunit/multisite.xml'
Expand All @@ -15,6 +16,7 @@ on:
- trunk
paths:
- '.github/workflows/test-coverage.yml'
- '.github/workflows/reusable-phpunit-tests-v3.yml'
- 'docker-compose.yml'
- 'phpunit.xml.dist'
- 'tests/phpunit/multisite.xml'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
# Always test the workflow after it's updated.
paths:
- '.github/workflows/upgrade-testing.yml'
- '.github/workflows/upgrade-testing-run.yml'
- '.github/workflows/reusable-upgrade-testing.yml'
pull_request:
# Always test the workflow when changes are suggested.
paths:
- '.github/workflows/upgrade-testing.yml'
- '.github/workflows/upgrade-testing-run.yml'
- '.github/workflows/reusable-upgrade-testing.yml'
workflow_dispatch:
inputs:
new-version:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
php: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4' ]
wp: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7-RC1' ]
wp: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7' ]
multisite: [ false, true ]

with:
Expand All @@ -72,7 +72,7 @@ jobs:
php: [ '7.2', '7.3', '7.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4' ]
wp: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7-RC1' ]
wp: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7' ]
multisite: [ false, true ]

exclude:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ wp-tests-config.php
/packagehash.txt
/artifacts
/setup.log
/coverage

# Files and folders that get created in wp-content
/src/wp-content/blogs.dir
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ npm run test:php -- --filter <test name>
npm run test:php -- --group <group name or ticket number>
```

#### Generating a code coverage report
PHP code coverage reports are [generated daily](https://github.com/WordPress/wordpress-develop/actions/workflows/test-coverage.yml) and [submitted to Codecov.io](https://app.codecov.io/gh/WordPress/wordpress-develop).

After the local Docker environment has [been installed and started](#to-start-the-development-environment-for-the-first-time), the following command can be used to generate a code coverage report.

```
npm run test:coverage
```

The command will generate three coverage reports in HTML, PHP, and text formats, saving them in the `coverage` folder.

**Note:** xDebug is required to generate a code coverage report, which can slow down PHPUnit significantly. Passing selection-based options such as `--group` or `--filter` can decrease the overall time required but will result in an incomplete report.

#### To restart the development environment

You may want to restart the environment if you've made changes to the configuration in the `docker-compose.yml` or `.env` files. Restart the environment with:
Expand Down Expand Up @@ -126,11 +139,11 @@ The development environment can be reset. This will destroy the database and att
npm run env:reset
```

### Apple Silicone machines and old MySQL versions
### Apple Silicon machines and old MySQL versions

The MySQL Docker images do not support Apple Silicone processors (M1, M2, etc.) for MySQL versions 5.7 and earlier.
The MySQL Docker images do not support Apple Silicon processors (M1, M2, etc.) for MySQL versions 5.7 and earlier.

When using MySQL <= 5.7 on an Apple Silicone machine, you must create a `docker-compose.override.yml` file with the following contents:
When using MySQL <= 5.7 on an Apple Silicon machine, you must create a `docker-compose.override.yml` file with the following contents:

```
services:
Expand Down
Loading

0 comments on commit 77f77e0

Please sign in to comment.