From 632e197ad19a238606d8ec4d481bac33b3f1e4b2 Mon Sep 17 00:00:00 2001 From: Mehdi Benadda Date: Mon, 4 Feb 2019 23:58:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(ci)=20use=20yarn.lock=20instead=20?= =?UTF-8?q?of=20package.json=20checksum=20as=20cache=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were using a package.json checksum as cache key, but this is not ideal as it means we still get cache hits if yarn.lock is updated when package.json is not. On the other hand, whenever package.json is updated, yarn.lock will necessarily be updated too. --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dea37c76eb..56e7eb7453 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -238,7 +238,7 @@ jobs: - checkout - restore_cache: keys: - - v3-front-dependencies-{{ checksum "package.json" }} + - v3-front-dependencies-{{ checksum "yarn.lock" }} - attach_workspace: at: ~/fun/src/richie/locale - run: @@ -533,7 +533,7 @@ jobs: - save_cache: paths: - ./node_modules - key: v3-front-dependencies-{{ checksum "package.json" }} + key: v3-front-dependencies-{{ checksum "yarn.lock" }} lint-front-tslint: docker: @@ -543,7 +543,7 @@ jobs: - checkout - restore_cache: keys: - - v3-front-dependencies-{{ checksum "package.json" }} + - v3-front-dependencies-{{ checksum "yarn.lock" }} - run: name: Lint code with tslint command: yarn lint @@ -556,7 +556,7 @@ jobs: - checkout - restore_cache: keys: - - v3-front-dependencies-{{ checksum "package.json" }} + - v3-front-dependencies-{{ checksum "yarn.lock" }} - run: name: Lint JS/TS/JSON and CSS/SCSS code with prettier command: yarn prettier --list-different "src/richie-front/js/**/*.+(ts|tsx|json|js|jsx)" "*.+(ts|tsx|json|js|jsx)" "src/**/*.+(css|scss)" @@ -569,7 +569,7 @@ jobs: - checkout - restore_cache: keys: - - v3-front-dependencies-{{ checksum "package.json" }} + - v3-front-dependencies-{{ checksum "yarn.lock" }} - run: name: Run tests # Circle CI needs the tests to be ran sequentially, otherwise it hangs. See Jest docs below: