Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

62221 Test current branch upgrade without hash #8285

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6e66fd2
Explicitly require the `hash` extension.
johnbillion Jan 16, 2025
f2ff4a4
Merge branch 'trunk' into 62815
johnbillion Jan 17, 2025
9777cec
These are not, and must not be, globals.
johnbillion Jan 17, 2025
4640972
Merge branch 'trunk' into 62815
johnbillion Jan 29, 2025
55f02be
Introduce a new `$required_php_extensions` to hold the list of requir…
johnbillion Jan 29, 2025
8d4db17
Add some guard conditions that check the state of the new `$required_…
johnbillion Feb 3, 2025
76116fb
This is an upgrade, not an installation.
johnbillion Feb 3, 2025
0c70f7d
Add the required extensions check to `wp_check_php_mysql_versions()` …
johnbillion Feb 3, 2025
663d2c2
Merge branch 'trunk' into 62815
johnbillion Feb 4, 2025
a3a76e1
Add upgrade testing for the current branch.
johnbillion Feb 4, 2025
583ec17
Don't run these tests in this PR.
johnbillion Feb 4, 2025
51ecaf6
Argh.
johnbillion Feb 4, 2025
6854186
Trigger a build.
johnbillion Feb 4, 2025
9ac899a
Don't need any of these running in this PR.
johnbillion Feb 4, 2025
d3954cf
Enable manual running of develop performance testing.
johnbillion Feb 4, 2025
7c61368
Switch to running the build in the same workflow.
johnbillion Feb 4, 2025
6b838ec
Don't need this.
johnbillion Feb 4, 2025
6ad708d
Naming.
johnbillion Feb 4, 2025
493cea4
Correct the directory structure in the ZIP.
johnbillion Feb 4, 2025
f755ce0
Oops.
johnbillion Feb 4, 2025
dcb89df
Add some version debugging.
johnbillion Feb 4, 2025
76a0eac
Expand this a little.
johnbillion Feb 4, 2025
14ba1a7
Add database upgrades.
johnbillion Feb 4, 2025
7987943
Do a network database upgrade on Multisite.
johnbillion Feb 4, 2025
f876e1a
Docs.
johnbillion Feb 4, 2025
929d549
Docs.
johnbillion Feb 10, 2025
2c99c46
Split the build into a reusable workflow.
johnbillion Feb 10, 2025
f3378d5
Let's see if we can run an upgrade test with `hash` disabled.
johnbillion Feb 10, 2025
8125d5f
Pass the extension matrix through to the workflow.
johnbillion Feb 10, 2025
d33dcf2
o_O
johnbillion Feb 10, 2025
f3de567
Let's see how we get on with this.
johnbillion Feb 10, 2025
a23f191
Add iconv.
johnbillion Feb 10, 2025
53bd7ea
Merge branch '62815' into 62221-test-current-branch-upgrade-without-hash
johnbillion Feb 10, 2025
f5ceca0
Remove json.
johnbillion Feb 10, 2025
d6363a8
Let's do this another way.
johnbillion Feb 10, 2025
50fc22b
Always run the post-update version check to ensure the site is still …
johnbillion Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ on:
- '[0-9]+.[0-9]'
- '[0-9]+.[0-9].[0-9]+'
- '!3.7.[0-9]+'
pull_request:
branches:
- trunk
- '3.[89]'
- '[4-9].[0-9]'
paths:
# Any change to a PHP or JavaScript file should run checks.
- '**.js'
- '**.php'
# These files configure npm. Changes could affect the outcome.
- 'package*.json'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures JSHint. Changes could affect the outcome.
- '.jshintrc'
# This file configures PHPCS. Changes could affect the outcome.
- 'phpcs.xml.dist'
# Confirm any changes to relevant workflow files.
- '.github/workflows/coding-standards.yml'
- '.github/workflows/reusable-coding-standards-*.yml'
# pull_request:
# branches:
# - trunk
# - '3.[89]'
# - '[4-9].[0-9]'
# paths:
# # Any change to a PHP or JavaScript file should run checks.
# - '**.js'
# - '**.php'
# # These files configure npm. Changes could affect the outcome.
# - 'package*.json'
# # These files configure Composer. Changes could affect the outcome.
# - 'composer.*'
# # This file configures JSHint. Changes could affect the outcome.
# - '.jshintrc'
# # This file configures PHPCS. Changes could affect the outcome.
# - 'phpcs.xml.dist'
# # 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
44 changes: 22 additions & 22 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ on:
- '[0-9]+.[0-9].[0-9]+'
- '![34].[0-9].[0-9]+'
- '!5.[0-2].[0-9]+'
pull_request:
branches:
- trunk
- '5.[3-9]'
- '[6-9].[0-9]'
paths:
# Any change to a PHP, CSS, or JavaScript file should run checks.
- '**.css'
- '**.js'
- '**.php'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the e2e tests. Changes could affect the outcome.
- 'tests/e2e/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/end-to-end-tests.yml'
- '.github/workflows/reusable-end-to-end-tests-*.yml'
# pull_request:
# branches:
# - trunk
# - '5.[3-9]'
# - '[6-9].[0-9]'
# paths:
# # Any change to a PHP, CSS, or JavaScript file should run checks.
# - '**.css'
# - '**.js'
# - '**.php'
# # These files configure npm and the task runner. Changes could affect the outcome.
# - 'package*.json'
# - 'Gruntfile.js'
# - 'webpack.config.js'
# - 'tools/webpack/**'
# # These files configure Composer. Changes could affect the outcome.
# - 'composer.*'
# # This files affect the e2e tests. Changes could affect the outcome.
# - 'tests/e2e/**'
# # Confirm any changes to relevant workflow files.
# - '.github/workflows/end-to-end-tests.yml'
# - '.github/workflows/reusable-end-to-end-tests-*.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ on:
- '[0-9]+.[0-9].[0-9]+'
- '![45].[0-9].[0-9]+'
- '!6.[01].[0-9]+'
pull_request:
branches:
- trunk
- '6.[2-9]'
- '[7-9].[0-9]'
paths:
# Any change to a PHP, CSS, or JavaScript file should run checks.
- '**.css'
- '**.js'
- '**.php'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
- 'webpack.config.js'
- 'tools/webpack/**'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the performance tests. Changes could affect the outcome.
- 'tests/performance/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/performance.yml'
- '.github/workflows/reusable-performance.yml'
- '.github/workflows/reusable-performance-*.yml'
# pull_request:
# branches:
# - trunk
# - '6.[2-9]'
# - '[7-9].[0-9]'
# paths:
# # Any change to a PHP, CSS, or JavaScript file should run checks.
# - '**.css'
# - '**.js'
# - '**.php'
# # These files configure npm and the task runner. Changes could affect the outcome.
# - 'package*.json'
# - 'Gruntfile.js'
# - 'webpack.config.js'
# - 'tools/webpack/**'
# # These files configure Composer. Changes could affect the outcome.
# - 'composer.*'
# # This files affect the performance tests. Changes could affect the outcome.
# - 'tests/performance/**'
# # Confirm any changes to relevant workflow files.
# - '.github/workflows/performance.yml'
# - '.github/workflows/reusable-performance.yml'
# - '.github/workflows/reusable-performance-*.yml'
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ on:
- '[0-9]+.[0-9].[0-9]+'
- '![34].[0-9].[0-9]+'
- '!5.[0-4].[0-9]+'
pull_request:
branches:
- trunk
- '5.[5-9]'
- '[6-9].[0-9]'
paths:
# This workflow only scans PHP files.
- '**.php'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures PHP compatibility scanning. Changes could affect the outcome.
- 'phpcompat.xml.dist'
# Confirm any changes to relevant workflow files.
- '.github/workflows/php-compatibility.yml'
- '.github/workflows/reusable-php-compatibility.yml'
# pull_request:
# branches:
# - trunk
# - '5.[5-9]'
# - '[6-9].[0-9]'
# paths:
# # This workflow only scans PHP files.
# - '**.php'
# # These files configure Composer. Changes could affect the outcome.
# - 'composer.*'
# # This file configures PHP compatibility scanning. Changes could affect the outcome.
# - 'phpcompat.xml.dist'
# # 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
48 changes: 24 additions & 24 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ on:
tags:
- '[0-9]+.[0-9]'
- '[0-9]+.[0-9].[0-9]+'
pull_request:
branches:
- trunk
- '3.[7-9]'
- '[4-9].[0-9]'
paths:
# Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks.
- '**.css'
- '**.html'
- '**.js'
- '**.json'
- '**.php'
- 'src/license.txt'
- 'src/SECURITY.md'
# These files configure npm and the task runner. Changes could affect the outcome.
- 'package*.json'
- 'Gruntfile.js'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This files affect the phpunit tests. Changes could affect the outcome.
- 'tests/phpunit/**'
# Confirm any changes to relevant workflow files.
- '.github/workflows/phpunit-tests.yml'
- '.github/workflows/reusable-phpunit-tests-*.yml'
# pull_request:
# branches:
# - trunk
# - '3.[7-9]'
# - '[4-9].[0-9]'
# paths:
# # Any change to a PHP, CSS, JavaScript, JSON, HTML, or otherwise tested file should run checks.
# - '**.css'
# - '**.html'
# - '**.js'
# - '**.json'
# - '**.php'
# - 'src/license.txt'
# - 'src/SECURITY.md'
# # These files configure npm and the task runner. Changes could affect the outcome.
# - 'package*.json'
# - 'Gruntfile.js'
# # These files configure Composer. Changes could affect the outcome.
# - 'composer.*'
# # This files affect the phpunit tests. Changes could affect the outcome.
# - 'tests/phpunit/**'
# # Confirm any changes to relevant workflow files.
# - '.github/workflows/phpunit-tests.yml'
# - '.github/workflows/reusable-phpunit-tests-*.yml'
workflow_dispatch:
# Once weekly On Sundays at 00:00 UTC.
schedule:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/reusable-build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##
# A reusable workflow that builds and packages WordPress. The resulting package can be used to test upgrading and installing.
##
name: Build and package WordPress

on:
workflow_call:

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# Builds and packages WordPress.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Runs the build script.
# - Prepares the directory structure for the ZIP.
# - Creates a ZIP of the built files.
# - Uploads the ZIP as a GitHub Actions artifact.
build:
name: WordPress
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 20

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm Dependencies
run: npm ci

- name: Build WordPress
run: npm run build

- name: Prepare the directory structure for the ZIP
run: mv build wordpress

- name: Create ZIP of built files
run: zip -q -r develop.zip wordpress/.

- name: Upload ZIP as a GitHub Actions artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: wordpress-develop
path: develop.zip
if-no-files-found: error
50 changes: 49 additions & 1 deletion .github/workflows/reusable-upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
required: true
type: 'string'
new-version:
description: 'The version of WordPress to update to.'
description: 'The version of WordPress to update to. Use "latest" to update to the latest version, "develop" to update to the current branch, or provide a specific version number to update to.'
type: 'string'
default: 'latest'
php:
Expand All @@ -36,6 +36,11 @@ on:
required: false
type: 'string'
default: '5.7'
extensions:
description: 'PHP extension configuration used by setup-php.'
required: false
type: 'string'
default: ''

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
Expand All @@ -49,8 +54,13 @@ jobs:
# - Downloads the specified version of WordPress.
# - Creates a `wp-config.php` file.
# - Installs WordPress.
# - Checks the version of WordPress before the upgrade.
# - Updates to the latest minor version.
# - Updates the database after the minor update.
# - Checks the version of WordPress after the minor update.
# - Updates to the version of WordPress being tested.
# - Updates the database.
# - Checks the version of WordPress after the upgrade.
upgrade-tests:
name: ${{ inputs.wp }} to ${{ inputs.new-version }} / PHP ${{ inputs.php }} with ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}
permissions: {}
Expand Down Expand Up @@ -79,6 +89,16 @@ jobs:
php-version: '${{ inputs.php }}'
coverage: none
tools: wp-cli
extensions: ${{ inputs.extensions }}
env:
fail-fast: true

- name: Debug information
run: |
php --version
php -m
php -i
locale -a

- name: Download WordPress ${{ inputs.wp }}
run: wp core download --version="${WP_VERSION}"
Expand All @@ -96,11 +116,39 @@ jobs:
--url=http://localhost/ --title="Upgrade Test" --admin_user=admin \
--admin_password=password [email protected] --skip-email

- name: Pre-upgrade version check
run: wp core version

- name: Update to the latest minor version
run: wp core update --minor

- name: Update the database after the minor update
run: wp core update-db ${{ inputs.multisite && '--network' || '' }}

- name: Post-upgrade version check after the minor update
run: wp core version

- name: Download build artifact for the current branch
if: ${{ inputs.new-version == 'develop' }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: wordpress-develop

- name: Upgrade to WordPress at current branch
if: ${{ inputs.new-version == 'develop' }}
run: |
wp core update develop.zip

- name: Upgrade to WordPress ${{ inputs.new-version }}
if: ${{ inputs.new-version != 'develop' }}
run: |
wp core update ${{ 'latest' != inputs.new-version && '--version="${WP_VERSION}"' || '' }}
env:
WP_VERSION: ${{ inputs.new-version }}

- name: Update the database
run: wp core update-db ${{ inputs.multisite && '--network' || '' }}

- name: Post-upgrade version check
if: always()
run: wp core version
Loading
Loading