Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 58d4169

Browse files
Manually cache node_modules folder
1 parent 1d14fcb commit 58d4169

File tree

1 file changed

+43
-19
lines changed

1 file changed

+43
-19
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ jobs:
4848
- name: Fetch submodule tags
4949
working-directory: compiler
5050
run: git fetch --tags https://github.com/google/closure-compiler.git
51-
- name: Enable yarn caching
52-
run: yarn config set enableGlobalCache true
51+
- name: Yarn cache
52+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
53+
with:
54+
path: |
55+
node_modules
56+
packages/google-closure-compiler/node_modules
57+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
5358
- name: Use Node.js ${{ env.NODE_VERSION }}
5459
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
5560
with:
5661
node-version: ${{ env.NODE_VERSION }}
57-
cache: yarn
5862
- name: Install packages
5963
run: yarn install --colors=always
6064
- name: Build jar
@@ -132,13 +136,17 @@ jobs:
132136
CC=musl-gcc ./configure --prefix=$MUSL_HOME --static
133137
make && make install
134138
popd
135-
- name: Enable yarn caching
136-
run: yarn config set enableGlobalCache true
139+
- name: Yarn cache
140+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
141+
with:
142+
path: |
143+
node_modules
144+
packages/google-closure-compiler/node_modules
145+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
137146
- name: Use Node.js ${{ env.NODE_VERSION }}
138147
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
139148
with:
140149
node-version: ${{ env.NODE_VERSION }}
141-
cache: yarn
142150
- name: Install GraalVM
143151
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
144152
with:
@@ -192,13 +200,17 @@ jobs:
192200
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
193201
with:
194202
ref: ${{ inputs.release-tag || '' }}
195-
- name: Enable yarn caching
196-
run: yarn config set enableGlobalCache true
203+
- name: Yarn cache
204+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
205+
with:
206+
path: |
207+
node_modules
208+
packages/google-closure-compiler/node_modules
209+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
197210
- name: Use Node.js ${{ env.NODE_VERSION }}
198211
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
199212
with:
200213
node-version: ${{ env.NODE_VERSION }}
201-
cache: yarn
202214
- name: Setup GraalVM
203215
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
204216
with:
@@ -249,13 +261,17 @@ jobs:
249261
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
250262
with:
251263
ref: ${{ inputs.release-tag || '' }}
252-
- name: Enable yarn caching
253-
run: yarn config set enableGlobalCache true
264+
- name: Yarn cache
265+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
266+
with:
267+
path: |
268+
node_modules
269+
packages/google-closure-compiler/node_modules
270+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
254271
- name: Use Node.js ${{ env.NODE_VERSION }}
255272
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
256273
with:
257274
node-version: ${{ env.NODE_VERSION }}
258-
cache: yarn
259275
- name: Setup GraalVM
260276
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
261277
with:
@@ -306,13 +322,17 @@ jobs:
306322
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
307323
with:
308324
ref: ${{ inputs.release-tag || '' }}
309-
- name: Enable yarn caching
310-
run: yarn config set enableGlobalCache true
325+
- name: Yarn cache
326+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
327+
with:
328+
path: |
329+
node_modules
330+
packages/google-closure-compiler/node_modules
331+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
311332
- name: Use Node.js ${{ env.NODE_VERSION }}
312333
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
313334
with:
314335
node-version: ${{ env.NODE_VERSION }}
315-
cache: yarn
316336
- name: Setup GraalVM
317337
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
318338
with:
@@ -371,15 +391,19 @@ jobs:
371391
- name: Checkout repo
372392
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
373393
with:
374-
ref: ${{ inputs.release-tag || '' }}
375-
- name: Enable yarn caching
376-
run: yarn config set enableGlobalCache true
394+
ref: ${{ inputs.release-tag || '' }}c
395+
- name: Yarn cache
396+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
397+
with:
398+
path: |
399+
node_modules
400+
packages/google-closure-compiler/node_modules
401+
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-yarn-${{ hashFiles('**/yarn.lock') }}
377402
- name: Use Node.js ${{ env.NODE_VERSION }}
378403
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
379404
with:
380405
node-version: ${{ env.NODE_VERSION }}
381406
registry-url: https://registry.npmjs.org/
382-
cache: yarn
383407
- name: Download compiler jar
384408
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0
385409
with:

0 commit comments

Comments
 (0)