circle ci: yarn cache uses package.json checksum as a key

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 https://github.com/facebook/react-native/pull/19395

Differential Revision: D8125405

Pulled By: hramos

fbshipit-source-id: 5c7aa312231cc0b42bc502a5177bb84e31bcd305
This commit is contained in:
Dulmandakh 2018-05-23 13:51:57 -07:00 committed by Facebook Github Bot
parent 390ded871c
commit 0bbac18cf0
1 changed files with 2 additions and 1 deletions

View File

@ -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: