add npm and caching of node_modules
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -4,11 +4,23 @@ jobs:
docker:
- image: circleci/node:11
steps:
+ - checkout # special step to check out source code to working directory
+ - run:
+ name: Update npm
+ command: 'sudo npm install -g npm@latest'
+ - restore_cache: # special step to restore the dependency cache
+ # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
+ key: dependency-cache-{{ checksum "package.json" }}
+ - run:
+ name: Install npm
+ command: npm install
+ - save_cache: # special step to save the dependency cache
+ key: dependency-cache-{{ checksum "package.json" }}
+ paths:
+ - ./node_modules
- run:
name: Lint
- command: |
- npm run lint
+ command: npm run lint
- run:
- name: Tests
- command: |
- npm run test
+ name: Test
+ command: npm test

add npm and caching of node_modules