From 71782d7a6db95c04d249f4a026757c25c38f874f Mon Sep 17 00:00:00 2001 From: exactlyaron Date: Fri, 23 Oct 2020 16:54:29 +0100 Subject: [PATCH] ci(circle): cache dependencies [ch2770] --- .circleci/config.yml | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3510f0b..08f2445 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,16 +2,23 @@ version: 2 jobs: unit test: docker: - # use node:lts - image: cimg/node:lts environment: TZ: "Europe/London" working_directory: ~/repo steps: - checkout + - restore_cache: + keys: + - v1-deps-{{ checksum "package.json" }} + - v1-deps- - run: name: install command: npm install + - save_cache: + key: v1-deps-{{ checksum "package.json" }} + paths: + - node_modules - run: name: test command: npm test @@ -32,19 +39,26 @@ jobs: command: npm run lint release: docker: - # use node:lts - - image: cimg/node:lts - environment: - TZ: "Europe/London" + - image: cimg/node:lts + environment: + TZ: "Europe/London" working_directory: ~/repo steps: - - checkout - - run: - name: install - command: npm install - - run: - name: release - command: npx semantic-release + - checkout + - restore_cache: + keys: + - v1-deps-{{ checksum "package.json" }} + - v1-deps- + - run: + name: install + command: npm install + - save_cache: + key: v1-deps-{{ checksum "package.json" }} + paths: + - node_modules + - run: + name: release + command: npx semantic-release workflows: version: 2 test_and_release: