From bc207b3c28c66e1d49a3c1ced4484eb24fdd5782 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 20 Dec 2017 12:41:13 -0800 Subject: [PATCH] Improve CI caching - Cache .eslintcache separately; don't write it until after linting - Better key names and fallbacks (see https://circleci.com/docs/2.0/caching/) --- .circleci/config.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8ac1ab1a4d..aaac65a6b99 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,20 +24,29 @@ jobs: steps: - checkout - restore_cache: - key: v1-mapbox-gl-js-cache + keys: + - v1-yarn-{{ checksum "yarn.lock" }} + - v1-yarn + - restore_cache: + keys: + - v1-lint-{{ .Branch }} + - v1-lint - run: name: install dependencies command: yarn - save_cache: - key: v1-mapbox-gl-js-cache + key: v1-yarn-{{ checksum "yarn.lock" }} paths: - '~/.yarn' - - '.eslintcache' - 'node_modules' - run: name: run tests command: | bash ./.circleci/test.sh + - save_cache: + key: v1-lint-{{ .Branch }}-{{ .Revision }} + paths: + - '.eslintcache' - store_artifacts: path: "test/integration/render-tests/index.html" - store_artifacts: