From 92d74c25e3dad789bd183f8da6c3b4f9760c1adf Mon Sep 17 00:00:00 2001 From: Gavin Birkhoff Date: Sun, 18 Jun 2023 17:00:59 +0800 Subject: [PATCH] Update node-ci.yml --- .github/workflows/node-ci.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 702b2b8..8565274 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -8,23 +8,39 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x] + node-version: [16.x] steps: - - uses: actions/checkout@v3 - - - name: Install pnpm - uses: pnpm/install-action@v2.2.4 - with: - version: 7 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: pnpm run install, build + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash run: | - pnpm run init + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: pnpm run install, build + run: pnpm run init env: CI: true