From 4843e9ad5f75789ef36bd2461c92a8164cd6cfc0 Mon Sep 17 00:00:00 2001 From: Erik Jaegervall Date: Thu, 7 Sep 2023 13:46:23 +0200 Subject: [PATCH] Add cancel-in-progress Related to https://github.com/eclipse/kuksa.val/issues/626 --- .../workflows/{check_license.yaml => check_license.yml} | 5 +++++ .github/workflows/check_push_rights.yml | 9 +++++++++ .github/workflows/kuksa_csv_provider.yml | 4 ++++ .github/workflows/kuksa_dbc_feeder.yml | 4 ++++ .github/workflows/kuksa_dds_feeder.yml | 4 ++++ .github/workflows/kuksa_gps_feeder.yml | 4 ++++ .github/workflows/pre-commit.yml | 6 ++++++ .github/workflows/someip2val_build.yml | 4 ++++ 8 files changed, 40 insertions(+) rename .github/workflows/{check_license.yaml => check_license.yml} (86%) diff --git a/.github/workflows/check_license.yaml b/.github/workflows/check_license.yml similarity index 86% rename from .github/workflows/check_license.yaml rename to .github/workflows/check_license.yml index 3f4ac66d..831dc45f 100755 --- a/.github/workflows/check_license.yaml +++ b/.github/workflows/check_license.yml @@ -3,9 +3,14 @@ name: spdx on: pull_request +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: check-spdx-headers: runs-on: ubuntu-latest + steps: - name: Checkout code diff --git a/.github/workflows/check_push_rights.yml b/.github/workflows/check_push_rights.yml index c211b452..1bb76b8b 100644 --- a/.github/workflows/check_push_rights.yml +++ b/.github/workflows/check_push_rights.yml @@ -5,10 +5,19 @@ on: description: "In possession of ghcr.io tokens?" value: ${{ jobs.check_push_rights.outputs.have_secrets }} + +# No concurrency group or cancel-in-progress here as this workflow is called from other workflows +# so if you have a concurrency definition here it will be considered as a deadlock and job dismissed +# The job below is also very fast, so no real need for cancel-in-progress + jobs: check_push_rights: runs-on: ubuntu-latest + concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-check_push_rights + cancel-in-progress: true + outputs: have_secrets: ${{ steps.check-secrets.outputs.have_secrets }} diff --git a/.github/workflows/kuksa_csv_provider.yml b/.github/workflows/kuksa_csv_provider.yml index 04393ec1..8df24397 100644 --- a/.github/workflows/kuksa_csv_provider.yml +++ b/.github/workflows/kuksa_csv_provider.yml @@ -24,6 +24,10 @@ on: - "csv_provider/**" workflow_dispatch: +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: checkrights: uses: ./.github/workflows/check_push_rights.yml diff --git a/.github/workflows/kuksa_dbc_feeder.yml b/.github/workflows/kuksa_dbc_feeder.yml index 967a3c6f..de33527d 100644 --- a/.github/workflows/kuksa_dbc_feeder.yml +++ b/.github/workflows/kuksa_dbc_feeder.yml @@ -24,6 +24,10 @@ on: - "dbc2val/**" workflow_dispatch: +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: checkrights: uses: ./.github/workflows/check_push_rights.yml diff --git a/.github/workflows/kuksa_dds_feeder.yml b/.github/workflows/kuksa_dds_feeder.yml index 55884a82..b328a071 100644 --- a/.github/workflows/kuksa_dds_feeder.yml +++ b/.github/workflows/kuksa_dds_feeder.yml @@ -22,6 +22,10 @@ on: - "dds2val/**" workflow_dispatch: +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: check-dds-feeder: name: "Check DDS feeder" diff --git a/.github/workflows/kuksa_gps_feeder.yml b/.github/workflows/kuksa_gps_feeder.yml index fbc33445..ecbbbceb 100644 --- a/.github/workflows/kuksa_gps_feeder.yml +++ b/.github/workflows/kuksa_gps_feeder.yml @@ -11,6 +11,10 @@ on: - "gps2val/**" workflow_dispatch: +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + env: EPHEMERAL_IMAGE: "ttl.sh/kuksa.val.feeders/gps-${{ github.sha }}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ed904dee..c94edd7e 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,9 +2,15 @@ name: pre-commit on: [pull_request] +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + + jobs: pre-commit: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/someip2val_build.yml b/.github/workflows/someip2val_build.yml index 34cd315a..cb86c3f8 100644 --- a/.github/workflows/someip2val_build.yml +++ b/.github/workflows/someip2val_build.yml @@ -28,6 +28,10 @@ on: required: false default: 'false' +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + jobs: checkrights: