-
Notifications
You must be signed in to change notification settings - Fork 3.2k
#62221 Test current branch upgrade #8252
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
Closed
johnbillion
wants to merge
19
commits into
WordPress:trunk
from
johnbillion:62221-test-current-branch-upgrade
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a3a76e1
Add upgrade testing for the current branch.
johnbillion 583ec17
Don't run these tests in this PR.
johnbillion 51ecaf6
Argh.
johnbillion 6854186
Trigger a build.
johnbillion 9ac899a
Don't need any of these running in this PR.
johnbillion d3954cf
Enable manual running of develop performance testing.
johnbillion 7c61368
Switch to running the build in the same workflow.
johnbillion 6b838ec
Don't need this.
johnbillion 6ad708d
Naming.
johnbillion 493cea4
Correct the directory structure in the ZIP.
johnbillion f755ce0
Oops.
johnbillion dcb89df
Add some version debugging.
johnbillion 76a0eac
Expand this a little.
johnbillion 14ba1a7
Add database upgrades.
johnbillion 7987943
Do a network database upgrade on Multisite.
johnbillion f876e1a
Docs.
johnbillion 929d549
Docs.
johnbillion 2c99c46
Split the build into a reusable workflow.
johnbillion 3d3bb50
Merge branch 'trunk' into 62221-test-current-branch-upgrade
johnbillion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
|
@@ -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: {} | ||
|
|
@@ -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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.