Skip to content

Commit

Permalink
[ci] Specify limited concurrency for PR jobs (#31240)
Browse files Browse the repository at this point in the history
There was a concurrency setting we hadn't enabled on jobs that are
primarily triggered for PRs. This meant that every update to the PR
would trigger new CI jobs without canceling any ones already in flight,
which can greatly slow down CI due to the number of jobs that need to
run.

This PR adds concurrency [based on the workflow name and PR number or
head
ref.](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs)
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31240).
* __->__ #31240
* #31239
  • Loading branch information
poteto authored Oct 14, 2024
1 parent cbcc1d2 commit 6cf8518
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/compiler_playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- compiler/**
- .github/workflows/compiler-playground.yml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/compiler_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- compiler/Cargo.*
- compiler/*.toml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/compiler_typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- compiler/**
- .github/workflows/compiler_typescript.yml

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
paths-ignore:
- compiler/**

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/shared_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true

env:
TZ: /usr/share/zoneinfo/America/Los_Angeles
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
Expand Down

0 comments on commit 6cf8518

Please sign in to comment.