From 63dde6d497e515dae14f0e039f1e7356c939254f Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Tue, 10 Oct 2023 16:42:09 -0700 Subject: [PATCH 1/2] Cancel a currently running workflow from the same PR when a new workflow is triggered Signed-off-by: Kevin Su --- .github/workflows/checks.yml | 4 ++++ .github/workflows/codespell.yml | 4 ++++ .github/workflows/flyteidl-checks.yml | 4 ++++ .github/workflows/helm-charts.yaml | 4 ++++ .github/workflows/sandbox.yml | 4 ++++ .github/workflows/single-binary.yml | 4 ++++ .github/workflows/tests.yml | 5 +++++ datacatalog/.github/workflows/checks.yml | 4 ++++ flyteadmin/.github/workflows/checks.yml | 4 ++++ flytecopilot/.github/workflows/checks.yml | 4 ++++ flyteidl/.github/workflows/verification.yml | 4 ++++ flytepropeller/.github/workflows/checks.yml | 4 ++++ flytepropeller/.github/workflows/codeql-analysis.yml | 4 ++++ 13 files changed, 53 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 89f427f274..c732efa49f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,5 +1,9 @@ name: Components Checks +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: paths: diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7373affc38..7c9d100e39 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -1,6 +1,10 @@ --- name: Codespell +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: push: branches: [master] diff --git a/.github/workflows/flyteidl-checks.yml b/.github/workflows/flyteidl-checks.yml index d59031f280..0a6cd8a789 100644 --- a/.github/workflows/flyteidl-checks.yml +++ b/.github/workflows/flyteidl-checks.yml @@ -1,5 +1,9 @@ name: Flyteidl Verification Tests +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: paths: diff --git a/.github/workflows/helm-charts.yaml b/.github/workflows/helm-charts.yaml index 6c9264e58e..63e81adf3a 100644 --- a/.github/workflows/helm-charts.yaml +++ b/.github/workflows/helm-charts.yaml @@ -1,5 +1,9 @@ name: Package & Push Flyte Helm Charts +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: push: diff --git a/.github/workflows/sandbox.yml b/.github/workflows/sandbox.yml index e2edc878af..31ce2e2dc8 100644 --- a/.github/workflows/sandbox.yml +++ b/.github/workflows/sandbox.yml @@ -1,5 +1,9 @@ name: Build & Push Sandbox Docker Image +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: paths: diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 94743ea35f..909fda743b 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -1,5 +1,9 @@ name: Build & Push Flyte Single Binary Images +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: paths: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d63baf6a5a..f517cb0944 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,9 @@ name: tests + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: push: branches: diff --git a/datacatalog/.github/workflows/checks.yml b/datacatalog/.github/workflows/checks.yml index 5c81a2f21c..b4968e479c 100644 --- a/datacatalog/.github/workflows/checks.yml +++ b/datacatalog/.github/workflows/checks.yml @@ -1,5 +1,9 @@ name: Datacatalog Checks +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: workflow_dispatch: pull_request: diff --git a/flyteadmin/.github/workflows/checks.yml b/flyteadmin/.github/workflows/checks.yml index 65c2573676..5c1dbd71f2 100644 --- a/flyteadmin/.github/workflows/checks.yml +++ b/flyteadmin/.github/workflows/checks.yml @@ -1,5 +1,9 @@ name: Flyteadmin Checks +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: workflow_dispatch: pull_request: diff --git a/flytecopilot/.github/workflows/checks.yml b/flytecopilot/.github/workflows/checks.yml index 43f82e5d39..6fed4d0eef 100644 --- a/flytecopilot/.github/workflows/checks.yml +++ b/flytecopilot/.github/workflows/checks.yml @@ -1,5 +1,9 @@ name: Flyte copilot Checks +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: workflow_dispatch: pull_request: diff --git a/flyteidl/.github/workflows/verification.yml b/flyteidl/.github/workflows/verification.yml index 3a15965727..6015f0769c 100644 --- a/flyteidl/.github/workflows/verification.yml +++ b/flyteidl/.github/workflows/verification.yml @@ -1,5 +1,9 @@ name: Verification Tests +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: pull_request: push: diff --git a/flytepropeller/.github/workflows/checks.yml b/flytepropeller/.github/workflows/checks.yml index e1041998aa..86ac2b76c8 100644 --- a/flytepropeller/.github/workflows/checks.yml +++ b/flytepropeller/.github/workflows/checks.yml @@ -1,5 +1,9 @@ name: Flytepropeller Checks +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: workflow_dispatch: pull_request: diff --git a/flytepropeller/.github/workflows/codeql-analysis.yml b/flytepropeller/.github/workflows/codeql-analysis.yml index 6e1f0c5113..61c8aa7cf2 100644 --- a/flytepropeller/.github/workflows/codeql-analysis.yml +++ b/flytepropeller/.github/workflows/codeql-analysis.yml @@ -11,6 +11,10 @@ # name: "CodeQL" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + on: push: branches: [ master ] From 41ba8f37bfea3439017cabb022c6ebab8dc9af8e Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Wed, 18 Oct 2023 19:51:15 -0700 Subject: [PATCH 2/2] address comment Signed-off-by: Kevin Su --- .github/workflows/checks.yml | 2 +- .github/workflows/codespell.yml | 2 +- .github/workflows/flyteidl-checks.yml | 2 +- .github/workflows/helm-charts.yaml | 2 +- .github/workflows/sandbox.yml | 2 +- .github/workflows/single-binary.yml | 2 +- .github/workflows/tests.yml | 2 +- datacatalog/.github/workflows/checks.yml | 2 +- flyteadmin/.github/workflows/checks.yml | 2 +- flytecopilot/.github/workflows/checks.yml | 2 +- flyteidl/.github/workflows/verification.yml | 2 +- flytepropeller/.github/workflows/checks.yml | 2 +- flytepropeller/.github/workflows/codeql-analysis.yml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c732efa49f..34b6ca4781 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,7 +1,7 @@ name: Components Checks concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7c9d100e39..cbc8c16560 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -2,7 +2,7 @@ name: Codespell concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/flyteidl-checks.yml b/.github/workflows/flyteidl-checks.yml index 0a6cd8a789..cbf84b97f1 100644 --- a/.github/workflows/flyteidl-checks.yml +++ b/.github/workflows/flyteidl-checks.yml @@ -1,7 +1,7 @@ name: Flyteidl Verification Tests concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/helm-charts.yaml b/.github/workflows/helm-charts.yaml index 63e81adf3a..5d5f4ca880 100644 --- a/.github/workflows/helm-charts.yaml +++ b/.github/workflows/helm-charts.yaml @@ -1,7 +1,7 @@ name: Package & Push Flyte Helm Charts concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/sandbox.yml b/.github/workflows/sandbox.yml index 31ce2e2dc8..dc78d4b559 100644 --- a/.github/workflows/sandbox.yml +++ b/.github/workflows/sandbox.yml @@ -1,7 +1,7 @@ name: Build & Push Sandbox Docker Image concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/single-binary.yml b/.github/workflows/single-binary.yml index 909fda743b..c75892a292 100644 --- a/.github/workflows/single-binary.yml +++ b/.github/workflows/single-binary.yml @@ -1,7 +1,7 @@ name: Build & Push Flyte Single Binary Images concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f517cb0944..ba9208d4bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ name: tests concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/datacatalog/.github/workflows/checks.yml b/datacatalog/.github/workflows/checks.yml index b4968e479c..82efe6c675 100644 --- a/datacatalog/.github/workflows/checks.yml +++ b/datacatalog/.github/workflows/checks.yml @@ -1,7 +1,7 @@ name: Datacatalog Checks concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/flyteadmin/.github/workflows/checks.yml b/flyteadmin/.github/workflows/checks.yml index 5c1dbd71f2..6451811c53 100644 --- a/flyteadmin/.github/workflows/checks.yml +++ b/flyteadmin/.github/workflows/checks.yml @@ -1,7 +1,7 @@ name: Flyteadmin Checks concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/flytecopilot/.github/workflows/checks.yml b/flytecopilot/.github/workflows/checks.yml index 6fed4d0eef..a7e624f772 100644 --- a/flytecopilot/.github/workflows/checks.yml +++ b/flytecopilot/.github/workflows/checks.yml @@ -1,7 +1,7 @@ name: Flyte copilot Checks concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/flyteidl/.github/workflows/verification.yml b/flyteidl/.github/workflows/verification.yml index 6015f0769c..bb8270a475 100644 --- a/flyteidl/.github/workflows/verification.yml +++ b/flyteidl/.github/workflows/verification.yml @@ -1,7 +1,7 @@ name: Verification Tests concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/flytepropeller/.github/workflows/checks.yml b/flytepropeller/.github/workflows/checks.yml index 86ac2b76c8..acb7bde43d 100644 --- a/flytepropeller/.github/workflows/checks.yml +++ b/flytepropeller/.github/workflows/checks.yml @@ -1,7 +1,7 @@ name: Flytepropeller Checks concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: diff --git a/flytepropeller/.github/workflows/codeql-analysis.yml b/flytepropeller/.github/workflows/codeql-analysis.yml index 61c8aa7cf2..4ddece498b 100644 --- a/flytepropeller/.github/workflows/codeql-analysis.yml +++ b/flytepropeller/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ name: "CodeQL" concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true on: