Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/58919-cache-mo-file-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Jan 15, 2024
2 parents 9cec6dd + 56e16bd commit 5bfdb78
Show file tree
Hide file tree
Showing 159 changed files with 16,572 additions and 8,241 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/callable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm

- name: Log debug information
Expand All @@ -57,7 +58,6 @@ jobs:
node --version
curl --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci
Expand Down
3 changes: 2 additions & 1 deletion .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 @@ -57,6 +58,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
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
1 change: 0 additions & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ jobs:
npm --version
node --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ jobs:
node --version
curl --version
git --version
svn --version
locale -a
- name: Install npm Dependencies
Expand Down
97 changes: 88 additions & 9 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
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
1 change: 0 additions & 1 deletion .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
npm --version
node --version
git --version
svn --version
- name: Install npm Dependencies
run: npm ci
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ jobs:
# - Run performance tests (current commit).
# - Print performance tests results.
# - Check out target commit (target branch or previous commit).
# - Switch Node.js versions if necessary.
# - Install npm dependencies.
# - Build WordPress.
# - Run any database upgrades.
# - Run performance tests (previous/target commit).
# - Print target performance tests results.
# - Reset to original commit.
# - Switch Node.js versions if necessary.
# - Install npm dependencies.
# - Set the environment to the baseline version.
# - Run any database upgrades.
Expand Down Expand Up @@ -119,7 +121,6 @@ jobs:
node --version
curl --version
git --version
svn --version
locale -a
- name: Install npm dependencies
Expand Down Expand Up @@ -190,6 +191,12 @@ jobs:
fi
git reset --hard $TARGET_SHA
- name: Set up Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm dependencies
run: npm ci

Expand All @@ -212,6 +219,12 @@ jobs:
- name: Reset to original commit
run: git reset --hard $GITHUB_SHA

- name: Set up Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm dependencies
run: npm ci

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/phpunit-tests-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ jobs:
node --version
curl --version
git --version
svn --version
composer --version
locale -a
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ jobs:
node --version
curl --version
git --version
svn --version
composer --version
locale -a
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
Loading

0 comments on commit 5bfdb78

Please sign in to comment.