From 74e73ea9e121f10b8c2aa159e8363f5fceb27056 Mon Sep 17 00:00:00 2001 From: Florian Hegenbarth Date: Wed, 11 Sep 2024 14:15:28 +0200 Subject: [PATCH] chore: Cache Poetry dependencies and virtual environment in CI --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 643b063..8238a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,14 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} + - name: Cache Poetry dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -35,6 +43,14 @@ jobs: virtualenvs-in-project: true installer-parallel: true + - name: Cache virtual environment + uses: actions/cache@v3 + with: + path: .venv + key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-venv- + - name: Install dependencies run: | poetry install --no-interaction --with dev