From 8ef1f46371bf96b25efd96ab21e98d947e78bafe Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:21:52 +0200 Subject: [PATCH 01/11] feat: adds github actions for sage --- .dockerignore | 1 + .github/actions/action.yml | 90 +++++++++++++++++++++++++++++++ .github/workflows/development.yml | 90 +++++++++++++++++++++++++++++++ sage/utils/ai_tools.py | 2 +- sage/utils/jira_agent.py | 3 +- sage/utils/jira_helper.py | 3 +- 6 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 .github/actions/action.yml create mode 100644 .github/workflows/development.yml diff --git a/.dockerignore b/.dockerignore index de39652..0a7050a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ tests .Makefile LICENSE requirements.txt +.github/ # Ignore all log files and temporary files *.log diff --git a/.github/actions/action.yml b/.github/actions/action.yml new file mode 100644 index 0000000..5cf9d3e --- /dev/null +++ b/.github/actions/action.yml @@ -0,0 +1,90 @@ +# Action code from: +# https://github.com/langchain-ai/langchain/blob/master/.github/actions/poetry_setup/action.yml +name: poetry-install-with-caching +description: Poetry install with support for caching of dependency groups. + +inputs: + python-version: + description: Python version, supporting MAJOR.MINOR only + required: true + + poetry-version: + description: Poetry version + required: true + + cache-key: + description: Cache key to use for manual handling of caching + required: true + + working-directory: + description: Directory whose poetry.lock file should be cached + required: true + +runs: + using: composite + steps: + - uses: actions/setup-python@v5 + name: Setup python ${{ inputs.python-version }} + id: setup-python + with: + python-version: ${{ inputs.python-version }} + + - uses: actions/cache@v4 + id: cache-bin-poetry + name: Cache Poetry binary - Python ${{ inputs.python-version }} + env: + SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1" + with: + path: | + /opt/pipx/venvs/poetry + # This step caches the poetry installation, so make sure it's keyed on the poetry version as well. + key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }} + + - name: Refresh shell hashtable and fixup softlinks + if: steps.cache-bin-poetry.outputs.cache-hit == 'true' + shell: bash + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + PYTHON_VERSION: ${{ inputs.python-version }} + run: | + set -eux + + # Refresh the shell hashtable, to ensure correct `which` output. + hash -r + + # `actions/cache@v3` doesn't always seem able to correctly unpack softlinks. + # Delete and recreate the softlinks pipx expects to have. + rm /opt/pipx/venvs/poetry/bin/python + cd /opt/pipx/venvs/poetry/bin + ln -s "$(which "python$PYTHON_VERSION")" python + chmod +x python + cd /opt/pipx_bin/ + ln -s /opt/pipx/venvs/poetry/bin/poetry poetry + chmod +x poetry + + # Ensure everything got set up correctly. + /opt/pipx/venvs/poetry/bin/python --version + /opt/pipx_bin/poetry --version + + - name: Install poetry + if: steps.cache-bin-poetry.outputs.cache-hit != 'true' + shell: bash + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + PYTHON_VERSION: ${{ inputs.python-version }} + # Install poetry using the python version installed by setup-python step. + run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose + + - name: Restore pip and poetry cached dependencies + uses: actions/cache@v4 + env: + SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4" + WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} + with: + path: | + ~/.cache/pip + ~/.cache/pypoetry/virtualenvs + ~/.cache/pypoetry/cache + ~/.cache/pypoetry/artifacts + ${{ env.WORKDIR }}/.venv + key: py-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-poetry-${{ inputs.poetry-version }}-${{ inputs.cache-key }}-${{ hashFiles(format('{0}/**/poetry.lock', env.WORKDIR)) }} diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..860282e --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,90 @@ +name: Sage Development + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + workflow_call: + +env: + POETRY_VERSION: "1.8.2" + PYTHON_VERSION: "3.11" + WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} + RUFF_OUTPUT_FORMAT: github + +defaults: + run: + shell: bash + working-directory: . + +jobs: + lint: + name: "Code Style" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/python_setup" + with: + python-version: ${{ env.PYTHON_VERSION }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: ${{ env.WORKDIR }} + cache-key: lint-with-extras + + - name: Check Poetry File + run: | + poetry check + + - name: Check lock file + run: | + poetry lock --check + + - name: Install dependencies + run: | + poetry install --with dev + + - name: Linting with ruff + run: | + make lint + + - name: Style check with ruff + run: | + make format + + - name: CodeSpell + run: | + make spell_check + + + test: + name: Run unit tests + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/python_setup" + with: + python-version: ${{ env.PYTHON_VERSION }} + poetry-version: ${{ env.POETRY_VERSION }} + working-directory: ${{ env.WORKDIR }} + cache-key: lint-with-extras + + - name: Install deps + run: poetry install --with test + + - name: Run tests + shell: bash + run: | + make test + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build the Sage image + run: docker build . --file Dockerfile --tag thehapyone/codesage:test-$(date +%s) diff --git a/sage/utils/ai_tools.py b/sage/utils/ai_tools.py index a65d723..a7c8ba7 100644 --- a/sage/utils/ai_tools.py +++ b/sage/utils/ai_tools.py @@ -1,9 +1,9 @@ # Helps to initialize various tools that can be used by AI agents from typing import List -from sage.constants import LLM_MODEL as llm from langchain.tools import Tool +from sage.constants import LLM_MODEL as llm from sage.utils.source_qa import SourceQAService diff --git a/sage/utils/jira_agent.py b/sage/utils/jira_agent.py index 1cdf979..81fcad1 100644 --- a/sage/utils/jira_agent.py +++ b/sage/utils/jira_agent.py @@ -1,10 +1,11 @@ from typing import Any -from sage.constants import LLM_MODEL, logger from jira import Issue, JIRAError from langchain.chains.llm import LLMChain from langchain.prompts import ChatPromptTemplate, PromptTemplate +from sage.constants import LLM_MODEL, logger + # from langchain_experimental.plan_and_execute.planners.base import LLMPlanner # from langchain_experimental.plan_and_execute.planners.chat_planner import ( # PlanningOutputParser, diff --git a/sage/utils/jira_helper.py b/sage/utils/jira_helper.py index 6a421ed..d70e364 100644 --- a/sage/utils/jira_helper.py +++ b/sage/utils/jira_helper.py @@ -3,10 +3,11 @@ from time import sleep from typing import List -from sage.constants import JIRA_QUERY, jira_config from jira import JIRA, Issue from jira.resources import Comment +from sage.constants import JIRA_QUERY, jira_config + issue_fields = [ "summary", "status", From 7bc94a91705a5081716106126da600c34f8e2341 Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:22:34 +0200 Subject: [PATCH 02/11] chore: remove whitespaces --- .github/workflows/development.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 860282e..e94993b 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -58,7 +58,6 @@ jobs: run: | make spell_check - test: name: Run unit tests runs-on: ubuntu-latest @@ -85,6 +84,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Sage image - run: docker build . --file Dockerfile --tag thehapyone/codesage:test-$(date +%s) + - uses: actions/checkout@v4 + - name: Build the Sage image + run: docker build . --file Dockerfile --tag thehapyone/codesage:test-$(date +%s) From 0a3714df99c4fa1fe03fb5d85400497e371258f8 Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:28:33 +0200 Subject: [PATCH 03/11] chore: debug github actions --- .github/workflows/development.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index e94993b..f255741 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -26,6 +26,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Check Actions + run: | + ls -aRl .github/actions + ls -al ./.github/actions/python_setup + echo $PWD + ls -al /home/runner/work/codesage/codesage/.github/actions/python_setup + - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} uses: "./.github/actions/python_setup" with: From 4c8372dcc174069efab663a6c1987855ae839f6b Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:31:27 +0200 Subject: [PATCH 04/11] more debugging --- .github/workflows/development.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index f255741..62cb0c3 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -29,9 +29,9 @@ jobs: - name: Check Actions run: | - ls -aRl .github/actions - ls -al ./.github/actions/python_setup + ls -aRl .github echo $PWD + ls -al ./.github/actions/python_setup ls -al /home/runner/work/codesage/codesage/.github/actions/python_setup - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} From a9d4088f643d0cf078650a0fc46518f638bb7ec7 Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:35:01 +0200 Subject: [PATCH 05/11] debugging actions --- .github/action/action.yml | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/action/action.yml diff --git a/.github/action/action.yml b/.github/action/action.yml new file mode 100644 index 0000000..5cf9d3e --- /dev/null +++ b/.github/action/action.yml @@ -0,0 +1,90 @@ +# Action code from: +# https://github.com/langchain-ai/langchain/blob/master/.github/actions/poetry_setup/action.yml +name: poetry-install-with-caching +description: Poetry install with support for caching of dependency groups. + +inputs: + python-version: + description: Python version, supporting MAJOR.MINOR only + required: true + + poetry-version: + description: Poetry version + required: true + + cache-key: + description: Cache key to use for manual handling of caching + required: true + + working-directory: + description: Directory whose poetry.lock file should be cached + required: true + +runs: + using: composite + steps: + - uses: actions/setup-python@v5 + name: Setup python ${{ inputs.python-version }} + id: setup-python + with: + python-version: ${{ inputs.python-version }} + + - uses: actions/cache@v4 + id: cache-bin-poetry + name: Cache Poetry binary - Python ${{ inputs.python-version }} + env: + SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1" + with: + path: | + /opt/pipx/venvs/poetry + # This step caches the poetry installation, so make sure it's keyed on the poetry version as well. + key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }} + + - name: Refresh shell hashtable and fixup softlinks + if: steps.cache-bin-poetry.outputs.cache-hit == 'true' + shell: bash + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + PYTHON_VERSION: ${{ inputs.python-version }} + run: | + set -eux + + # Refresh the shell hashtable, to ensure correct `which` output. + hash -r + + # `actions/cache@v3` doesn't always seem able to correctly unpack softlinks. + # Delete and recreate the softlinks pipx expects to have. + rm /opt/pipx/venvs/poetry/bin/python + cd /opt/pipx/venvs/poetry/bin + ln -s "$(which "python$PYTHON_VERSION")" python + chmod +x python + cd /opt/pipx_bin/ + ln -s /opt/pipx/venvs/poetry/bin/poetry poetry + chmod +x poetry + + # Ensure everything got set up correctly. + /opt/pipx/venvs/poetry/bin/python --version + /opt/pipx_bin/poetry --version + + - name: Install poetry + if: steps.cache-bin-poetry.outputs.cache-hit != 'true' + shell: bash + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + PYTHON_VERSION: ${{ inputs.python-version }} + # Install poetry using the python version installed by setup-python step. + run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose + + - name: Restore pip and poetry cached dependencies + uses: actions/cache@v4 + env: + SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4" + WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} + with: + path: | + ~/.cache/pip + ~/.cache/pypoetry/virtualenvs + ~/.cache/pypoetry/cache + ~/.cache/pypoetry/artifacts + ${{ env.WORKDIR }}/.venv + key: py-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-poetry-${{ inputs.poetry-version }}-${{ inputs.cache-key }}-${{ hashFiles(format('{0}/**/poetry.lock', env.WORKDIR)) }} From 7ba3b0410bb399270f6a5c108ec44ee31b17bb58 Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:37:11 +0200 Subject: [PATCH 06/11] fix: wrong action path --- .github/actions/action.yml | 90 ------------------- .../python_setup}/action.yml | 0 .github/workflows/development.yml | 8 -- 3 files changed, 98 deletions(-) delete mode 100644 .github/actions/action.yml rename .github/{action => actions/python_setup}/action.yml (100%) diff --git a/.github/actions/action.yml b/.github/actions/action.yml deleted file mode 100644 index 5cf9d3e..0000000 --- a/.github/actions/action.yml +++ /dev/null @@ -1,90 +0,0 @@ -# Action code from: -# https://github.com/langchain-ai/langchain/blob/master/.github/actions/poetry_setup/action.yml -name: poetry-install-with-caching -description: Poetry install with support for caching of dependency groups. - -inputs: - python-version: - description: Python version, supporting MAJOR.MINOR only - required: true - - poetry-version: - description: Poetry version - required: true - - cache-key: - description: Cache key to use for manual handling of caching - required: true - - working-directory: - description: Directory whose poetry.lock file should be cached - required: true - -runs: - using: composite - steps: - - uses: actions/setup-python@v5 - name: Setup python ${{ inputs.python-version }} - id: setup-python - with: - python-version: ${{ inputs.python-version }} - - - uses: actions/cache@v4 - id: cache-bin-poetry - name: Cache Poetry binary - Python ${{ inputs.python-version }} - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1" - with: - path: | - /opt/pipx/venvs/poetry - # This step caches the poetry installation, so make sure it's keyed on the poetry version as well. - key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }} - - - name: Refresh shell hashtable and fixup softlinks - if: steps.cache-bin-poetry.outputs.cache-hit == 'true' - shell: bash - env: - POETRY_VERSION: ${{ inputs.poetry-version }} - PYTHON_VERSION: ${{ inputs.python-version }} - run: | - set -eux - - # Refresh the shell hashtable, to ensure correct `which` output. - hash -r - - # `actions/cache@v3` doesn't always seem able to correctly unpack softlinks. - # Delete and recreate the softlinks pipx expects to have. - rm /opt/pipx/venvs/poetry/bin/python - cd /opt/pipx/venvs/poetry/bin - ln -s "$(which "python$PYTHON_VERSION")" python - chmod +x python - cd /opt/pipx_bin/ - ln -s /opt/pipx/venvs/poetry/bin/poetry poetry - chmod +x poetry - - # Ensure everything got set up correctly. - /opt/pipx/venvs/poetry/bin/python --version - /opt/pipx_bin/poetry --version - - - name: Install poetry - if: steps.cache-bin-poetry.outputs.cache-hit != 'true' - shell: bash - env: - POETRY_VERSION: ${{ inputs.poetry-version }} - PYTHON_VERSION: ${{ inputs.python-version }} - # Install poetry using the python version installed by setup-python step. - run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose - - - name: Restore pip and poetry cached dependencies - uses: actions/cache@v4 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4" - WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} - with: - path: | - ~/.cache/pip - ~/.cache/pypoetry/virtualenvs - ~/.cache/pypoetry/cache - ~/.cache/pypoetry/artifacts - ${{ env.WORKDIR }}/.venv - key: py-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-poetry-${{ inputs.poetry-version }}-${{ inputs.cache-key }}-${{ hashFiles(format('{0}/**/poetry.lock', env.WORKDIR)) }} diff --git a/.github/action/action.yml b/.github/actions/python_setup/action.yml similarity index 100% rename from .github/action/action.yml rename to .github/actions/python_setup/action.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 62cb0c3..e94993b 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -26,14 +26,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Check Actions - run: | - ls -aRl .github - echo $PWD - ls -al ./.github/actions/python_setup - ls -al /home/runner/work/codesage/codesage/.github/actions/python_setup - - name: Set up Python + Poetry ${{ env.POETRY_VERSION }} uses: "./.github/actions/python_setup" with: From 6215b265abe31340a6b44ce113c034eda3b4f5d8 Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:45:29 +0200 Subject: [PATCH 07/11] chore: update the github actions --- .github/workflows/{development.yml => ci.yml} | 14 ++++++++++---- tests/unit_tests/utils/test_validator.py | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) rename .github/workflows/{development.yml => ci.yml} (85%) diff --git a/.github/workflows/development.yml b/.github/workflows/ci.yml similarity index 85% rename from .github/workflows/development.yml rename to .github/workflows/ci.yml index e94993b..8e26e74 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Sage Development +name: CI/CD on: pull_request: @@ -74,7 +74,7 @@ jobs: cache-key: lint-with-extras - name: Install deps - run: poetry install --with test + run: poetry install --with tests - name: Run tests shell: bash @@ -85,5 +85,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build the Sage image - run: docker build . --file Dockerfile --tag thehapyone/codesage:test-$(date +%s) + - name: Build Docker + uses: docker/build-push-action@v5 + with: + context: . + cache-from: type=gha + cache-to: type=gha,mode=max + tags: thehapyone/codesage:test-$(date +%s) + push: false diff --git a/tests/unit_tests/utils/test_validator.py b/tests/unit_tests/utils/test_validator.py index ee8d1d9..65991f3 100644 --- a/tests/unit_tests/utils/test_validator.py +++ b/tests/unit_tests/utils/test_validator.py @@ -1,7 +1,6 @@ # test_validator.py import base64 -import os from logging import getLevelName from pathlib import Path From 1bd6f484140550a23dac611c43073fde4525bbae Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:50:51 +0200 Subject: [PATCH 08/11] fix: configure docker buidx --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e26e74..4fd3c07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build Docker uses: docker/build-push-action@v5 with: From d4a6eaf8e04dbaa369e7cf483ff3fad0aa9c673e Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 19:54:05 +0200 Subject: [PATCH 09/11] fix: use sha as tag --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fd3c07..e4bc1d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: make spell_check test: - name: Run unit tests + name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -83,15 +83,16 @@ jobs: build: runs-on: ubuntu-latest + name: Build Docker Image steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build Docker + - name: Build Image uses: docker/build-push-action@v5 with: context: . cache-from: type=gha cache-to: type=gha,mode=max - tags: thehapyone/codesage:test-$(date +%s) + tags: thehapyone/codesage:test-${{ github.sha }} push: false From 5c3d886174aa68ffc3ee7fa3356901d5d6dc07cf Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 20:01:04 +0200 Subject: [PATCH 10/11] chore: remove python cache --- .github/actions/python_setup/action.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/actions/python_setup/action.yml b/.github/actions/python_setup/action.yml index 5cf9d3e..e936b98 100644 --- a/.github/actions/python_setup/action.yml +++ b/.github/actions/python_setup/action.yml @@ -74,17 +74,3 @@ runs: PYTHON_VERSION: ${{ inputs.python-version }} # Install poetry using the python version installed by setup-python step. run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose - - - name: Restore pip and poetry cached dependencies - uses: actions/cache@v4 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4" - WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} - with: - path: | - ~/.cache/pip - ~/.cache/pypoetry/virtualenvs - ~/.cache/pypoetry/cache - ~/.cache/pypoetry/artifacts - ${{ env.WORKDIR }}/.venv - key: py-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-poetry-${{ inputs.poetry-version }}-${{ inputs.cache-key }}-${{ hashFiles(format('{0}/**/poetry.lock', env.WORKDIR)) }} From d9d068e4493b58c7e8a07a3e46ede758a8c9b18b Mon Sep 17 00:00:00 2001 From: Ayo Ayibiowu Date: Thu, 2 May 2024 20:06:52 +0200 Subject: [PATCH 11/11] chore: set concurrency group --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4bc1d5..3308301 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,10 @@ on: - reopened workflow_call: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: POETRY_VERSION: "1.8.2" PYTHON_VERSION: "3.11"