From f059a1ba222f1add7ce88c3efcdf3516d3d9640d Mon Sep 17 00:00:00 2001 From: svaponi <10941963+svaponi@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:28:25 +0200 Subject: [PATCH] task(ci): add cache for virtual environment --- .github/workflows/run-tests.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e41626c..f1704ec 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,6 +18,17 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + # Cache the virtual environment to speed up build time + # See https://github.com/marketplace/actions/python-poetry-action#workflow-example-cache-the-virtual-environment + - name: Set up a local virtual environment + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - uses: actions/cache@v3 + name: Define cache for the virtual environment + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} - name: Install poetry uses: abatilo/actions-poetry@v3.0.0 - name: Install dependencies