Skip to content

Commit

Permalink
Merge branch 'trunk' into experiment/tt1-interactivity-api
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Mar 8, 2024
2 parents 3b84e7d + ac2ba69 commit 3e603d7
Show file tree
Hide file tree
Showing 966 changed files with 62,604 additions and 19,064 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"username": "wordpress"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "16"
"version": "20"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand Down
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ LOCAL_DB_TYPE=mysql
##
# The database version to use.
#
# Defaults to 5.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
# Defaults to 8.0 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
#
# When using `mysql`, see https://hub.docker.com/r/amd64/mysql for valid versions.
# When using `mariadb`, see https://hub.docker.com/r/amd64/mariadb for valid versions.
# 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=5.7
LOCAL_DB_VERSION=8.0

# The debug settings to add to `wp-config.php`.
LOCAL_WP_DEBUG=true
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/callable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm

- name: Log debug information
Expand All @@ -57,11 +58,15 @@ jobs:
node --version
curl --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci

- name: Run Emoji precommit task
run: npm run grunt precommit:emoji
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build WordPress to run from ${{ inputs.directory }}
run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}

Expand All @@ -79,7 +84,7 @@ jobs:
run: git diff --exit-code

- name: Upload ZIP as a GitHub Actions artifact
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
with:
name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/callable-test-gutenberg-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
env:
GUTENBERG_DIRECTORY: ${{ inputs.directory == 'build' && 'build' || 'src' }}/wp-content/plugins/gutenberg
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
NODE_OPTIONS: '--max-old-space-size=8192'

jobs:
# Verifies that installing npm dependencies and building the Gutenberg plugin works as expected.
Expand Down Expand Up @@ -54,9 +55,10 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm
cache-dependency-path: |
package-lock.json
Expand All @@ -68,7 +70,6 @@ jobs:
node --version
curl --version
git --version
svn --version
- name: Install Core Dependencies
run: npm ci
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up PHP
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
with:
php-version: 'latest'
coverage: none
Expand All @@ -88,7 +88,7 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHPCS scan cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: |
.cache/phpcs-src.json
Expand All @@ -98,7 +98,7 @@ jobs:
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
with:
custom-cache-suffix: ${{ steps.get-date.outputs.date }}

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

- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm
Expand All @@ -162,7 +162,6 @@ jobs:
npm --version
node --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm
Expand All @@ -87,7 +87,6 @@ jobs:
node --version
curl --version
git --version
svn --version
locale -a
- name: Install npm Dependencies
Expand Down Expand Up @@ -128,7 +127,7 @@ jobs:
run: npm run test:e2e

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
name: failures-artifacts${{ matrix.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}
Expand Down
99 changes: 89 additions & 10 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Confirms that installing WordPress using WP-CLI works successfully.
#
# This workflow is not meant to test wordpress-develop checkouts, but rather tagged versions officially available on WordPress.org.
name: Installation Tests

on:
Expand All @@ -7,29 +10,87 @@ on:
# Always test the workflow after it's updated.
paths:
- '.github/workflows/install-testing.yml'
- '.version-support-*.json'
pull_request:
# Always test the workflow when changes are suggested.
paths:
- '.github/workflows/install-testing.yml'
- '.version-support-*.json'
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
inputs:
wp-version:
description: 'The version to test installing. Accepts major and minor versions, "latest", or "nightly". Major releases must not end with ".0".'
type: string
default: 'latest'
default: 'nightly'

# 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.event_name == 'pull_request' && github.head_ref || github.sha }}
group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.head_ref || 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:
# 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
# Test the WordPress installation process through WP-CLI.
#
# Performs the following steps:
Expand All @@ -39,41 +100,59 @@ jobs:
# - Creates a `wp-config.php` file.
# - Installs WordPress.
install-tests-mysql:
name: WP ${{ inputs.wp-version || 'latest' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
name: WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}
permissions:
contents: read
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10
needs: [ build-matrix ]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }}
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0' ]
db-version: ${{ fromJSON( needs.build-matrix.outputs.mysql-versions ) }}
multisite: [ false, true ]
memcached: [ false ]

# Exclude some PHP and MySQL versions that cannot currently be tested with Docker containers.
exclude:
- php: '5.2'
- php: '5.3'
- db-version: '5.0'
- db-version: '5.1'
- db-version: '5.5'

services:
database:
image: ${{ matrix.db-type }}:${{ matrix.db-version }}
ports:
- 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 --entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
options: >-
--health-cmd="mysqladmin ping"
--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"' || '' }}
steps:
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0
with:
php-version: '${{ matrix.php }}'
coverage: none
tools: wp-cli
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 && 'latest' != inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '' }}
run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--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'] }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
cache: npm
Expand All @@ -77,7 +77,6 @@ jobs:
npm --version
node --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci
Expand Down
Loading

0 comments on commit 3e603d7

Please sign in to comment.