Change: [Actions] cancel previous run if pushing new PR

Lately we had a few times that people pushed to their PR branch
a few times to make small changes. Sadly, this triggers all CIs
every time, which takes ~20 minutes. As we are limited in the
amount of runners we get assigned to us, this means all other CI,
even for other repositories within OpenTTD, are delayed too.

We can avoid this by simply cancelling old runs when a new PR is
pushed. There is a downside: sometimes people already push a new
commit, but still want to know if the old one passed. That will
no longer be possible with this change.
pull/491/head
Patric Stout 1 year ago committed by Patric Stout
parent b0542c8c49
commit 6fcc8727f5

@ -9,6 +9,10 @@ on:
env:
CTEST_OUTPUT_ON_FAILURE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
emscripten:
name: Emscripten

@ -9,6 +9,10 @@ on:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
analyze:
name: Analyze

@ -3,6 +3,10 @@ name: Commit checker
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
commit-checker:
name: Commit checker

@ -3,6 +3,10 @@ name: Unused strings
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
unused-strings:
name: Unused strings

Loading…
Cancel
Save