Skip to content

Commit 4e62a7e

Browse files
authored
chore(ci): optimize CI job concurrency (#3135)
This updates the `browser-test`, `ci` and `depcheck` workflows to cancel the current run if a new run is triggered on the same branch. Practically speaking, if you push to a PR branch and then push again soon thereafter, resources will be freed for CI to run on the latest push.
2 parents 7cdfcc5 + dec1d1d commit 4e62a7e

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/browser-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ permissions:
1111
contents: read
1212
actions: write
1313

14+
# Cancel in-progress runs for the same branch when a new run is started
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1419
jobs:
1520
browser-tests:
1621
timeout-minutes: 30

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ permissions:
1313
contents: read
1414
actions: write
1515

16+
# Cancel in-progress runs for the same branch when a new run is started
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1621
# This file has necessary redundancies since of github actions aren't supporting:
1722
# - the definition of macros, which could be called from each job.
1823
# - reporting the status of steps in the PR (only jobs and workflows are reported).

.github/workflows/depcheck.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
permissions:
1212
contents: read
1313

14+
# Cancel in-progress runs for the same branch when a new run is started
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1419
jobs:
1520
build:
1621
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)