Skip to content

Commit

Permalink
Customize cache step to cache node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepyLeslie committed May 20, 2024
1 parent 4463a17 commit 5fcfd60
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5fcfd60

Please sign in to comment.