Unverified Commit 0d1aec13 by Francisco Giordano Committed by GitHub

CircleCI configuration tweaks (#1868)

* remove attach_workspace

* leave default working_directory

* use npm ci for installing deps

* rename dependencies job
parent bd1f2ede
......@@ -3,75 +3,57 @@ version: 2
# unless with workaround. For simplicity just use it.
# https://github.com/CircleCI-Public/circleci-cli/issues/79
jobs:
build:
aliases:
- &defaults
docker:
- image: circleci/node:8
working_directory: ~/project
- &cache_key_node_modules
key: v1-node_modules-{{ checksum "package-lock.json" }}
jobs:
dependencies:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
<<: *cache_key_node_modules
- run:
name: Install npm dependencies
command: npm install
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package-lock.json" }}
<<: *cache_key_node_modules
lint:
docker:
- image: circleci/node:8
working_directory: ~/project
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
<<: *cache_key_node_modules
- run:
name: Linter
command: npm run lint
test:
docker:
- image: circleci/node:8
working_directory: ~/project
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
<<: *cache_key_node_modules
- run:
name: Unit tests
command: npm run test
coverage:
docker:
- image: circleci/node:8
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: ~/project
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
<<: *cache_key_node_modules
- run:
name: Unit tests with coverage report
command: npm run test
......@@ -84,13 +66,13 @@ workflows:
version: 2
everything:
jobs:
- build
- dependencies
- lint:
requires:
- build
- dependencies
- test:
requires:
- build
- dependencies
- coverage:
requires:
- build
- dependencies
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