github/workflows: Cancel when branch is updated.

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>
This commit is contained in:
David Lechner 2022-12-13 12:57:34 -06:00 committed by Damien George
parent 3c2d7563d2
commit 5608226cfd
24 changed files with 96 additions and 0 deletions

View File

@ -2,6 +2,10 @@ name: Check code formatting
on: [push, pull_request] on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04

View File

@ -12,6 +12,10 @@ on:
- 'ports/bare-arm/**' - 'ports/bare-arm/**'
- 'ports/minimal/**' - 'ports/minimal/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -5,6 +5,10 @@ on:
workflows: [Check code size] workflows: [Check code size]
types: [completed] types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
comment: comment:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -2,6 +2,10 @@ name: Check commit message formatting
on: [push, pull_request] on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -5,6 +5,10 @@ on:
paths: paths:
- docs/** - docs/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -10,6 +10,10 @@ on:
- 'py/**' - 'py/**'
- 'shared/**' - 'shared/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
embedding: embedding:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -9,6 +9,10 @@ on:
- 'tests/**' - 'tests/**'
- 'tools/**' - 'tools/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
test: test:
runs-on: ubuntu-20.04 # use 20.04 to get python2 runs-on: ubuntu-20.04 # use 20.04 to get python2

View File

@ -8,6 +8,10 @@ on:
- 'tools/**' - 'tools/**'
- ports/** - ports/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/cc3200/**' - 'ports/cc3200/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/esp32/**' - 'ports/esp32/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build_idf402: build_idf402:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/esp8266/**' - 'ports/esp8266/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/mimxrt/**' - 'ports/mimxrt/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/nrf/**' - 'ports/nrf/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/powerpc/**' - 'ports/powerpc/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -13,6 +13,10 @@ on:
- 'ports/qemu-arm/**' - 'ports/qemu-arm/**'
- 'tests/**' - 'tests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build_and_test: build_and_test:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/renesas-ra/**' - 'ports/renesas-ra/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build_renesas_ra_board: build_renesas_ra_board:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/rp2/**' - 'ports/rp2/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/samd/**' - 'ports/samd/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/stm32/**' - 'ports/stm32/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build_pyb: build_pyb:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -12,6 +12,10 @@ on:
- 'drivers/**' - 'drivers/**'
- 'ports/teensy/**' - 'ports/teensy/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -14,6 +14,10 @@ on:
- 'ports/unix/**' - 'ports/unix/**'
- 'tests/**' - 'tests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
minimal: minimal:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -11,6 +11,10 @@ on:
- 'lib/**' - 'lib/**'
- 'ports/webassembly/**' - 'ports/webassembly/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -12,6 +12,10 @@ on:
- 'ports/unix/**' - 'ports/unix/**'
- 'ports/windows/**' - 'ports/windows/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -11,6 +11,10 @@ on:
- 'lib/**' - 'lib/**'
- 'ports/zephyr/**' - 'ports/zephyr/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest