ci: share yarn cache on Circle
On a cache miss, `yarn install` via `make node_modules` takes about 42 seconds, plus about 19 seconds to upload the cache. See https://circleci.com/gh/influxdata/platform/1872. On a cache hit, `make node_modules` takes about 7 seconds to download the cache plus 19 seconds to `yarn install`. See https://circleci.com/gh/influxdata/platform/1877. Using the cache here is a net gain of about 16 seconds on cache hit, which is the most likely case given a random commit.pull/10616/head
parent
5b4506db1d
commit
8a6749fc1c
|
@ -6,6 +6,21 @@ jobs:
|
|||
working_directory: /go/src/github.com/influxdata/platform
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Run yarn install, using Circle's cache if applicable.
|
||||
- restore_cache:
|
||||
name: Restore Yarn package cache
|
||||
keys:
|
||||
# Only cache on exact yarn.lock match, as in Circle's yarn example:
|
||||
# https://circleci.com/docs/2.0/yarn/
|
||||
- chronograf-yarn-packages-{{ checksum "chronograf/ui/yarn.lock" }}
|
||||
- run: make node_modules
|
||||
- save_cache:
|
||||
name: Save Yarn package cache
|
||||
key: chronograf-yarn-packages-{{ checksum "chronograf/ui/yarn.lock" }}
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
|
||||
- run: make test-js
|
||||
|
||||
gotest:
|
||||
|
|
Loading…
Reference in New Issue