From 35812d00964cc1d96fde501b2e55c4c93387ecf9 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:21:26 -0400 Subject: [PATCH] Set up concurrency groups and workflow cancelation in CI. (#9564) If another push to the same PR or branch happens while its CI is still running, cancel the earlier run in favor of the next run. There's no point in testing an outdated version of the code. GitHub only allows a limited number of job runners to be active at the same time, so it's better to cancel pointless jobs early so that more useful jobs can run sooner. --- .github/workflows/langchain_ci.yml | 10 ++++++++++ .github/workflows/langchain_experimental_ci.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/langchain_ci.yml b/.github/workflows/langchain_ci.yml index b91e039ea6f..932cce90a3e 100644 --- a/.github/workflows/langchain_ci.yml +++ b/.github/workflows/langchain_ci.yml @@ -13,6 +13,16 @@ on: - 'libs/langchain/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI +# If another push to the same PR or branch happens while this workflow is still running, +# cancel the earlier run in favor of the next run. +# +# There's no point in testing an outdated version of the code. GitHub only allows +# a limited number of job runners to be active at the same time, so it's better to cancel +# pointless jobs early so that more useful jobs can run sooner. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: POETRY_VERSION: "1.5.1" WORKDIR: "libs/langchain" diff --git a/.github/workflows/langchain_experimental_ci.yml b/.github/workflows/langchain_experimental_ci.yml index cee8cdb7d31..9edaf6aca1a 100644 --- a/.github/workflows/langchain_experimental_ci.yml +++ b/.github/workflows/langchain_experimental_ci.yml @@ -13,6 +13,16 @@ on: - 'libs/experimental/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI +# If another push to the same PR or branch happens while this workflow is still running, +# cancel the earlier run in favor of the next run. +# +# There's no point in testing an outdated version of the code. GitHub only allows +# a limited number of job runners to be active at the same time, so it's better to cancel +# pointless jobs early so that more useful jobs can run sooner. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: POETRY_VERSION: "1.5.1" WORKDIR: "libs/experimental"