diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d9ccaa..3797f24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,15 +38,23 @@ jobs: node-version: '20' # 根据你的项目需求选择合适的 Node.js 版本 - name: Install pnpm - run: npm install -g pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Cache pnpm modules - uses: actions/cache@v2 + uses: actions/cache@v3 with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-pnpm- + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install