From edde492f99343fc86f8e7ea85a372490fe70a9d5 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Wed, 6 Sep 2023 07:49:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20enable=20GitHub=20workflow=20con?= =?UTF-8?q?currency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added concurrency settings to each GitHub workflow file to prevent multiple runs of the same workflow on the same branch. This significantly optimizes resource usage, especially when multiple subsequent changes are pushed to the same branch. --- .github/workflows/clang-format.yml | 4 ++++ .github/workflows/clang-tidy-review.yml | 4 ++++ .github/workflows/codeql-analysis.yml | 4 ++++ .github/workflows/coverage.yml | 4 ++++ .github/workflows/docker-image.yml | 4 ++++ .github/workflows/macos.yml | 4 ++++ .github/workflows/release-drafter.yml | 4 ++++ .github/workflows/ubuntu.yml | 4 ++++ .github/workflows/windows.yml | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 1c137755f..305904ce9 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ 'main' ] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: clangformat: runs-on: ubuntu-latest diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index d99d4c219..b86ac987c 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -8,6 +8,10 @@ on: - 'libs/**' - '.github/workflows/clang-tidy-review.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: clangtidy: runs-on: ubuntu-latest diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 328a7b985..a7df3da47 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,6 +25,10 @@ on: schedule: - cron: '30 5 * * 6' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + env: Z3_VERSION: 4.10.0 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bd5e6ebd1..0190669ef 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,6 +21,10 @@ on: - '.github/workflows/coverage.yml' merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + defaults: run: shell: bash diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 74e5074b9..c6391053d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -23,6 +23,10 @@ on: - 'Dockerfile' merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: name: Build Docker image diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 19ed60dab..01a8de948 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -21,6 +21,10 @@ on: - '.github/workflows/macos.yml' merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + defaults: run: shell: bash diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 60c0781c2..d60382f90 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -12,6 +12,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: update_release_draft: permissions: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9f462e99c..170360eac 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -21,6 +21,10 @@ on: - '.github/workflows/ubuntu.yml' merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + defaults: run: shell: bash diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 00054c4fd..b704d0d3c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,6 +21,10 @@ on: - '.github/workflows/windows.yml' merge_group: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + defaults: run: shell: pwsh # use pwsh as directory handling does not seem to work with bash