ci: Use GitHub Actions concurrency for cancelling duplicate jobs

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2021-12-17 10:50:57 -03:00 committed by Xiang Xiao
parent 7ba6f7cdb3
commit 82646b9564
4 changed files with 12 additions and 17 deletions

View File

@ -20,6 +20,10 @@ on:
- 'releases/*'
tags:
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
Fetch-Source:
runs-on: ubuntu-latest

View File

@ -1,17 +0,0 @@
name: Cancelling Duplicates
on:
workflow_run:
workflows: ["Build", "Check", "❄️ Lint"]
types: ['requested']
jobs:
cancel-duplicate-workflow-runs:
name: "Cancel duplicate workflow runs"
runs-on: ubuntu-latest
steps:
- uses: apache/airflow-cancel-workflow-runs@master
name: "Cancel duplicate workflow runs"
with:
cancelMode: allDuplicates
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}

View File

@ -15,6 +15,10 @@ name: Check
on:
pull_request:
concurrency:
group: check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-18.04

View File

@ -2,6 +2,10 @@ name: ❄️ Lint
on: [pull_request]
concurrency:
group: lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
yamllint:
name: 🍺 YAML