I have the following steps in a github action:
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Cache dependencies
id: pip-cache
uses: actions/cache@v2
with:
path: ~.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.pip-cache.outputs.cache-hit != 'true'
run: pip install -r requirements.txt
- name: run mypy
run: mypy .
The caching works fine, but when a cache hit occurs, and I try to run mypy, it fails with:
Run mypy .
/home/runner/work/_temp/9887df5b-d5cc-46d7-90e1-b884d8c49272.sh: line 1: mypy: command not found
Error: Process completed with exit code 127.
The whole point of caching dependencies is so I don't have to install them every time I run the workflow. How do I use the cached dependencies?