Skip to content

Commit

Permalink
[github-actions] use concurrency feature to cancel oustanding jobs (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhui authored Sep 15, 2022
1 parent b11121b commit b5ea9c8
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 96 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Build

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

pretty:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Docker

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

buildx:
name: buildx-${{ matrix.docker_name }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
#

name: CIFuzz

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

jobs:
Fuzzing:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/makefile-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Makefile Check

on: [push, pull_request]

jobs:
cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

jobs:
makefile-check:
runs-on: ubuntu-20.04
steps:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/otbr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Border Router

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

backbone-router:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/otci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: OTCI

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

cli-sim:
name: cli-sim VIRTUAL_TIME=${{ matrix.virtual_time }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/otns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ name: OTNS

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

env:
COVERAGE: 1
REFERENCE_DEVICE: 1
Expand All @@ -40,14 +44,6 @@ env:

jobs:

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"

unittests:
name: Unittests
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: POSIX

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

expects-linux:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/simulation-1.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Simulation 1.1

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

distcheck:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/simulation-1.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Simulation 1.3

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

thread-1-3:
name: thread-1-3-${{ matrix.compiler.c }}-${{ matrix.arch }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Size

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

size-report:
runs-on: ubuntu-20.04
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/toranj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: Toranj

on: [push, pull_request]

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
jobs:

toranj-ncp:
name: toranj-ncp-${{ matrix.TORANJ_RADIO }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ name: API Version

on: [pull_request]

jobs:
cancel-previous-runs:
runs-on: ubuntu-20.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/openthread' && github.run_id) || github.ref }}
cancel-in-progress: true

jobs:
api-version:
runs-on: ubuntu-20.04
steps:
Expand Down

0 comments on commit b5ea9c8

Please sign in to comment.