Skip to content

Commit

Permalink
Add concurrency configuration to all workflows
Browse files Browse the repository at this point in the history
Configure workflows such that running workflows will be cancelled when a
new workflow is triggered. See [1] for documentation.

[1]: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
  • Loading branch information
larsks committed Nov 4, 2024
1 parent a8a190a commit 6e6053b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ name: Build container image
# documentation.

on:
push:
branches: [main]
# Publish semver tags as releases.
tags: ['v*.*.*']
pull_request:
branches: [main]
workflow_call:
# push:
# branches: [main]
# # Publish semver tags as releases.
# tags: ['v*.*.*']
# pull_request:
# branches: [main]

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

env:
# Use docker.io for Docker Hub if empty
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/precommit.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Run pre-commit checks

on:
push:
pull_request:
workflow_call:
# push:
# pull_request:

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

jobs:
run-linters:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Run tests

on:
push:
pull_request:
workflow_call:
# push:
# pull_request:

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

jobs:
run-tests:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/validate-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
default: main
required: false

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

jobs:
validate-manifests:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6e6053b

Please sign in to comment.