Skip to content

Commit a8ad74f

Browse files
authored
Chore: optimize CI with concurrency groups (#5659)
These rules allow us to stop CI when changes get overwritten. I was pretty careful to make sure each of the rules make sense, but I could have misunderstood something. This also fixes the issue where we trigger CI twice on both push and pull request changes (#5649). Also, if you look at #5660 you'll see that CI triggers when merging into this branch so just the plain `pull_request:` works fine. --------- Signed-off-by: Connor Tsui <[email protected]>
1 parent 1174399 commit a8ad74f

16 files changed

+91
-8
lines changed

.github/workflows/bench-pr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
name: PR Benchmarks
44

5+
concurrency:
6+
# The group causes runs to queue instead of running in parallel.
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
# Don't cancel benchmarks that are already running, instead just queue them up.
9+
cancel-in-progress: false
10+
511
on:
612
pull_request:
713
types: [labeled, synchronize]

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
name: CI
22

3+
# Concurrency control:
4+
# - PRs: new commits on a feature branch will cancel in-progress (outdated) runs.
5+
# - Push to develop: runs queue sequentially, never cancelled. This allows us to have benchmarks
6+
# run on every commit for our benchmarks website.
7+
# - `workflow_dispatch`: groups by branch and queues if run on develop.
38
concurrency:
49
group: ${{ github.workflow }}-${{ github.ref }}
510
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
6-
7-
on: [push, pull_request, workflow_dispatch]
11+
on:
12+
push:
13+
branches: [develop]
14+
pull_request: { }
15+
workflow_dispatch: { }
816

917
permissions:
1018
actions: read

.github/workflows/claude.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Claude Code
22

3+
concurrency:
4+
# We shouldn't have multiple instances of Claude running on the same PR.
5+
group: ${{ github.event.issue.number || github.event.pull_request.number }}
6+
cancel-in-progress: true
7+
38
on:
49
issue_comment:
510
types: [created]

.github/workflows/docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Vortex Docs
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
37
on:
48
push:
59
branches: [develop]

.github/workflows/fuzz.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: Fuzz
22

3+
concurrency:
4+
# The group causes runs to queue instead of running in parallel.
5+
group: fuzz
6+
# This ensures each run builds on the previous run's corpus discoveries rather than losing them to
7+
# failed compare-and-swap uploads.
8+
cancel-in-progress: false
9+
310
on:
411
schedule:
512
- cron: "0 */4 * * *" # every 4 hours
6-
workflow_dispatch:
13+
workflow_dispatch: { }
714

815
jobs:
916
io_fuzz:

.github/workflows/fuzzer-fix-automation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Fuzzer Fix Automation
22

3+
concurrency:
4+
group: fuzzer-fix-${{ inputs.issue_number || github.run_id }}
5+
cancel-in-progress: true
6+
37
on:
48
workflow_dispatch:
59
inputs:

.github/workflows/labels.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: PR Labels
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
37
on:
48
pull_request:
5-
types: [opened, reopened, synchronize, labeled, unlabeled] # Trigger on these PR activities
9+
# Trigger on these PR activities
10+
types: [opened, reopened, synchronize, labeled, unlabeled]
611

712
jobs:
813
check_changelog_label:

.github/workflows/minimize_fuzz_corpus.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: Minimize Fuzz Corpus
22

3+
concurrency:
4+
# The group causes runs to queue instead of running in parallel.
5+
group: minimize-corpus
6+
# This prevents one run from overwriting another's minimization work (no compare-and-swap used).
7+
cancel-in-progress: false
8+
39
on:
4-
workflow_dispatch:
10+
workflow_dispatch: { }
511

612
jobs:
713
io_fuzz_minimize:

.github/workflows/nightly-bench.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Nightly Benchmarks
22

3+
concurrency:
4+
# The group causes runs to queue instead of running in parallel.
5+
group: nightly-bench
6+
# This queues manual triggers to run after scheduled benchmarks complete.
7+
cancel-in-progress: false
8+
39
on:
410
schedule:
511
- cron: "0 0 * * *" # daily
6-
workflow_dispatch:
12+
workflow_dispatch: { }
713

814
permissions:
915
id-token: write # enables AWS-GitHub OIDC

.github/workflows/package.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Package
22

3+
concurrency:
4+
group: package-${{ inputs.version }}
5+
cancel-in-progress: true
6+
37
on:
48
workflow_dispatch:
59
inputs:

0 commit comments

Comments
 (0)