From 6fe49e4b0fca9f5101fbc99d89811344e16ab40a Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 25 Feb 2026 18:41:16 +0000 Subject: [PATCH] Trim the 6.2 workflows. --- .github/workflows/end-to-end-tests.yml | 1 + .github/workflows/failed-workflow.yml | 48 ---- .github/workflows/phpunit-tests.yml | 3 +- .github/workflows/slack-notifications.yml | 209 ----------------- .../workflows/test-and-zip-default-themes.yml | 181 --------------- .github/workflows/test-coverage.yml | 210 ------------------ .github/workflows/test-old-branches.yml | 91 -------- 7 files changed, 3 insertions(+), 740 deletions(-) delete mode 100644 .github/workflows/failed-workflow.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/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 3f47439d7ce1e..807fe9179c0dd 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -47,6 +47,7 @@ jobs: LOCAL_SCRIPT_DEBUG: [ true, false ] with: LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }} + php-version: '8.2' install-gutenberg: false install-playwright: false diff --git a/.github/workflows/failed-workflow.yml b/.github/workflows/failed-workflow.yml deleted file mode 100644 index d64149e2835b9..0000000000000 --- a/.github/workflows/failed-workflow.yml +++ /dev/null @@ -1,48 +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' - -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 - timeout-minutes: 5 - - steps: - - name: Rerun a workflow - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - 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: ${{ 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/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 533aef4d5c388..b5f45d4b7c32e 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -46,7 +46,8 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] + # Test highest and lowest supported version of each major. + php: [ '5.6', '7.0', '7.4', '8.0', '8.2' ] db-type: [ 'mysql' ] db-version: [ '5.7' ] multisite: [ false, true ] diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml deleted file mode 100644 index be8bdf41c0bfb..0000000000000 --- a/.github/workflows/slack-notifications.yml +++ /dev/null @@ -1,209 +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 - -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 - 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@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - 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 }}, - }); - - // When a workflow has been restarted to fix a failure, check the previous run attempt. - if ( workflow_run.data.run_attempt > 1 ) { - 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@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - 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: ${{ inputs.calling_status == 'failure' || failure() }} - - steps: - - name: Post failure notifications to Slack - uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.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@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.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@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.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@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.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 6295be7961648..0000000000000 --- a/.github/workflows/test-and-zip-default-themes.yml +++ /dev/null @@ -1,181 +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 - -jobs: - # 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 - 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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - 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 - needs: [ test-build-scripts ] - timeout-minutes: 10 - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - theme: [ - 'twentytwentythree', - 'twentytwentytwo', - 'twentytwentyone', - 'twentytwenty', - 'twentynineteen', - 'twentyseventeen', - 'twentysixteen', - 'twentyfifteen', - 'twentyfourteen', - 'twentythirteen', - 'twentytwelve', - 'twentyeleven', - 'twentyten' - ] - - steps: - - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - with: - ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} - - - name: Upload theme ZIP as an artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - 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 - needs: [ bundle-theme, test-build-scripts ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ needs.test-build-scripts.result == 'success' && needs.bundle-theme.result == 'success' && 'success' || ( needs.test-build-scripts.result == 'cancelled' || needs.bundle-theme.result == 'cancelled' ) && 'cancelled' || 'failure' }} - 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 - needs: [ test-build-scripts, bundle-theme, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - needs.test-build-scripts.result == 'cancelled' || needs.test-build-scripts.result == 'failure' || - needs.bundle-theme.result == 'cancelled' || needs.bundle-theme.result == 'failure' - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - 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 bb1cb6bf4bc8b..0000000000000 --- a/.github/workflows/test-coverage.yml +++ /dev/null @@ -1,210 +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: - -env: - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} - LOCAL_PHP: '7.4-fpm' - LOCAL_PHP_XDEBUG: true - LOCAL_PHP_XDEBUG_MODE: 'coverage' - LOCAL_PHP_MEMCACHED: ${{ false }} - -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 - runs-on: ubuntu-latest - timeout-minutes: 120 - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - strategy: - fail-fast: false - matrix: - multisite: [ false, true ] - - 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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Set up Node.js - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 - 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@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.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@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.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 - svn --version - composer --version - locale -a - - - name: Docker debug information - run: | - docker -v - docker-compose -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-clover wp-code-coverage-single-clover-${{ github.sha }}.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@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - file: wp-code-coverage-single-clover-${{ github.sha }}.xml - flags: single,php - fail_ci_if_error: true - - - name: Run tests as a multisite install - if: ${{ matrix.multisite }} - run: npm run test:php -- --verbose -c tests/phpunit/multisite.xml --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.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@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml - flags: multisite,php - fail_ci_if_error: true - - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - needs: [ test-coverage-report ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ needs.test-coverage-report.result == 'success' && 'success' || needs.test-coverage-report.result == 'cancelled' && 'cancelled' || 'failure' }} - 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 - needs: [ test-coverage-report, slack-notifications ] - if: | - always() && - github.repository == 'WordPress/wordpress-develop' && - github.event_name != 'pull_request' && - github.run_attempt < 2 && - ( - needs.test-coverage-report.result == 'cancelled' || needs.test-coverage-report.result == 'failure' - ) - - steps: - - name: Dispatch workflow run - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - 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 4a6eef39f6c8d..0000000000000 --- a/.github/workflows/test-old-branches.yml +++ /dev/null @@ -1,91 +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 * *' - -jobs: - dispatch-workflows-for-old-branches: - name: ${{ matrix.workflow }} for ${{ matrix.branch }} - runs-on: ubuntu-latest - 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.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.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.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' - - # Run all branches monthly, but only the currently supported one twice per month. - steps: - - name: Dispatch workflow run - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 - if: ${{ github.event_name == 'push' || github.event.schedule == '0 0 15 * *' || matrix.branch == '6.1' }} - 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 - needs: [ dispatch-workflows-for-old-branches ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ needs.dispatch-workflows-for-old-branches.result == 'success' && 'success' || needs.dispatch-workflows-for-old-branches.result == 'cancelled' && 'cancelled' || 'failure' }} - 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 }}