From 5ac2ab309ef29c5dafe0d72f6cef7c1115989269 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Sun, 22 Nov 2020 11:24:39 +0200 Subject: Remove unnecessary env variables and fix Poetry install --- .github/workflows/forms-backend.yml | 31 +++++++++---------------------- 1 file 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/install-poetry@v1.1.1 + 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. -- cgit v1.2.3