Skip to content

Commit d707225

Browse files
authored
[GHA] Introduce node module caching (#29170)
1 parent d599f94 commit d707225

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,20 @@ jobs:
125125
exit 1
126126
fi
127127
128-
- run: npm ci
128+
- name: Cache node_modules
129+
id: node-modules-cache
130+
uses: actions/cache@v5
131+
with:
132+
path: node_modules
133+
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
134+
135+
- name: Run sync (if cache hit)
136+
run: npm run sync
137+
if: steps.node-modules-cache.outputs.cache-hit == 'true'
138+
139+
- name: Node install (cache miss)
140+
run: npm ci
141+
if: steps.node-modules-cache.outputs.cache-hit != 'true'
129142

130143
- uses: actions/cache/restore@v5
131144
with:

0 commit comments

Comments
 (0)