Skip to content

Commit 327365c

Browse files
committed
update ci
1 parent 888ba19 commit 327365c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,30 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v4
2222

23+
- name: Restore node_modules from cache
24+
id: cache
25+
uses: actions/cache/restore@v4
26+
with:
27+
path: node_modules/
28+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
29+
2330
- name: Setup Node.js
31+
if: steps.cache.outputs.cache-hit != 'true'
2432
uses: actions/setup-node@v4
2533
with:
2634
node-version: ${{ vars.NODE_VERSION }}
2735
cache: yarn
2836

29-
- name: Cache node_modules
30-
uses: actions/cache@v4
37+
- if: steps.cache.outputs.cache-hit != 'true'
38+
run: yarn install --frozen-lockfile
39+
40+
- name: Save node_modules to cache
41+
if: steps.cache.outputs.cache-hit != 'true'
42+
uses: actions/cache/save@v4
3143
with:
3244
path: node_modules/
3345
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
3446

35-
- run: yarn install --frozen-lockfile
36-
3747
build:
3848
name: Build
3949
needs: [deps]

0 commit comments

Comments
 (0)