pkg: update ci

Use cache only when installing
Use workspaces to share node_modules
This commit is contained in:
Nodar Chkuaselidze 2018-09-07 18:42:29 +04:00
parent 15b024a392
commit a411e31c62
No known key found for this signature in database
GPG Key ID: 8E1B4DC29040BD90

View File

@ -1,9 +1,12 @@
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.2
version: 2.0
jobs:
install:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
<<: *defaults
steps:
- checkout
- restore_cache:
@ -16,17 +19,15 @@ jobs:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: .
paths: .
test:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- attach_workspace:
at: .
- run:
name: Tests with coverage
command: npm run test-ci
@ -38,17 +39,10 @@ jobs:
command: ./node_modules/.bin/codecov
lint:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- attach_workspace:
at: .
- run:
name: Lint
command: npm run lint-ci
@ -64,5 +58,3 @@ workflows:
- test:
requires:
- install