From ef2be3a7733103e9616a0a7c5177c481cf8935fd Mon Sep 17 00:00:00 2001 From: Jacob Grisham Date: Thu, 22 Jul 2021 19:49:41 -0700 Subject: [PATCH] :green_heart: fix circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml :green_heart: test fix to circleci config.yml --- .circleci/config.yml | 19 ++++++++++++++----- package.json | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3efbe81..a78ebe9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,11 +2,10 @@ version: 2.1 defaults: &defaults docker: - - image: circleci/node:8.11 + - image: circleci/node:14.16.1 working_directory: ~/repo orbs: - node: circleci/node@3.0.0 codecov: codecov/codecov@1.2.3 jobs: @@ -14,18 +13,28 @@ jobs: <<: *defaults steps: - checkout - - run: npm test -- --coverage + - restore_cache: # restores any cache that is available from a previous build + keys: + - robofriends-cache-v1-{{ checksum "package-lock.json" }} + - robofriends-cache-v1- # if only a few changes, then don't rebuild entire node modules + - run: + name: Installing React Dependencies + command: npm install + - save_cache: # save our cache of the npm dependencies + key: robofriends-cache-v1-{{ checksum "package-lock.json" }} + paths: + - /home/circleci/repo/.npm # this is where the npm cache is stored when we use npm ci + - run: npm run coverage upload-test-coverage: <<: *defaults steps: - codecov/upload: - file: coverage/*.xml + file: /home/circleci/repo/coverage/*.xml token: $CODECOV_TOKEN workflows: node-tests: jobs: - - node/test - generate-test-coverage-report - upload-test-coverage: requires: diff --git a/package.json b/package.json index 2b61c8e..9ad713d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", + "coverage": "react-scripts test --coverage --watchAll=false", "eject": "react-scripts eject" }, "eslintConfig": {