From a6a71937b872a53ae54ac06a76f1a75dfb8bd408 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Thu, 2 Dec 2021 09:15:34 +0000 Subject: [PATCH] Change CircleCI npm caching to be more aggressive Make sure static files build happens before linting --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a433b1a57..c91b348667 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,20 +36,20 @@ jobs: steps: - checkout - restore_cache: - keys: - - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - - node-v1-{{ .Branch }}- - - node-v1- - - run: npm install --no-save + key: frontend-v1-{{ checksum "package-lock.json" }} + # Only install if node_modules wasn’t cached. + - run: | + if [[ ! -e "node_modules" ]]; then + npm install --no-save --no-optional --no-audit --no-fund --progress=false + fi - save_cache: paths: - - ~/project/node_modules/ - key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - - run: npm run build + - node_modules + key: frontend-v1-{{ checksum "package-lock.json" }} + - run: npm run dist - run: npm run lint:js - run: npm run lint:css - run: npm run test:unit:coverage -- --runInBand - - run: npm run dist - run: bash <(curl -s https://codecov.io/bash) -F frontend nightly-build: