Make WordPress Core


Ignore:
Timestamp:
08/01/2025 12:42:18 PM (10 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/test-build-processes.yml

    r60080 r60534  
    4646
    4747jobs:
    48   # Tests the WordPress Core build process on multiple operating systems.
     48  # Tests the WordPress Core build process.
    4949  test-core-build-process:
    5050    name: Core running from ${{ matrix.directory }}
     
    5656      fail-fast: false
    5757      matrix:
    58         os: [ ubuntu-24.04, windows-2022 ]
     58        os: [ 'ubuntu-24.04' ]
    5959        directory: [ 'src', 'build' ]
    6060        include:
    6161          # Only prepare artifacts for Playground once.
    62           - os: ubuntu-24.04
     62          - os: 'ubuntu-24.04'
    6363            directory: 'build'
    6464            save-build: true
    6565            prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }}
    66 
    6766    with:
    6867      os: ${{ matrix.os }}
     
    7170      prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }}
    7271
    73   # Tests the WordPress Core build process on MacOS.
     72  # Tests the WordPress Core build process on additional operating systems.
    7473  #
    75   # This is separate from the job above in order to use stricter conditions when determining when to run.
    76   # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
     74  # This is separate from the job above in order to use stricter conditions when determining when to test additional
     75  # operating systems. This avoids unintentionally consuming excessive minutes. Windows-based jobs consume minutes at a
     76  # 2x rate, and MacOS-based jobs at a 10x rate.
     77  # See https://docs.github.com/en/billing/concepts/product-billing/github-actions#per-minute-rates.
    7778  #
    7879  # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
    7980  # currently no way to determine the OS being used on a given job.
    8081  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    81   test-core-build-process-macos:
     82  test-core-build-process-additional-os:
    8283    name: Core running from ${{ matrix.directory }}
    8384    uses: ./.github/workflows/reusable-test-core-build-process.yml
     
    8889      fail-fast: false
    8990      matrix:
    90         os: [ macos-14 ]
     91        os: [ 'macos-14', 'windows-2022' ]
    9192        directory: [ 'src', 'build' ]
    9293    with:
     
    9495      directory: ${{ matrix.directory }}
    9596
    96   # Tests the Gutenberg plugin build process on multiple operating systems when run within a wordpress-develop checkout.
     97  # Tests the Gutenberg plugin build process within a wordpress-develop checkout.
    9798  test-gutenberg-build-process:
    98     name: Gutenberg running from ${{ matrix.directory }}
    99     uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml
    100     permissions:
    101       contents: read
    102     if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
    103     strategy:
    104       fail-fast: false
    105       matrix:
    106         os: [ ubuntu-24.04, windows-2022 ]
    107         directory: [ 'src', 'build' ]
    108     with:
    109       os: ${{ matrix.os }}
    110       directory: ${{ matrix.directory }}
    111 
    112   # Tests the Gutenberg plugin build process on MacOS when run within a wordpress-develop checkout.
    113   #
    114   # This is separate from the job above in order to use stricter conditions when determining when to run.
    115   # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    116   #
    117   # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
    118   # currently no way to determine the OS being used on a given job.
    119   # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    120   test-gutenberg-build-process-macos:
    12199    name: Gutenberg running from ${{ matrix.directory }}
    122100    uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml
     
    127105      fail-fast: false
    128106      matrix:
    129         os: [ macos-14 ]
     107        os: [ 'ubuntu-24.04' ]
     108        directory: [ 'src', 'build' ]
     109    with:
     110      os: ${{ matrix.os }}
     111      directory: ${{ matrix.directory }}
     112
     113  # Tests the Gutenberg plugin build process on additional operating systems.
     114  #
     115  # This is separate from the job above in order to use stricter conditions when determining when to test additional
     116  # operating systems. This avoids unintentionally consuming excessive minutes. Windows-based jobs consume minutes at a
     117  # 2x rate, and MacOS-based jobs at a 10x rate.
     118  # See https://docs.github.com/en/billing/concepts/product-billing/github-actions#per-minute-rates.
     119  #
     120  # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
     121  # currently no way to determine the OS being used on a given job.
     122  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
     123  test-gutenberg-build-process-additional-os:
     124    name: Gutenberg running from ${{ matrix.directory }}
     125    uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml
     126    permissions:
     127      contents: read
     128    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
     129    strategy:
     130      fail-fast: false
     131      matrix:
     132        os: [ 'macos-14', 'windows-2022' ]
    130133        directory: [ 'src', 'build' ]
    131134    with:
     
    139142      actions: read
    140143      contents: read
    141     needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ]
     144    needs: [ test-core-build-process, test-core-build-process-additional-os, test-gutenberg-build-process, test-gutenberg-build-process-additional-os ]
    142145    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    143146    with:
Note: See TracChangeset for help on using the changeset viewer.