2

I am trying to cache dependencies for a Github Action workflow. I use Pipenv.

this is my config:

    - uses: actions/cache@v1
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile') }}
        restore-keys: |
          ${{ runner.os }}-pip-

I got this config from Github's own examples for using pip. I have only changed requirements.txt to Pipfile since we don't use a requirements.txt. But even with the requirements.txt I get the same issue anyway.

the Cache Dependencies step always give this issue:

enter image description here

and then after running the tests:

enter image description here

There's no error on the workflow and it finishes as normal, however, it never seems to be able to find or update the dependency cache.

COB
  • 236
  • 1
  • 14

1 Answers1

3

pipenv needed to be installed before the cache step...

 - name: Install pipenv, libpq, and pandoc
      run: |
        sudo apt-get install libpq-dev -y
        pip install pipenv
COB
  • 236
  • 1
  • 14
  • 3
    As an aside, you might want to hash `Pipfile.lock` as it contains specific version of dependencies. – Nav Jul 11 '20 at 23:14