Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

It would be great to have an example of how to cache your pipenv packages with actions #4

Open
palewire opened this issue Jun 2, 2020 · 1 comment

Comments

@palewire
Copy link

palewire commented Jun 2, 2020

No description provided.

@palewire palewire changed the title It would be great to an example of how to cache your pipenv packages with actions It would be great to have an example of how to cache your pipenv packages with actions Jun 2, 2020
@khashashin
Copy link

@palewire

name: Staging

on:
  pull_request:
    branches: [ stage ]

jobs:
  build:

    runs-on: ubuntu-20.04
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install pipenv
      run: |
        sudo apt-get install libpq-dev -y
        pip install pipenv

    - name: Cache Pipenv virtualenv
      uses: actions/cache@v2
      id: pipenv-cache
      with:
        path: ~/.local/share/virtualenvs
        key: ${{ runner.os }}-pipenv-v2-${{ hashFiles('**/Pipfile.lock') }}
        restore-keys: |
          ${{ runner.os }}-pipenv-v2-

    - name: Install Dependencies
      env:
        PIPENV_NOSPIN: 'true'
        WORKON_HOME: ~/.local/share/virtualenvs
        PIPENV_CACHE_DIR: ~/.local/share/pipcache
      if: steps.pipenv-cache.outputs.cache-hit != 'true'
      run: pipenv install --dev

    - name: Run Tests
      env:
        PIPENV_NOSPIN: 'true'
        WORKON_HOME: ~/.local/share/virtualenvs
        PYTHONPATH: '.'
        ENV_ROLE: ${{ secrets.ENV_ROLE }}
        NOHCHI_MOTT_SECRET_KEY: ${{ secrets.NOHCHI_MOTT_SECRET_KEY }}
        GET_ENVIRONMENT: ${{ secrets.GET_ENVIRONMENT }}
        EMAIL_NO_REPLY: ${{ secrets.EMAIL_NO_REPLY }}
      run: |
        pipenv run python manage.py test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants