From 86d57d9e2a48c0abd0b10fb3cab431285d02230d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 25 Feb 2026 17:02:00 +0000 Subject: [PATCH] Trim the 6.5 workflows. --- .github/workflows/failed-workflow.yml | 54 ---- .github/workflows/install-testing.yml | 210 --------------- .github/workflows/performance.yml | 88 ------- .github/workflows/phpunit-tests.yml | 14 +- .github/workflows/slack-notifications.yml | 222 ---------------- .../workflows/test-and-zip-default-themes.yml | 243 ------------------ .github/workflows/test-coverage.yml | 240 ----------------- .github/workflows/test-old-branches.yml | 123 --------- 8 files changed, 8 insertions(+), 1186 deletions(-) delete mode 100644 .github/workflows/failed-workflow.yml delete mode 100644 .github/workflows/install-testing.yml delete mode 100644 .github/workflows/performance.yml delete mode 100644 .github/workflows/slack-notifications.yml delete mode 100644 .github/workflows/test-and-zip-default-themes.yml delete mode 100644 .github/workflows/test-coverage.yml delete mode 100644 .github/workflows/test-old-branches.yml diff --git a/.github/workflows/failed-workflow.yml b/.github/workflows/failed-workflow.yml deleted file mode 100644 index 383800a3fc592..0000000000000 --- a/.github/workflows/failed-workflow.yml +++ /dev/null @@ -1,54 +0,0 @@ -## -# Performs follow-up tasks when a workflow fails or is cancelled. -## -name: Failed Workflow - -on: - workflow_dispatch: - inputs: - run_id: - description: 'ID of the GitHub Action workflow run to rerun' - required: true - type: 'string' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - # Attempts to rerun a workflow. - # - # Performs the following steps: - # - Retrieves the workflow run that dispatched this workflow. - # - Restarts all failed jobs when the workflow fails or is cancelled for the first time. - failed-workflow: - name: Rerun a workflow - runs-on: ubuntu-latest - permissions: - actions: write - timeout-minutes: 30 - - steps: - - name: Rerun a workflow - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 15 - retry-exempt-status-codes: 418 - script: | - const workflow_run = await github.rest.actions.getWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ inputs.run_id }}, - }); - - // Only rerun after the first run attempt. - if ( workflow_run.data.run_attempt > 1 ) { - return; - } - - const rerun = await github.rest.actions.reRunWorkflowFailedJobs({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ inputs.run_id }}, - enable_debug_logging: true - }); diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml deleted file mode 100644 index f820c214df16d..0000000000000 --- a/.github/workflows/install-testing.yml +++ /dev/null @@ -1,210 +0,0 @@ -# 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: - push: - branches: - - trunk - # 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: '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 }}-${{ 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: - # - Sets up PHP. - # - Starts the database server. - # - Downloads the specified version of WordPress. - # - Creates a `wp-config.php` file. - # - Installs WordPress. - install-tests-mysql: - 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: ${{ matrix.os }} - timeout-minutes: 10 - needs: [ build-matrix ] - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }} - db-type: [ 'mysql' ] - 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${{ matrix.db-version != '5.5' && ' --default-authentication-plugin=mysql_native_password"' || '' }} - - steps: - - name: Set up PHP ${{ matrix.php }} - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0 - with: - php-version: '${{ matrix.php }}' - coverage: none - 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 && 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'] }} - - - name: Install WordPress - run: wp core ${{ matrix.multisite && 'multisite-' || '' }}install --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ install-tests-mysql ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-latest - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: '${{ github.run_id }}' - } - }); diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml deleted file mode 100644 index 9244fc84cb6be..0000000000000 --- a/.github/workflows/performance.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Performance Tests - -on: - push: - branches: - - trunk - - '6.[2-9]' - - '[7-9].[0-9]' - tags: - - '[0-9]+.[0-9]' - - '[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]' - workflow_dispatch: - -# 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 }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - # Runs the performance test suite. - performance: - name: Run performance tests - uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk - permissions: - contents: read - if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }} - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ performance ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-latest - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: '${{ github.run_id }}' - } - }); diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index f96580bd113d5..f0eeacfd75a8b 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -43,9 +43,10 @@ jobs: 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' ] + # Test highest and lowest supported version of each major. + php: [ '7.0', '7.4', '8.0', '8.3' ] db-type: [ 'mysql' ] - db-version: [ '5.7', '8.0', '8.1', '8.2', '8.3' ] + db-version: [ '5.7', '8.0', '8.3' ] multisite: [ false, true ] memcached: [ false ] @@ -93,9 +94,10 @@ jobs: 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' ] + # Test highest and lowest supported version of each major. + php: [ '7.0', '7.4', '8.0', '8.3' ] db-type: [ 'mariadb' ] - db-version: [ '10.4', '10.6', '10.11', '11.2' ] + db-version: [ '10.4', '10.11' ] multisite: [ false, true ] memcached: [ false ] @@ -104,13 +106,13 @@ jobs: - os: ubuntu-latest php: '7.4' db-type: 'mariadb' - db-version: '11.2' + db-version: '10.11' multisite: false memcached: true - os: ubuntu-latest php: '7.4' db-type: 'mariadb' - db-version: '11.2' + db-version: '10.11' multisite: true memcached: true with: diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml deleted file mode 100644 index aab3a85147bc0..0000000000000 --- a/.github/workflows/slack-notifications.yml +++ /dev/null @@ -1,222 +0,0 @@ -## -# A reusable workflow for posting messages to the Making WordPress -# Core Slack Instance by submitting data to Slack webhook URLs -# received by Slack Workflows. -## -name: Slack Notifications - -on: - workflow_call: - inputs: - calling_status: - description: 'The status of the calling workflow' - type: string - required: true - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: - description: 'The Slack webhook URL for a successful build.' - required: true - SLACK_GHA_CANCELLED_WEBHOOK: - description: 'The Slack webhook URL for a cancelled build.' - required: true - SLACK_GHA_FIXED_WEBHOOK: - description: 'The Slack webhook URL for a fixed build.' - required: true - SLACK_GHA_FAILURE_WEBHOOK: - description: 'The Slack webhook URL for a failed build.' - required: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -env: - CURRENT_BRANCH: ${{ github.ref_name }} - -jobs: - # Gathers the details needed for Slack notifications. - # - # These details are passed as outputs to the subsequent, dependant jobs that - # submit data to Slack webhook URLs configured to post messages. - # - # Performs the following steps: - # - Retrieves the current workflow run. - # - Determines the conclusion of the previous workflow run or run attempt. - # - Sets the previous conclusion as an output. - # - Prepares the commit message. - # - Constructs and stores a message payload as an output. - prepare: - name: Prepare notifications - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - timeout-minutes: 5 - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event.workflow_run.event != 'pull_request' }} - outputs: - previous_conclusion: ${{ steps.previous-conclusion.outputs.previous_conclusion }} - payload: ${{ steps.create-payload.outputs.payload }} - - steps: - - name: Determine the status of the previous attempt - id: previous-attempt-result - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - const workflow_run = await github.rest.actions.getWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ github.run_id }}, - }); - - if ( '${{ inputs.calling_status }}' == 'failure' && workflow_run.data.run_attempt == 1 ) { - return 'first-failure'; - } - - // When a workflow has been restarted, check the previous run attempt. Because workflows are automatically - // restarted once and a failure on the first run is not reported, failures on the second run should not be - // considered. - if ( workflow_run.data.run_attempt > 2 ) { - const previous_run = await github.rest.actions.getWorkflowRunAttempt({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ github.run_id }}, - attempt_number: workflow_run.data.run_attempt - 1 - }); - - return previous_run.data.conclusion; - } - - // Otherwise, check the previous workflow run. - const previous_runs = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: workflow_run.data.workflow_id, - branch: '${{ env.CURRENT_BRANCH }}', - exclude_pull_requests: true, - }); - - // This is the first workflow run for this branch or tag. - if ( previous_runs.data.workflow_runs.length < 2 ) { - return 'none'; - } - - const expected_events = new Array( 'push', 'schedule', 'workflow_dispatch' ); - - // Find the workflow run for the commit that immediately preceded this one. - for ( let i = 0; i < previous_runs.data.workflow_runs.length; i++ ) { - if ( previous_runs.data.workflow_runs[ i ].run_number == workflow_run.data.run_number ) { - let next_index = i; - do { - next_index++; - - // Protects against a false notification when contributors use the trunk branch as the pull request head_ref. - if ( expected_events.indexOf( previous_runs.data.workflow_runs[ next_index ].event ) == -1 ) { - continue; - } - - return previous_runs.data.workflow_runs[ next_index ].conclusion; - } while ( next_index < previous_runs.data.workflow_runs.length ); - } - } - - // Can't determine previous workflow conclusion. - return 'unknown'; - - - name: Store previous conclusion as an output - id: previous-conclusion - run: echo "previous_conclusion=${{ steps.previous-attempt-result.outputs.result }}" >> $GITHUB_OUTPUT - - - name: Get the commit message - id: current-commit-message - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - const commit_details = await github.rest.repos.getCommit({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: '${{ github.sha }}' - }); - return commit_details.data.commit.message; - - - name: Prepare commit message. - id: commit-message - run: | - COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g' - ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }} - EOF - ) - echo "commit_message_escaped=${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT - - - name: Construct payload and store as an output - id: create-payload - run: echo "payload={\"workflow_name\":\"${{ github.workflow }}\",\"ref_name\":\"${{ env.CURRENT_BRANCH }}\",\"run_url\":\"https://github.com/WordPress/wordpress-develop/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}" >> $GITHUB_OUTPUT - - # Posts notifications when a workflow fails. - failure: - name: Failure notifications - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: [ prepare ] - if: ${{ needs.prepare.outputs.previous_conclusion != 'first-failure' && inputs.calling_status == 'failure' || failure() }} - - steps: - - name: Post failure notifications to Slack - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - with: - payload: ${{ needs.prepare.outputs.payload }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - # Posts notifications the first time a workflow run succeeds after previously failing. - fixed: - name: Fixed notifications - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: [ prepare ] - if: ${{ contains( fromJson( '["failure", "cancelled", "none"]' ), needs.prepare.outputs.previous_conclusion ) && inputs.calling_status == 'success' && success() }} - - steps: - - name: Post failure notifications to Slack - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - with: - payload: ${{ needs.prepare.outputs.payload }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - - # Posts notifications when a workflow is successful. - success: - name: Success notifications - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: [ prepare ] - if: ${{ inputs.calling_status == 'success' && success() }} - - steps: - - name: Post success notifications to Slack - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - with: - payload: ${{ needs.prepare.outputs.payload }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - - # Posts notifications when a workflow is cancelled. - cancelled: - name: Cancelled notifications - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: [ prepare ] - if: ${{ inputs.calling_status == 'cancelled' || cancelled() }} - - steps: - - name: Post cancelled notifications to Slack - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - with: - payload: ${{ needs.prepare.outputs.payload }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} diff --git a/.github/workflows/test-and-zip-default-themes.yml b/.github/workflows/test-and-zip-default-themes.yml deleted file mode 100644 index 31e4800cfa44d..0000000000000 --- a/.github/workflows/test-and-zip-default-themes.yml +++ /dev/null @@ -1,243 +0,0 @@ -name: Test Default Themes & Create ZIPs - -on: - push: - branches: - - trunk - - '3.[89]' - - '[4-9].[0-9]' - paths: - # Changing the preferred version of Node.js could affect themes with build processes. - - '.nvm' - # Changes to any themes with a build script should be confirmed. - - 'src/wp-content/themes/twentynineteen/**' - - 'src/wp-content/themes/twentytwenty/**' - - 'src/wp-content/themes/twentytwentyone/**' - # Changes to this workflow file should always verify success. - - '.github/workflows/test-and-zip-default-themes.yml' - pull_request: - branches: - - trunk - - '3.[89]' - - '[4-9].[0-9]' - paths: - # Changing the preferred version of Node.js could affect themes with build processes. - - '.nvm' - # Changes to any themes with a build script should be confirmed. - - 'src/wp-content/themes/twentynineteen/**' - - 'src/wp-content/themes/twentytwenty/**' - - 'src/wp-content/themes/twentytwentyone/**' - # Changes to this workflow file should always verify success. - - '.github/workflows/test-and-zip-default-themes.yml' - workflow_dispatch: - inputs: - branch: - description: 'The branch to create ZIP files from' - required: true - type: string - default: 'trunk' - -# 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 }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - # Checks for zero-byte files. - # - # Occasionally, binary files such as images and fonts are added to themes incorrectly. - # This checks that all files contain contents. - # - # Performs the following steps: - # - Checks out the repository. - # - Checks for zero-byte (empty) files. - check-for-empty-files: - name: ${{ matrix.theme }} empty file check - runs-on: ubuntu-latest - permissions: - contents: read - timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - theme: [ - 'twentytwentyfour', - 'twentytwentythree', - 'twentytwentytwo', - 'twentytwentyone', - 'twentytwenty', - 'twentynineteen', - 'twentyseventeen', - 'twentysixteen', - 'twentyfifteen', - 'twentyfourteen', - 'twentythirteen', - 'twentytwelve', - 'twentyeleven', - 'twentyten' - ] - - steps: - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - - name: Check for zero-byte (empty) files - run: | - [[ ! $(find src/wp-content/themes/${{ matrix.theme }} -empty) ]] - - # Tests the build script for themes that have one. - # - # Performs the following steps: - # - Checks out the repository. - # - Sets up Node.js. - # - Installs npm dependencies. - # - Runs the theme build script. - # - Ensures version-controlled files are not modified or deleted. - test-build-scripts: - name: Test ${{ matrix.theme }} build script - runs-on: ubuntu-latest - permissions: - contents: read - timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - theme: [ - 'twentytwentyone', - 'twentytwenty', - 'twentynineteen', - ] - - defaults: - run: - working-directory: src/wp-content/themes/${{ matrix.theme }} - - steps: - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - - name: Set up Node.js - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version-file: '.nvmrc' - cache: npm - cache-dependency-path: src/wp-content/themes/${{ matrix.theme }}/package-lock.json - - - name: Install npm dependencies - run: npm ci - - - name: Build theme - run: npm run build - - - name: Ensure version-controlled files are not modified or deleted - run: git diff --exit-code - - # Prepares bundled themes for release. - # - # Performs the following steps: - # - Checks out the repository. - # - Uploads the theme files as a workflow artifact (files uploaded as an artifact are automatically zipped). - bundle-theme: - name: Create ${{ matrix.theme }} ZIP file - runs-on: ubuntu-latest - permissions: - contents: read - needs: [ check-for-empty-files, test-build-scripts ] - timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - theme: [ - 'twentytwentyfour', - 'twentytwentythree', - 'twentytwentytwo', - 'twentytwentyone', - 'twentytwenty', - 'twentynineteen', - 'twentyseventeen', - 'twentysixteen', - 'twentyfifteen', - 'twentyfourteen', - 'twentythirteen', - 'twentytwelve', - 'twentyeleven', - 'twentyten' - ] - - steps: - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - - name: Upload theme ZIP as an artifact - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - if-no-files-found: error - name: ${{ matrix.theme }} - path: src/wp-content/themes/${{ matrix.theme }} - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ check-for-empty-files, bundle-theme, test-build-scripts ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-latest - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: '${{ github.run_id }}' - } - }); diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml deleted file mode 100644 index e109a20a7c81c..0000000000000 --- a/.github/workflows/test-coverage.yml +++ /dev/null @@ -1,240 +0,0 @@ -name: Code Coverage Report - -on: - # Verify - push: - branches: - - trunk - paths: - - '.github/workflows/test-coverage.yml' - - 'docker-compose.yml' - - 'phpunit.xml.dist' - - 'tests/phpunit/multisite.xml' - pull_request: - branches: - - trunk - paths: - - '.github/workflows/test-coverage.yml' - - 'docker-compose.yml' - - 'phpunit.xml.dist' - - 'tests/phpunit/multisite.xml' - # Once daily at 00:00 UTC. - schedule: - - cron: '0 0 * * *' - # Allow manually triggering the workflow. - workflow_dispatch: - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -env: - LOCAL_PHP_XDEBUG: true - LOCAL_PHP_XDEBUG_MODE: 'coverage' - LOCAL_PHP_MEMCACHED: ${{ false }} - PUPPETEER_SKIP_DOWNLOAD: ${{ true }} - -jobs: - # Runs the PHPUnit tests for WordPress. - # - # Performs the following steps: - # - Sets environment variables. - # - Checks out the repository. - # - Sets up Node.js. - # - Sets up PHP. - # - Installs Composer dependencies. - # - Installs npm dependencies - # - Logs general debug information about the runner. - # - Logs Docker debug information (about the Docker installation within the runner). - # - Starts the WordPress Docker container. - # - Logs the running Docker containers. - # - Logs debug information about what's installed within the WordPress Docker containers. - # - Install WordPress within the Docker container. - # - Run the PHPUnit tests as a single site. - # - Ensures version-controlled files are not modified or deleted. - # - Upload the single site code coverage report to Codecov.io. - # - Run the PHPUnit tests as a multisite installation. - # - Ensures version-controlled files are not modified or deleted. - # - Upload the multisite code coverage report to Codecov.io. - test-coverage-report: - name: ${{ matrix.multisite && 'Multisite' || 'Single site' }} report (${{ matrix.format }}) - runs-on: ubuntu-latest - permissions: - contents: read - timeout-minutes: 120 - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - strategy: - fail-fast: false - matrix: - multisite: [ false, true ] - format: [ clover, html ] - - steps: - - name: Configure environment variables - run: | - echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV - echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV - - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - - name: Set up Node.js - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version-file: '.nvmrc' - cache: npm - - ## - # This allows Composer dependencies to be installed using a single step. - # - # Since the tests are currently run within the Docker containers where the PHP version varies, - # the same PHP version needs to be configured for the action runner machine so that the correct - # dependency versions are installed and cached. - ## - - name: Set up PHP - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2.30.0 - with: - php-version: '7.4' - coverage: none - - # Since Composer dependencies are installed using `composer update` and no lock file is in version control, - # passing a custom cache suffix ensures that the cache is flushed at least once per week. - - name: Install Composer dependencies - uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0 - with: - custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") - - - name: Install npm Dependencies - run: npm ci - - - name: Log debug information - run: | - echo "$GITHUB_REF" - echo "$GITHUB_EVENT_NAME" - npm --version - node --version - curl --version - git --version - composer --version - locale -a - - - name: Docker debug information - run: | - docker -v - - - name: Start Docker environment - run: | - npm run env:start - - - name: Log running Docker containers - run: docker ps -a - - - name: WordPress Docker container debug information - run: | - docker compose run --rm mysql mysql --version - docker compose run --rm php php --version - docker compose run --rm php php -m - docker compose run --rm php php -i - docker compose run --rm php locale -a - - - name: Install WordPress - run: npm run env:install - - - name: Run tests as a single site - if: ${{ ! matrix.multisite }} - run: npm run test:php -- --verbose -c phpunit.xml.dist --coverage-${{ 'html' == matrix.format && 'html' || 'clover' }} wp-code-coverage-single-${{ github.sha }}${{ 'clover' == matrix.format && '.xml' || '' }} - - - name: Ensure version-controlled files are not modified during the tests - run: git diff --exit-code - - - name: Upload single site report to Codecov - if: ${{ ! matrix.multisite && github.event_name != 'pull_request' }} - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: wp-code-coverage-single-${{ github.sha }}${{ 'clover' == matrix.format && '.xml' || '' }} - flags: single,php - fail_ci_if_error: true - - - name: Upload single site HTML report as artifact - if: ${{ ! matrix.multisite && matrix.format == 'html' }} - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: wp-code-coverage-single-${{ github.sha }} - path: wp-code-coverage-single-${{ github.sha }} - overwrite: true - - - name: Run tests as a multisite install - if: ${{ matrix.multisite }} - run: npm run test:php -- --verbose -c tests/phpunit/multisite.xml --coverage-${{ 'html' == matrix.format && 'html' || 'clover' }} wp-code-coverage-multisite-${{ github.sha }}${{ 'clover' == matrix.format && '.xml' || '' }} - - - name: Ensure version-controlled files are not modified during the tests - run: git diff --exit-code - - - name: Upload multisite report to Codecov - if: ${{ matrix.multisite && github.event_name != 'pull_request' }} - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: wp-code-coverage-multisite-${{ github.sha }}${{ 'clover' == matrix.format && '.xml' || '' }} - flags: multisite,php - fail_ci_if_error: true - - - name: Upload multisite HTML report as artifact - if: ${{ matrix.multisite && matrix.format == 'html' }} - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - name: wp-code-coverage-multisite-${{ github.sha }} - path: wp-code-coverage-multisite-${{ github.sha }} - overwrite: true - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ test-coverage-report ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} - - failed-workflow: - name: Failed workflow tasks - runs-on: ubuntu-latest - permissions: - actions: write - needs: [ slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - contains( needs.*.result, 'cancelled' ) || - contains( needs.*.result, 'failure' ) - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'failed-workflow.yml', - ref: 'trunk', - inputs: { - run_id: '${{ github.run_id }}' - } - }); diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml deleted file mode 100644 index a7dc0210f58a7..0000000000000 --- a/.github/workflows/test-old-branches.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Test old branches - -on: - # Verify the workflow is successful when this file is updated. - push: - branches: - - trunk - paths: - - '.github/workflows/test-old-branches.yml' - # Run twice a month on the 1st and 15th at 00:00 UTC. - schedule: - - cron: '0 0 1 * *' - - cron: '0 0 15 * *' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -env: - CURRENTLY_SUPPORTED_BRANCH: '6.4' - -jobs: - dispatch-workflows-for-old-branches: - name: ${{ matrix.workflow }} for ${{ matrix.branch }} - runs-on: ubuntu-latest - permissions: - actions: write - timeout-minutes: 20 - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - strategy: - fail-fast: false - matrix: - workflow: [ - 'coding-standards.yml', - 'javascript-tests.yml', - 'phpunit-tests.yml', - 'test-npm.yml' - ] - branch: [ - '6.4', '6.3', '6.2', '6.1','6.0', - '5.9', '5.8', '5.7', '5.6', '5.5', '5.4', '5.3', '5.2', '5.1', '5.0', - '4.9', '4.8', '4.7', '4.6', '4.5', '4.4', '4.3', '4.2', '4.1' - ] - include: - # PHP Compatibility testing was introduced in 5.5. - - branch: '6.4' - workflow: 'php-compatibility.yml' - - branch: '6.3' - workflow: 'php-compatibility.yml' - - branch: '6.2' - workflow: 'php-compatibility.yml' - - branch: '6.1' - workflow: 'php-compatibility.yml' - - branch: '6.0' - workflow: 'php-compatibility.yml' - - branch: '5.9' - workflow: 'php-compatibility.yml' - - branch: '5.8' - workflow: 'php-compatibility.yml' - - branch: '5.7' - workflow: 'php-compatibility.yml' - - branch: '5.6' - workflow: 'php-compatibility.yml' - - branch: '5.5' - workflow: 'php-compatibility.yml' - - # End-to-end testing was introduced in 5.3 but was later removed as there were no meaningful assertions. - # Starting in 5.8 with #52905, some additional tests with real assertions were introduced. - # Branches 5.8 and newer should be tested to confirm no regressions are introduced. - - branch: '6.4' - workflow: 'end-to-end-tests.yml' - - branch: '6.3' - workflow: 'end-to-end-tests.yml' - - branch: '6.2' - workflow: 'end-to-end-tests.yml' - - branch: '6.1' - workflow: 'end-to-end-tests.yml' - - branch: '6.0' - workflow: 'end-to-end-tests.yml' - - branch: '5.9' - workflow: 'end-to-end-tests.yml' - - branch: '5.8' - workflow: 'end-to-end-tests.yml' - - # Performance testing was introduced in 6.2. - - branch: '6.4' - workflow: 'performance.yml' - - branch: '6.3' - workflow: 'performance.yml' - - branch: '6.2' - workflow: 'performance.yml' - - # Run all branches monthly, but only the currently supported one twice per month. - steps: - - name: Dispatch workflow run - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - if: ${{ github.event_name == 'push' || github.event.schedule == '0 0 15 * *' || matrix.branch == env.CURRENTLY_SUPPORTED_BRANCH }} - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: '${{ matrix.workflow }}', - ref: '${{ matrix.branch }}' - }); - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ dispatch-workflows-for-old-branches ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}