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:48:15 -03:00 committed by Xiang Xiao
parent 07d295b8db
commit 3eec9fcb9b
6 changed files with 20 additions and 17 deletions

View File

@ -24,6 +24,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", "Build Documentation", " Lint", "Docker-Linux"]
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

@ -17,6 +17,10 @@ on:
paths-ignore:
- 'Documentation/**'
concurrency:
group: check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-18.04

View File

@ -15,6 +15,10 @@ on:
pull_request:
push:
concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-html:
runs-on: ubuntu-latest

View File

@ -30,6 +30,10 @@ on:
env:
IMAGE_NAME: apache-nuttx-ci-linux
concurrency:
group: docker-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Push image to GitHub Packages.
push:

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:
lint:
name: Lint