Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Cancel previous jobs if PR/branch is updated #2129

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/azure-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
type: string
description: prebuilt caa image

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

jobs:
build-caa-container-image:
if: github.event.inputs.caa-image == ''
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/azure-nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
# will base on default branch `main`
- cron: '0 3 * * *'

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

jobs:
generate-podvm-image-version:
if: github.event.inputs.podvm-image-id == ''
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/azure-podvm-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ env:
UPLOSI_SHA256: "687bcab7398ab0fda65a3809492e8cd4d6a25aad1573927be5ec75ac1c4cbc35"
IMAGE_ID: "/CommunityGalleries/${{ vars.AZURE_COMMUNITY_GALLERY_NAME }}/Images/${{ vars.AZURE_PODVM_IMAGE_DEF_NAME }}/Versions/${{ inputs.image-version }}"

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

jobs:
build-podvm-image:
runs-on: ubuntu-22.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-golang-fedora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: "The tag part of the container image name"
default: ""

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

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
pull_request:
workflow_dispatch:

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

jobs:
caa:
name: cloud-api-adaptor
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/commit-message-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:

https://github.com/confidential-containers/confidential-containers/blob/main/CONTRIBUTING.md#patch-format

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

jobs:
commit-message-check:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/daily-e2e-tests-ibmcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- cron: '0 5 * * *'
workflow_dispatch:

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

jobs:
daily-e2e-tests:
name: e2e tests
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/daily-e2e-tests-libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- cron: '15 4 * * *'
workflow_dispatch:

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

jobs:
e2e:
uses: ./.github/workflows/e2e_run_all.yaml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e_on_pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
branches:
- 'main'

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

jobs:
authorize:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
workflow_dispatch:

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

jobs:
checklinks:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
pull_request:
workflow_dispatch:

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

jobs:
vet-and-fmt:
name: vet and fmt
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/publish_images_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ on:
push:
branches:
- 'main'

workflow_dispatch:

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

jobs:
caa:
uses: ./.github/workflows/caa_build_and_push_per_arch.yaml
Expand All @@ -31,7 +34,7 @@ jobs:
with:
image_tags: latest,${{ github.sha }}
git_ref: ${{ github.sha }}
secrets: inherit
secrets: inherit

webhook:
uses: ./.github/workflows/webhook_image.yaml
Expand Down
Loading