Make WordPress Core


Ignore:
Timestamp:
08/01/2025 12:42:18 PM (8 months ago)
Author:
desrosj
Message:

Build/Test Tools: Spawn fewer jobs in GitHub Actions on forks.

The GitHub Actions workflows currently limit when jobs run for forks by short-circuiting any that are triggered by push events when not running within the wordpress-develop repository.

Because the large majority of forks are not created under organizations, they will be subject to the individual account limit of 20 concurrent jobs (40 for pro accounts) at any given time instead of the 500 concurrent job limit that applies to the WordPress organization. This means that a single pull request back to a fork can take several hours to complete the workflow jobs that are spawned.

This revises the conditional statements to further limit the number of jobs that spawn within a fork while still allowing the full test matrices for forks within the WordPress organization and pull requests back to wordpress-develop.

These adjustments result in a maximum of 53 jobs when all workflows configured to run within forks are triggered. Of these, ~66% will run in less than 3 minutes, and ~55% will run in less than 1 minute.

Props jorbin, johnbillion.
Fixes #63752.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/upgrade-develop-testing.yml

    r60321 r60534  
    4848    name: Build
    4949    uses: ./.github/workflows/reusable-build-package.yml
     50    if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) }}
    5051    permissions:
    5152      contents: read
     
    5556    name: Upgrade from ${{ matrix.wp }}
    5657    uses: ./.github/workflows/reusable-upgrade-testing.yml
    57     if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
     58    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    5859    needs: [ build ]
    5960    strategy:
     
    7576          - php: '8.4'
    7677            wp: '4.9'
     78    with:
     79      os: ${{ matrix.os }}
     80      php: ${{ matrix.php }}
     81      db-type: ${{ matrix.db-type }}
     82      db-version: ${{ matrix.db-version }}
     83      wp: ${{ matrix.wp }}
     84      new-version: develop
     85      multisite: ${{ matrix.multisite }}
     86
     87  # Run a limited set of upgrade tests for the current branch on forks.
     88  upgrade-tests-develop-forks:
     89    name: Upgrade from ${{ matrix.wp }}
     90    uses: ./.github/workflows/reusable-upgrade-testing.yml
     91    if: ${{ github.repository != 'WordPress/wordpress-develop' }}
     92    needs: [ build ]
     93    strategy:
     94      fail-fast: false
     95      matrix:
     96        os: [ 'ubuntu-24.04' ]
     97        php: [ '7.2', '8.4' ]
     98        db-type: [ 'mysql' ]
     99        db-version: [ '8.4' ]
     100        # WordPress 4.9 is the oldest version that supports PHP 7.2.
     101        wp: [ '6.7', '6.8' ]
     102        multisite: [ false, true ]
     103
     104        exclude:
     105          # 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.
     106          - php: '7.2'
     107            db-version: '8.4'
    77108    with:
    78109      os: ${{ matrix.os }}
Note: See TracChangeset for help on using the changeset viewer.