Skip to content

Commit 00f2dba

Browse files
committed
ci: use --cache-folder to make sure that yarn cache is used
With this change we use yarn `--cache-folder` to make sure that yarn cache is used in all platforms. (cherry picked from commit 7b1aa47)
1 parent 39442a6 commit 00f2dba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.circleci/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ orbs:
1717
## IMPORTANT
1818
# Windows needs its own cache key because binaries in node_modules are different.
1919
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
20-
var_1: &cache_key angular_devkit-12.18-{{ checksum "yarn.lock" }}
21-
var_1_win: &cache_key_win angular_devkit-win-12.18-{{ checksum "yarn.lock" }}
20+
var_1: &cache_key v1-angular_devkit-12.18-{{ checksum "yarn.lock" }}
21+
var_1_win: &cache_key_win v1-angular_devkit-win-12.18-{{ checksum "yarn.lock" }}
2222
var_3: &default_nodeversion "12.18"
2323
# Workspace initially persisted by the `setup` job, and then enhanced by `setup-and-build-win`.
2424
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
@@ -141,7 +141,7 @@ jobs:
141141
- restore_cache:
142142
keys:
143143
- *cache_key
144-
- run: yarn install --frozen-lockfile
144+
- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
145145
- persist_to_workspace:
146146
root: *workspace_location
147147
paths:
@@ -304,13 +304,12 @@ jobs:
304304
- restore_cache:
305305
keys:
306306
- *cache_key_win
307-
- run: yarn install --frozen-lockfile
307+
- run: yarn install --frozen-lockfile --cache-folder ../.cache/yarn
308308
- run: yarn build
309309
- save_cache:
310310
key: *cache_key_win
311311
paths:
312-
# Get cache dir on windows via `yarn cache dir`
313-
- C:\Users\circleci\AppData\Local\Yarn\Cache\v4
312+
- ~/.cache/yarn
314313
# Only jobs downstream from this one will see the updated workspace
315314
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
316315
- persist_to_workspace:

0 commit comments

Comments
 (0)