From 895aa1ef305782237fc1972545174f43f149788a Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 26 Sep 2024 14:30:02 +0200 Subject: [PATCH] fix concurrency Signed-off-by: Martijn Govers --- .github/workflows/clang-tidy.yml | 12 +++++++++++- .github/workflows/main.yml | 20 ++++++++++++++++++-- .github/workflows/nightly.yml | 3 +++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 87b6c597b..169d04d7a 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -20,6 +20,11 @@ on: type: string description: "The CMake target to run (e.g.: all)" required: true + cancel_in_progress: + type: boolean + description: Cancel this action if a newer one is kicked off + default: true + required: false # run this workflow manually from the Actions tab workflow_dispatch: inputs: @@ -33,10 +38,15 @@ on: - power_grid_model_api_tests - all power_grid_model_benchmark_cpp required: true + cancel_in_progress: + type: boolean + description: Cancel this action if a newer one is kicked off + default: true + required: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name != 'workflow_call' }} # parent workflow dictates concurrency + cancel-in-progress: ${{ github.event.inputs.cancel_in_progress }} jobs: clang-tidy: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13ac2de92..f93cfc97a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,18 +16,34 @@ on: merge_group: # run pipeline from another workflow workflow_call: + inputs: + create_release: + type: boolean + description: Create a (pre-)release when CI passes + default: false + required: false + cancel_in_progress: + type: boolean + description: Cancel this action if a newer one is kicked off + default: true + required: false # run this workflow manually from the Actions tab workflow_dispatch: inputs: create_release: type: boolean description: Create a (pre-)release when CI passes - default: true + default: false required: true + cancel_in_progress: + type: boolean + description: Cancel this action if a newer one is kicked off + default: true + required: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name != 'workflow_call' }} # parent workflow dictates concurrency + cancel-in-progress: ${{ github.event.inputs.cancel_in_progress }} jobs: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9a97673a0..657b1cde4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,6 +19,9 @@ jobs: uses: "./.github/workflows/main.yml" permissions: contents: write + with: + create_release: false + cancel_in_progress: false clang-tidy: uses: "./.github/workflows/clang-tidy.yml"