diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ad81be3290..7f04b14183 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -34,6 +34,13 @@ on: - '.github/workflows/*.yml' workflow_dispatch: +# 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: # Runs PHP coding standards checks. # diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 0a59c51a4c..2be14d9a2c 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -19,6 +19,13 @@ on: - '[6-9].[0-9]' workflow_dispatch: +# 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 + env: LOCAL_DIR: build @@ -26,7 +33,6 @@ jobs: # Runs the end-to-end test suite. # # Performs the following steps: - # - Cancels all previous workflow runs for pull requests that have not completed. # - Set environment variables. # - Checks out the repository. # - Logs debug information about the runner container. @@ -47,10 +53,6 @@ jobs: if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 - - name: Configure environment variables run: | echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 0bf9f5a461..335812b61f 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -32,11 +32,17 @@ on: - '.github/workflows/*.yml' workflow_dispatch: +# 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: # Runs the QUnit tests for WordPress. # # Performs the following steps: - # - Cancels all previous workflow runs for pull requests that have not completed. # - Checks out the repository. # - Logs debug information about the runner container. # - Installs NodeJS 14. @@ -51,10 +57,6 @@ jobs: if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 - - name: Checkout repository uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 78b63abccf..b7c35fdd9f 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -28,6 +28,13 @@ on: - '.github/workflows/*.yml' workflow_dispatch: +# 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: # Runs PHP compatibility testing. diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 926ff6e94d..1fd865823f 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -21,6 +21,13 @@ on: schedule: - cron: '0 0 * * 0' +# 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 + env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} COMPOSER_INSTALL: ${{ false }} @@ -30,20 +37,6 @@ env: SLOW_TESTS: 'external-http,media,restapi' jobs: - # Sets up the workflow for testing. - # - # Performs the following steps: - # - Cancels all previous workflow runs for pull requests that have not completed. - setup-workflow: - name: Setup Workflow - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 - # Runs the PHPUnit tests for WordPress. # # Performs the following steps: diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index ceefcdbb5d..ce16cb2815 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -25,24 +25,17 @@ on: - '.github/workflows/**.yml' workflow_dispatch: +# 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 + env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} jobs: - # Prepares the workflow. - # - # Performs the following steps: - # - Cancels all previous workflow runs for pull requests that have not completed. - prepare-workflow: - name: Prepare the workflow - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 - # Verifies that installing NPM dependencies and building WordPress works as expected. # # Performs the following steps: @@ -59,7 +52,6 @@ jobs: name: Test NPM on ${{ matrix.os }} runs-on: ${{ matrix.os }} if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - needs: prepare-workflow strategy: fail-fast: false matrix: @@ -134,7 +126,6 @@ jobs: name: Test NPM on MacOS runs-on: macos-latest if: ${{ github.repository == 'WordPress/wordpress-develop' }} - needs: prepare-workflow steps: - name: Checkout repository uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4