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 #8252

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 33 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 Down Expand Up @@ -49,8 +49,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 @@ -96,11 +101,38 @@ 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
run: wp core version
Loading