|
| 1 | +# Confirms that updating WordPress using WP-CLI works successfully. |
| 2 | +# |
| 3 | +# This workflow tests upgrading from a previous version to the current wordpress-develop checkout, not to a version available on WordPress.org. |
| 4 | +name: Upgrade Develop Version Tests |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - trunk |
| 10 | + - '6.[8-9]' |
| 11 | + - '[7-9].[0-9]' |
| 12 | + tags: |
| 13 | + - '[0-9]+.[0-9]' |
| 14 | + - '[0-9]+.[0-9].[0-9]+' |
| 15 | + paths: |
| 16 | + # Any change to a source PHP file should run checks. |
| 17 | + - 'src/**.php' |
| 18 | + # Confirm any changes to relevant workflow files. |
| 19 | + - '.github/workflows/upgrade-develop-testing.yml' |
| 20 | + - '.github/workflows/reusable-upgrade-testing.yml' |
| 21 | + pull_request: |
| 22 | + branches: |
| 23 | + - trunk |
| 24 | + - '6.[8-9]' |
| 25 | + - '[7-9].[0-9]' |
| 26 | + paths: |
| 27 | + # Any change to a source PHP file should run checks. |
| 28 | + - 'src/**.php' |
| 29 | + # Confirm any changes to relevant workflow files. |
| 30 | + - '.github/workflows/upgrade-develop-testing.yml' |
| 31 | + - '.github/workflows/reusable-upgrade-testing.yml' |
| 32 | + workflow_dispatch: |
| 33 | + |
| 34 | +# Cancels all previous workflow runs for pull requests that have not completed. |
| 35 | +concurrency: |
| 36 | + # The concurrency group contains the workflow name and the branch name for pull requests |
| 37 | + # or the commit hash for any other events. |
| 38 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} |
| 39 | + cancel-in-progress: true |
| 40 | + |
| 41 | +# Disable permissions for all available scopes by default. |
| 42 | +# Any needed permissions should be configured at the job level. |
| 43 | +permissions: {} |
| 44 | + |
| 45 | +jobs: |
| 46 | + # Build WordPress from the current branch ready for the upgrade tests. |
| 47 | + build: |
| 48 | + name: Build |
| 49 | + uses: ./.github/workflows/reusable-build-package.yml |
| 50 | + permissions: |
| 51 | + contents: read |
| 52 | + |
| 53 | + # Run upgrade tests for the current branch. |
| 54 | + upgrade-tests-develop: |
| 55 | + name: Upgrade from ${{ matrix.wp }} |
| 56 | + uses: ./.github/workflows/reusable-upgrade-testing.yml |
| 57 | + if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} |
| 58 | + needs: [ build ] |
| 59 | + strategy: |
| 60 | + fail-fast: false |
| 61 | + matrix: |
| 62 | + os: [ 'ubuntu-24.04' ] |
| 63 | + php: [ '7.2', '8.4' ] |
| 64 | + db-type: [ 'mysql' ] |
| 65 | + db-version: [ '5.7', '8.4' ] |
| 66 | + wp: [ '6.5', '6.6', '6.7' ] |
| 67 | + multisite: [ false, true ] |
| 68 | + |
| 69 | + exclude: |
| 70 | + # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. |
| 71 | + - php: '7.2' |
| 72 | + db-version: '8.4' |
| 73 | + with: |
| 74 | + os: ${{ matrix.os }} |
| 75 | + php: ${{ matrix.php }} |
| 76 | + db-type: ${{ matrix.db-type }} |
| 77 | + db-version: ${{ matrix.db-version }} |
| 78 | + wp: ${{ matrix.wp }} |
| 79 | + new-version: develop |
| 80 | + multisite: ${{ matrix.multisite }} |
| 81 | + |
| 82 | + slack-notifications: |
| 83 | + name: Slack Notifications |
| 84 | + uses: ./.github/workflows/slack-notifications.yml |
| 85 | + permissions: |
| 86 | + actions: read |
| 87 | + contents: read |
| 88 | + needs: [ upgrade-tests-develop ] |
| 89 | + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} |
| 90 | + with: |
| 91 | + calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} |
| 92 | + secrets: |
| 93 | + SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} |
| 94 | + SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} |
| 95 | + SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} |
| 96 | + SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} |
| 97 | + |
| 98 | + failed-workflow: |
| 99 | + name: Failed workflow tasks |
| 100 | + runs-on: ubuntu-24.04 |
| 101 | + permissions: |
| 102 | + actions: write |
| 103 | + needs: [ slack-notifications ] |
| 104 | + if: | |
| 105 | + always() && |
| 106 | + github.repository == 'WordPress/wordpress-develop' && |
| 107 | + github.event_name != 'pull_request' && |
| 108 | + github.run_attempt < 2 && |
| 109 | + ( |
| 110 | + contains( needs.*.result, 'cancelled' ) || |
| 111 | + contains( needs.*.result, 'failure' ) |
| 112 | + ) |
| 113 | +
|
| 114 | + steps: |
| 115 | + - name: Dispatch workflow run |
| 116 | + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 117 | + with: |
| 118 | + retries: 2 |
| 119 | + retry-exempt-status-codes: 418 |
| 120 | + script: | |
| 121 | + github.rest.actions.createWorkflowDispatch({ |
| 122 | + owner: context.repo.owner, |
| 123 | + repo: context.repo.repo, |
| 124 | + workflow_id: 'failed-workflow.yml', |
| 125 | + ref: 'trunk', |
| 126 | + inputs: { |
| 127 | + run_id: `${context.runId}`, |
| 128 | + } |
| 129 | + }); |
0 commit comments