Skip to content

Commit 7b1aa47

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.
1 parent 8770d5f commit 7b1aa47

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
@@ -139,7 +139,7 @@ jobs:
139139
- restore_cache:
140140
keys:
141141
- *cache_key
142-
- run: yarn install --frozen-lockfile
142+
- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
143143
- persist_to_workspace:
144144
root: *workspace_location
145145
paths:
@@ -275,13 +275,12 @@ jobs:
275275
- restore_cache:
276276
keys:
277277
- *cache_key_win
278-
- run: yarn install --frozen-lockfile
278+
- run: yarn install --frozen-lockfile --cache-folder ../.cache/yarn
279279
- run: yarn build
280280
- save_cache:
281281
key: *cache_key_win
282282
paths:
283-
# Get cache dir on windows via `yarn cache dir`
284-
- C:\Users\circleci\AppData\Local\Yarn\Cache\v4
283+
- ~/.cache/yarn
285284
# Only jobs downstream from this one will see the updated workspace
286285
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
287286
- persist_to_workspace:

0 commit comments

Comments
 (0)