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

Commit 4bffb37

Browse files
Remove manual cache steps
setup-node action now supports caching yarn
1 parent cb2f6e2 commit 4bffb37

File tree

1 file changed

+5
-60
lines changed

1 file changed

+5
-60
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ jobs:
4747
- name: Fetch submodule tags
4848
working-directory: compiler
4949
run: git fetch --tags https://github.com/google/closure-compiler.git
50-
- name: Get yarn cache directory path
51-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
52-
- name: Print yarn cache env variable
53-
run: echo "${{ env.yarn_cache_dir }}"
54-
- name: Yarn cache
55-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
56-
with:
57-
path: ${{ env.yarn_cache_dir }}
58-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5950
- name: Install packages
6051
run: yarn install --colors=always
6152
- name: Build jar
@@ -137,6 +128,7 @@ jobs:
137128
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
138129
with:
139130
node-version: ${{ env.NODE_VERSION }}
131+
cache: yarn
140132
- name: Install GraalVM
141133
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
142134
with:
@@ -159,16 +151,6 @@ jobs:
159151
with:
160152
name: Externs folder
161153
path: packages/google-closure-compiler/externs
162-
- name: Get yarn cache directory path
163-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
164-
- name: Yarn cache
165-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
166-
id: yarn-cache
167-
with:
168-
path: ${{ env.yarn_cache_dir }}
169-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
170-
restore-keys: |
171-
${{ runner.os }}-yarn-
172154
- name: Install packages
173155
run: yarn install --colors=always
174156
- name: Build image
@@ -204,6 +186,7 @@ jobs:
204186
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
205187
with:
206188
node-version: ${{ env.NODE_VERSION }}
189+
cache: yarn
207190
- name: Setup GraalVM
208191
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
209192
with:
@@ -226,16 +209,6 @@ jobs:
226209
with:
227210
name: Externs folder
228211
path: packages/google-closure-compiler/externs
229-
- name: Get yarn cache directory path
230-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
231-
- name: Yarn cache
232-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
233-
id: yarn-cache
234-
with:
235-
path: ${{ env.yarn_cache_dir }}
236-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
237-
restore-keys: |
238-
${{ runner.os }}-yarn-
239212
- name: Install packages
240213
run: yarn install --colors=always
241214
- name: Build image
@@ -268,6 +241,7 @@ jobs:
268241
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
269242
with:
270243
node-version: ${{ env.NODE_VERSION }}
244+
cache: yarn
271245
- name: Setup GraalVM
272246
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
273247
with:
@@ -290,16 +264,6 @@ jobs:
290264
with:
291265
name: Externs folder
292266
path: packages/google-closure-compiler/externs
293-
- name: Get yarn cache directory path
294-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
295-
- name: Yarn cache
296-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
297-
id: yarn-cache
298-
with:
299-
path: ${{ env.yarn_cache_dir }}
300-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
301-
restore-keys: |
302-
${{ runner.os }}-yarn-
303267
- name: Install packages
304268
run: yarn install --colors=always
305269
- name: Build image
@@ -332,6 +296,7 @@ jobs:
332296
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 4.4.0
333297
with:
334298
node-version: ${{ env.NODE_VERSION }}
299+
cache: yarn
335300
- name: Setup GraalVM
336301
uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # 1.3.3
337302
with:
@@ -354,17 +319,6 @@ jobs:
354319
with:
355320
name: Externs folder
356321
path: packages/google-closure-compiler/externs
357-
- name: Get yarn cache directory path
358-
# See https://stackoverflow.com/a/66737579/1211524
359-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $env:GITHUB_ENV
360-
- name: Yarn cache
361-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
362-
id: yarn-cache
363-
with:
364-
path: ${{ env.yarn_cache_dir }}
365-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
366-
restore-keys: |
367-
${{ runner.os }}-yarn-
368322
- name: Install packages
369323
run: yarn install --colors=always
370324
- name: Build image
@@ -407,6 +361,7 @@ jobs:
407361
with:
408362
node-version: ${{ env.NODE_VERSION }}
409363
registry-url: https://registry.npmjs.org/
364+
cache: yarn
410365
- name: Download compiler jar
411366
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0
412367
with:
@@ -448,16 +403,6 @@ jobs:
448403
chmod 755 packages/google-closure-compiler-linux-arm64/compiler
449404
chmod 755 packages/google-closure-compiler-macos/compiler
450405
chmod 755 packages/google-closure-compiler-windows/compiler.exe
451-
- name: Get yarn cache directory path
452-
run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
453-
- name: Yarn cache
454-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # 4.2.3
455-
id: yarn-cache
456-
with:
457-
path: ${{ env.yarn_cache_dir }}
458-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
459-
restore-keys: |
460-
${{ runner.os }}-yarn-
461406
- name: Install packages
462407
run: yarn install --colors=always
463408
- name: Prepare for publish

0 commit comments

Comments
 (0)