From 1745a3db96c013c5de93b94a12a94e62511365ec Mon Sep 17 00:00:00 2001 From: johniexu <281910378@qq.com> Date: Thu, 26 Jun 2025 15:55:30 +0800 Subject: [PATCH] ci: Update node.js.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复npm缓存key在不同node.js版本并行中出现缓存key冲突的问题 --- .github/workflows/node.js.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f6f3209..6dad864 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -30,8 +30,9 @@ jobs: uses: actions/cache@v4 with: path: ~/.npm - key: ${{ runner.os }}-node-root-${{ hashFiles('package-lock.json') }} + key: ${{ runner.os }}-node-root-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} restore-keys: | + ${{ runner.os }}-node-root-${{ matrix.node-version }}- ${{ runner.os }}-node-root- - run: npm install - run: npm run build --if-present @@ -48,8 +49,9 @@ jobs: uses: actions/cache@v4 with: path: tsdoc/node_modules - key: ${{ runner.os }}-node-tsdoc-${{ hashFiles('tsdoc/package-lock.json') }} + key: ${{ runner.os }}-node-tsdoc-${{ matrix.node-version }}-${{ hashFiles('tsdoc/package-lock.json') }} restore-keys: | + ${{ runner.os }}-node-tsdoc-${{ matrix.node-version }}- ${{ runner.os }}-node-tsdoc- # tsdoc 是单独的文档项目,因为vuepress@1.X 与webpack@5.X 一起使用报错,所以单独抽离出来 - name: Generate static html files