From 2b881aaad00e1aa7360c15640b5a55cbf330cf82 Mon Sep 17 00:00:00 2001 From: Sidharth Mohanty Date: Fri, 20 Oct 2023 02:29:02 +0530 Subject: [PATCH] Cache dependencies in CI (#832) --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87ef282e..af5105be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,20 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install poetry - run: pip install poetry==1.4.2 + uses: snok/install-poetry@v1 + with: + version: 1.4.2 + virtualenvs-create: true + virtualenvs-in-project: true + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies run: poetry install --all-extras + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - name: Lint with ruff run: make lint - name: Run tests and generate coverage report