From 3ec097673682fbb46dd017c1b838f71d981ce44d Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Mon, 26 Oct 2026 09:40:07 +0100 Subject: [PATCH] ci: avoid duplicate and outdated workflow runs CI ran on pushes to every branch, so a branch with an open PR ran each workflow twice. Now, CI runs for PRs, the merge queue, and pushes to main. A newer push to a PR or merge queue entry cancels the outdated run. Runs on main are not cancelled, so every commit on main gets a result. --- .github/workflows/integrationtest.yml | 10 +++++++--- .github/workflows/qa.yml | 9 +++++++-- .github/workflows/rust.yml | 11 ++++++++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integrationtest.yml b/.github/workflows/integrationtest.yml index ceef0533..4bcd8e1d 100644 --- a/.github/workflows/integrationtest.yml +++ b/.github/workflows/integrationtest.yml @@ -6,11 +6,15 @@ # Instead, it is the right thing that the CI always covers the whole repository # and that it is as stable as possible. name: "Integration Test" -# Run on every push (tag, branch) and pull_request -on: [pull_request, push, merge_group] +on: + merge_group: + pull_request: + push: + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }} - cancel-in-progress: true + # Keep a result for every commit on main. + cancel-in-progress: ${{ github.event_name != 'push' }} env: CARGO_TERM_COLOR: always jobs: diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 7b0d7f0c..3ecbcb1b 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -1,8 +1,13 @@ name: QA -on: [pull_request, push, merge_group] +on: + merge_group: + pull_request: + push: + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }} - cancel-in-progress: true + # Keep a result for every commit on main. + cancel-in-progress: ${{ github.event_name != 'push' }} jobs: spellcheck: name: Spellcheck diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cd6f92a2..c127732a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -6,11 +6,16 @@ # Instead, it is the right thing that the CI always covers the whole repository # and that it is as stable as possible. name: "Cargo workspace" -# Run on every push (tag, branch) and pull_request -on: [pull_request, push, workflow_dispatch, merge_group] +on: + merge_group: + pull_request: + push: + branches: [main] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }} - cancel-in-progress: true + # Keep a result for every commit on main. + cancel-in-progress: ${{ github.event_name != 'push' }} env: CARGO_TERM_COLOR: always jobs: