Make WordPress Core


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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: |
Note: See TracChangeset for help on using the changeset viewer.