Skip to content

Commit

Permalink
github/workflows: Cancel when branch is updated.
Browse files Browse the repository at this point in the history
This adds a concurrency section to all github workflows to cancel any
in progress workflow when a branch is updated. This should cancel any
ongoing or queued workflows, e.g. when a pull request is updated.

Signed-off-by: David Lechner <david@pybricks.com>
  • Loading branch information
dlech authored and dpgeorge committed Dec 14, 2022
1 parent 3c2d756 commit 5608226
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/code_formatting.yml
Expand Up @@ -2,6 +2,10 @@ name: Check code formatting

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-22.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/code_size.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'ports/bare-arm/**'
- 'ports/minimal/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/code_size_comment.yml
Expand Up @@ -5,6 +5,10 @@ on:
workflows: [Check code size]
types: [completed]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
comment:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/commit_formatting.yml
Expand Up @@ -2,6 +2,10 @@ name: Check commit message formatting

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Expand Up @@ -5,6 +5,10 @@ on:
paths:
- docs/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/examples.yml
Expand Up @@ -10,6 +10,10 @@ on:
- 'py/**'
- 'shared/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
embedding:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mpy_format.yml
Expand Up @@ -9,6 +9,10 @@ on:
- 'tests/**'
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-20.04 # use 20.04 to get python2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports.yml
Expand Up @@ -8,6 +8,10 @@ on:
- 'tools/**'
- ports/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_cc3200.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/cc3200/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_esp32.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/esp32/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_idf402:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_esp8266.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/esp8266/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_mimxrt.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/mimxrt/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_nrf.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/nrf/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_powerpc.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/powerpc/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_qemu-arm.yml
Expand Up @@ -13,6 +13,10 @@ on:
- 'ports/qemu-arm/**'
- 'tests/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_test:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_renesas-ra.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/renesas-ra/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_renesas_ra_board:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_rp2.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/rp2/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_samd.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/samd/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_stm32.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/stm32/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_pyb:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_teensy.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'drivers/**'
- 'ports/teensy/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_unix.yml
Expand Up @@ -14,6 +14,10 @@ on:
- 'ports/unix/**'
- 'tests/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
minimal:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_webassembly.yml
Expand Up @@ -11,6 +11,10 @@ on:
- 'lib/**'
- 'ports/webassembly/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_windows.yml
Expand Up @@ -12,6 +12,10 @@ on:
- 'ports/unix/**'
- 'ports/windows/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ports_zephyr.yml
Expand Up @@ -11,6 +11,10 @@ on:
- 'lib/**'
- 'ports/zephyr/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 5608226

Please sign in to comment.