From 5fcfd609f35a6b6ef26bc76c680317dcb102adbf Mon Sep 17 00:00:00 2001 From: "Leslie H." Date: Mon, 20 May 2024 15:21:50 -0400 Subject: [PATCH] Customize cache step to cache node_modules --- .github/workflows/package.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index daa32998..757dd6cd 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -65,13 +65,21 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - cache: yarn + + - uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install dependencies + if: steps.yarn-cache.outputs.cache-hit != "true" run: yarn install --network-timeout 300000 - name: Fix Windows x86 sqlite3 binding - if: startsWith(matrix.os, 'windows') && matrix.target == 'x86' + if: steps.yarn-cache.outputs.cache-hit != "true" && startsWith(matrix.os, 'windows') && matrix.target == 'x86' run: yarn upgrade sqlite3 # Prebuilt binding is for x64. We must build from source for x86 target. # See: