From 900e5845142cb4172ff89792662c86af18a2b326 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Mon, 1 Nov 2021 13:42:48 -0700 Subject: [PATCH] CI: Cancel in-progress jobs when a PR is updated (#13552) - This should lead to faster results as jobs will be queued for shorter periods when PRs are updated. - Current behavior is that previously running CI jobs for an updated PR run to completion needlessly, and cause new CI jobs to be queued. Ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency --- .github/workflows/go-cross.yml | 10 ++++++++-- .github/workflows/go-lint.yml | 10 ++++++++-- .github/workflows/go.yml | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index cb31888f3..ddc8dafa9 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -1,13 +1,19 @@ -name: Go +name: Crosscompile on: pull_request: branches: - master +# This ensures that previous jobs for the PR are cancelled when the PR is +# updated. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: - name: MinIO crosscompile tests on ${{ matrix.go-version }} and ${{ matrix.os }} + name: Build Tests with Go ${{ matrix.go-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 1b85ed7b4..11e477dcf 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -1,13 +1,19 @@ -name: Go +name: Linters and Tests on: pull_request: branches: - master +# This ensures that previous jobs for the PR are cancelled when the PR is +# updated. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: - name: MinIO tests on ${{ matrix.go-version }} and ${{ matrix.os }} + name: Go ${{ matrix.go-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 432b65e99..03a2de797 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,13 +1,19 @@ -name: Go +name: Functional Tests on: pull_request: branches: - master +# This ensures that previous jobs for the PR are cancelled when the PR is +# updated. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: - name: MinIO Setup on ${{ matrix.go-version }} and ${{ matrix.os }} + name: Go ${{ matrix.go-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: