Skip to content

Commit

Permalink
circle ci: yarn cache uses package.json checksum as a key
Browse files Browse the repository at this point in the history
Summary:
To better utilize Circle CI caching, yarn cache will use package.json file checksum as key in addition to arch, because in most cases yarn cache will be updated if package.json updates.

Circle CI sample apps use yarn.lock checksum as yarn cache key, but react-native don't have yarn.lock in the repo, so it's best to use package.json instead.
Closes facebook#19395

Differential Revision: D8125405

Pulled By: hramos

fbshipit-source-id: 5c7aa312231cc0b42bc502a5177bb84e31bcd305
  • Loading branch information
dulmandakh authored and macdoum1 committed Jun 28, 2018
1 parent 56263fa commit 206825c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ aliases:
# Cache Management
- &restore-yarn-cache
keys:
- v1-yarn-cache-{{ arch }}-{{ checksum "package.json" }}
- v1-yarn-cache-{{ arch }}
- &save-yarn-cache
paths:
- ~/.cache/yarn
key: v1-yarn-cache-{{ arch }}
key: v1-yarn-cache-{{ arch }}-{{ checksum "package.json" }}

- &restore-node-modules
keys:
Expand Down

0 comments on commit 206825c

Please sign in to comment.