From d772150cef99ea781675b5e1fb578b416d3a3ce5 Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Wed, 5 Apr 2023 22:49:58 +0100 Subject: [PATCH] Don't cancel GHA runs on subsequent push events With our switch to using the GitHub merge queue with speculative merging, it's now possible for us to have two push events to a protected branch (like `main`) within a couple of minutes. If this happens, the eager cancellation rules we have set for the coverage and Neko runs in GHA trigger, causing a spurious build failure to appear in the commit logs, and for the coverage history to be lost for one commit. Instead, we can set the cancel-on-update behaviour to only trigger on PR sync events, not branch-push events. --- .github/workflows/coverage.yml | 4 +++- .github/workflows/neko.yml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3ab62d80eb44..7bef242ba019 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -5,7 +5,9 @@ on: branches: ['main'] concurrency: group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true + # Only cancel in PR mode. In push mode, don't cancel so we don't see spurious test "failures", + # and we get coverage reports on Coveralls for every push. + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: coverage: name: Coverage diff --git a/.github/workflows/neko.yml b/.github/workflows/neko.yml index 74b697d2533a..9af0ced078ba 100644 --- a/.github/workflows/neko.yml +++ b/.github/workflows/neko.yml @@ -5,7 +5,8 @@ on: branches: ['main', 'stable/*'] concurrency: group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true + # Only cancel in PR mode. In push mode, don't cancel so we don't see spurious test "failures". + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: neko: name: Qiskit Neko Integration Tests