Add cancel-in-progress concurrency to reusable CI

Superseded CI runs on the same ref keep consuming runners and delay
feedback on the latest push. Add a job-level concurrency group keyed
on github.workflow and github.ref so a new push cancels the in-flight
CI run for that branch.

Concurrency is set at the job level rather than the workflow level
because these are workflow_call reusable workflows: workflow-level
concurrency would resolve github.workflow against the caller's context,
collapsing unrelated callers into one group. cd-* deploy workflows are
intentionally left untouched to avoid cancelling in-flight deploys.
This commit is contained in:
Adam Moussa 2026-06-05 11:41:28 -04:00
parent 204958e8d9
commit 4a66940500
3 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,9 @@ jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: ${{ inputs.working-directory }}

View file

@ -48,6 +48,9 @@ jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4

View file

@ -60,6 +60,9 @@ jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4