From 015f0f3220a3aae86d20ac2d3319beacfb24f753 Mon Sep 17 00:00:00 2001 From: christopherfrige Date: Tue, 12 Mar 2024 17:31:26 -0300 Subject: [PATCH] feat: cache in pipelines --- .github/workflows/lint-backend.yaml | 3 ++- .github/workflows/test-backend.yaml | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint-backend.yaml b/.github/workflows/lint-backend.yaml index 9cfe68a..3b4d0cb 100644 --- a/.github/workflows/lint-backend.yaml +++ b/.github/workflows/lint-backend.yaml @@ -43,13 +43,14 @@ jobs: version: 1.5.1 virtualenvs-create: true virtualenvs-in-project: true + virtualenvs-path: ~/venv - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v3 with: - path: ./backend/.venv + path: ~/venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} diff --git a/.github/workflows/test-backend.yaml b/.github/workflows/test-backend.yaml index 157a6b2..d4a2f72 100644 --- a/.github/workflows/test-backend.yaml +++ b/.github/workflows/test-backend.yaml @@ -32,7 +32,7 @@ jobs: id: cached-poetry uses: actions/cache@v3 with: - path: ~/.local # the path depends on the OS + path: ~/.local key: poetry-0 @@ -43,13 +43,14 @@ jobs: version: 1.5.1 virtualenvs-create: true virtualenvs-in-project: true + virtualenvs-path: ~/venv - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v3 with: - path: ${{ env.pythonLocation }} + path: ~/venv key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} @@ -58,9 +59,5 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - - name: Install library - run: poetry install --no-interaction - - - name: Run unit tests run: make run-tests