Skip to content

Commit

Permalink
github-actions: Run only the latest instance of the main CI workflows (
Browse files Browse the repository at this point in the history
…#2537)

One per branch/PR for testing, docs, and codeql analysis.
Cancel old jobs, even those in progress.

Signed-off-by: Jan Vesely <[email protected]>
  • Loading branch information
jvesely authored Nov 13, 2022
1 parent df125ba commit c13a0cb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
schedule:
- cron: "14 21 * * 5"

# run only the latest instance of this workflow job for the current branch/PR
# cancel older runs
# fall back to run id if not available (run id is unique -> no cancellations)
concurrency:
group: ci-${{ github.ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pnl-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- 'v*'
pull_request:

# run only the latest instance of this workflow job for the current branch/PR
# cancel older runs
# fall back to run id if not available (run id is unique -> no cancellations)
concurrency:
group: ci-${{ github.ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
docs-build:
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ on:
- 'v**'
pull_request:

# run only the latest instance of this workflow job for the current branch/PR
# cancel older runs
# fall back to run id if not available (run id is unique -> no cancellations)
concurrency:
group: ci-${{ github.ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit c13a0cb

Please sign in to comment.