If a new push happens to a staging branch or a PR branch, continuing to
run now-obsolete tests is pointless and wasteful. However, we do want to
finish any jobs running on previous master branch commits, so that every
master branch commit has full test results.
# test PRs targeting this branch code
branches: [ "master" ]
+concurrency:
+ # Cancel ongoing tests in case of push to the same PR or staging branch,
+ # but let previous master commit tests complete.
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
+
env:
# empty except for pull_request events
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
push:
branches: [ "auto" ]
+concurrency:
+ # Cancel ongoing tests in case of push to staging branch.
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
linux-distros: