aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/forms-backend.yml31
1 files changed, 9 insertions, 22 deletions
diff --git a/.github/workflows/forms-backend.yml b/.github/workflows/forms-backend.yml
index 8da1e21..908a186 100644
--- a/.github/workflows/forms-backend.yml
+++ b/.github/workflows/forms-backend.yml
@@ -11,22 +11,6 @@ jobs:
name: Linting
runs-on: ubuntu-latest
- env:
- # Configure pip to cache dependencies and do a user install
- PIP_NO_CACHE_DIR: false
- PIP_USER: 1
-
- # Hide the graphical elements from pipenv's output
- PIPENV_HIDE_EMOJIS: 1
- PIPENV_NOSPIN: 1
-
- # Make sure pipenv does not try reuse an environment it's running in
- PIPENV_IGNORE_VIRTUALENVS: 1
-
- # Specify explicit paths for python dependencies and the pre-commit
- # environment so we know which directories to cache
- PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
-
steps:
- name: Add custom PYTHONUSERBASE to PATH
run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
@@ -39,22 +23,25 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.9'
+
+ - name: Setup Poetry
+ uses: snok/[email protected]
+ with:
+ virtualenvs-create: true
+ virtualenvs-in-project: true
# When same context exists in cache already, restore this environment.
- - name: Python Dependency Caching
+ - name: Poetry Environment Caching
uses: actions/cache@v2
id: python_cache
with:
- path: ${{ env.PYTHONUSERBASE }}
- key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
- ${{ steps.python.outputs.python-version }}-\
- ${{ hashFiles('./pyproject.toml', './poetry.lock') }}"
+ path: .venv
+ key: "venv-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}"
# Only install dependencies when cache didn't hit.
- name: Install dependencies
if: steps.python_cache.outputs.cache-hit != 'true'
run: |
- pip install poetry
poetry install
# This implemention allows showing linting errors in PRs under Files tab.