【发布时间】:2021-10-24 00:21:30
【问题描述】:
我在 github 操作中有以下步骤:
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 .
缓存工作正常,但是当缓存命中发生时,我尝试运行 mypy,它失败了:
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.
缓存依赖项的全部意义在于我不必在每次运行工作流时都安装它们。如何使用缓存的依赖项?
【问题讨论】:
标签: python github pip github-actions