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