我有一个在 Windows 操作系统上运行的 Github 操作。然后,为了缓存依赖项,我使用actions/cache@v2
. 但是,它没有按预期工作。当我看到调试日志时,缓存的大小只有30 B
.
这是我正在使用的代码:
name: Build
on: push
jobs:
build_on_win:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, 'skip-publish')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: 15
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: install dependencies
run: npm install
rest of the code..
任何帮助是极大的赞赏 !