Commit 0b7f1777 by Francisco Giordano

Add npm install step to every circle job

parent 0d1aec13
...@@ -8,6 +8,14 @@ aliases: ...@@ -8,6 +8,14 @@ aliases:
docker: docker:
- image: circleci/node:8 - image: circleci/node:8
- &npm_install_if_necessary
run:
name: Install npm dependencies
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- &cache_key_node_modules - &cache_key_node_modules
key: v1-node_modules-{{ checksum "package-lock.json" }} key: v1-node_modules-{{ checksum "package-lock.json" }}
...@@ -18,12 +26,7 @@ jobs: ...@@ -18,12 +26,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
<<: *cache_key_node_modules <<: *cache_key_node_modules
- run: - *npm_install_if_necessary
name: Install npm dependencies
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- save_cache: - save_cache:
paths: paths:
- node_modules - node_modules
...@@ -35,6 +38,7 @@ jobs: ...@@ -35,6 +38,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
<<: *cache_key_node_modules <<: *cache_key_node_modules
- *npm_install_if_necessary
- run: - run:
name: Linter name: Linter
command: npm run lint command: npm run lint
...@@ -44,6 +48,7 @@ jobs: ...@@ -44,6 +48,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
<<: *cache_key_node_modules <<: *cache_key_node_modules
- *npm_install_if_necessary
- run: - run:
name: Unit tests name: Unit tests
command: npm run test command: npm run test
...@@ -54,6 +59,7 @@ jobs: ...@@ -54,6 +59,7 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
<<: *cache_key_node_modules <<: *cache_key_node_modules
- *npm_install_if_necessary
- run: - run:
name: Unit tests with coverage report name: Unit tests with coverage report
command: npm run test command: npm run test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment