Make WordPress Core

Changeset 50930


Ignore:
Timestamp:
05/19/2021 05:36:54 PM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Use the new concurrency setting for GitHub Actions.

The new concurrency setting can be used to ensure only a single workflow run or job is in progress. When used in combination with the cancel-in-progress setting, incomplete workflow runs can be cancelled automatically to prevent running workflows unnecessarily.

The workflows that take longer to run previously had this built into a step and utilized a 3rd-party action. Now that this is natively supported by GitHub Actions, using that is preferred.

This option is currently in beta, but is stable enough to use in our workflows for the time being.

Props ocean90.
Fixes #53080.

Location:
trunk/.github/workflows
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/coding-standards.yml

    r50590 r50930  
    3434      - '.github/workflows/*.yml'
    3535  workflow_dispatch:
     36
     37# Cancels all previous workflow runs for pull requests that have not completed.
     38concurrency:
     39  # The concurrency group contains the workflow name and the branch name for pull requests
     40  # or the commit hash for any other events.
     41  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     42  cancel-in-progress: true
    3643
    3744jobs:
  • trunk/.github/workflows/end-to-end-tests.yml

    r50590 r50930  
    2020  workflow_dispatch:
    2121
     22# Cancels all previous workflow runs for pull requests that have not completed.
     23concurrency:
     24  # The concurrency group contains the workflow name and the branch name for pull requests
     25  # or the commit hash for any other events.
     26  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     27  cancel-in-progress: true
     28
    2229env:
    2330  LOCAL_DIR: build
     
    2734  #
    2835  # Performs the following steps:
    29   # - Cancels all previous workflow runs for pull requests that have not completed.
    3036  # - Set environment variables.
    3137  # - Checks out the repository.
     
    4854
    4955    steps:
    50       - name: Cancel previous runs of this workflow (pull requests only)
    51         if: ${{ github.event_name == 'pull_request' }}
    52         uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
    53 
    5456      - name: Configure environment variables
    5557        run: |
  • trunk/.github/workflows/javascript-tests.yml

    r50590 r50930  
    3333  workflow_dispatch:
    3434
     35# Cancels all previous workflow runs for pull requests that have not completed.
     36concurrency:
     37  # The concurrency group contains the workflow name and the branch name for pull requests
     38  # or the commit hash for any other events.
     39  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     40  cancel-in-progress: true
     41
    3542jobs:
    3643  # Runs the QUnit tests for WordPress.
    3744  #
    3845  # Performs the following steps:
    39   # - Cancels all previous workflow runs for pull requests that have not completed.
    4046  # - Checks out the repository.
    4147  # - Logs debug information about the runner container.
     
    5258
    5359    steps:
    54       - name: Cancel previous runs of this workflow (pull requests only)
    55         if: ${{ github.event_name == 'pull_request' }}
    56         uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
    57 
    5860      - name: Checkout repository
    5961        uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
  • trunk/.github/workflows/php-compatibility.yml

    r50590 r50930  
    2828      - '.github/workflows/*.yml'
    2929  workflow_dispatch:
     30
     31# Cancels all previous workflow runs for pull requests that have not completed.
     32concurrency:
     33  # The concurrency group contains the workflow name and the branch name for pull requests
     34  # or the commit hash for any other events.
     35  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     36  cancel-in-progress: true
    3037
    3138jobs:
  • trunk/.github/workflows/phpunit-tests.yml

    r50704 r50930  
    2222    - cron: '0 0 * * 0'
    2323
     24# Cancels all previous workflow runs for pull requests that have not completed.
     25concurrency:
     26  # The concurrency group contains the workflow name and the branch name for pull requests
     27  # or the commit hash for any other events.
     28  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     29  cancel-in-progress: true
     30
    2431env:
    2532  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     
    3138
    3239jobs:
    33   # Sets up the workflow for testing.
    34   #
    35   # Performs the following steps:
    36   # - Cancels all previous workflow runs for pull requests that have not completed.
    37   setup-workflow:
    38     name: Setup Workflow
    39     runs-on: ubuntu-latest
    40     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    41 
    42     steps:
    43       - name: Cancel previous runs of this workflow (pull requests only)
    44         if: ${{ github.event_name == 'pull_request' }}
    45         uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
    46 
    4740  # Runs the PHPUnit tests for WordPress.
    4841  #
  • trunk/.github/workflows/test-npm.yml

    r50796 r50930  
    2626  workflow_dispatch:
    2727
     28# Cancels all previous workflow runs for pull requests that have not completed.
     29concurrency:
     30  # The concurrency group contains the workflow name and the branch name for pull requests
     31  # or the commit hash for any other events.
     32  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     33  cancel-in-progress: true
     34
    2835env:
    2936  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    3037
    3138jobs:
    32   # Prepares the workflow.
    33   #
    34   # Performs the following steps:
    35   # - Cancels all previous workflow runs for pull requests that have not completed.
    36   prepare-workflow:
    37     name: Prepare the workflow
    38     runs-on: ubuntu-latest
    39     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    40 
    41     steps:
    42       - name: Cancel previous runs of this workflow (pull requests only)
    43         if: ${{ github.event_name == 'pull_request' }}
    44         uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
    45 
    4639  # Verifies that installing NPM dependencies and building WordPress works as expected.
    4740  #
     
    6053    runs-on: ${{ matrix.os }}
    6154    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    62     needs: prepare-workflow
    6355    strategy:
    6456      fail-fast: false
     
    135127    runs-on: macos-latest
    136128    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    137     needs: prepare-workflow
    138129    steps:
    139130      - name: Checkout repository
Note: See TracChangeset for help on using the changeset viewer.