Skip to content

Commit

Permalink
Don't cancel GHA runs on subsequent push events (#9917)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakelishman committed Apr 6, 2023
1 parent e063739 commit fe2f0f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/neko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe2f0f2

Please sign in to comment.