2

我正在尝试缓存 Github Action 工作流程的依赖项。我使用 Pipenv。

这是我的配置:

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

我从Github 自己的使用 pip 的示例中获得了这个配置。因为我们不requirements.txt使用. 但即使我得到同样的问题。Pipfilerequirements.txtrequirements.txt

Cache Dependencies步骤总是给出这个问题:

在此处输入图像描述

然后在运行测试后:

在此处输入图像描述

工作流程没有错误,并且正常完成,但是,它似乎永远无法找到或更新依赖项缓存。

4

1 回答 1

3

pipenv 需要在缓存步骤之前安装...

 - name: Install pipenv, libpq, and pandoc
      run: |
        sudo apt-get install libpq-dev -y
        pip install pipenv
于 2020-04-10T15:22:07.717 回答