Skip to content

Commit

Permalink
chore(ci): Update ci process (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowypowers authored Mar 20, 2018
1 parent f2ab695 commit 3c3573d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 16 deletions.
52 changes: 38 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.9.3
- image: circleci/node:8-stretch
version: 2
jobs:
build:
setup:
<<: *defaults
steps:
- run:
name: "Update npm"
command: "sudo npm i -g npm"
- run:
name: "Versions"
command: |
Expand All @@ -21,41 +24,62 @@ jobs:
- checkout
# Download and cache dependencies
- restore_cache:
key: neon-{{ checksum "package.json" }}
- run: npm install
keys:
- neon-{{ checksum "package-lock.json" }}
- neon-
- run: npm ci
- save_cache:
key: neon-{{ checksum "package.json" }}
key: neon-{{ checksum "package-lock.json" }}
paths:
- node_modules
integration-test:
build:
<<: *defaults
steps:
- checkout
- restore_cache:
key: neon-{{ checksum "package.json" }}
- run: npm run test:integration
keys:
- neon-{{ checksum "package-lock.json" }}
- neon-
- run: npm run prepublishOnly
unit-test:
<<: *defaults
steps:
- checkout
- restore_cache:
key: neon-{{ checksum "package.json" }}
keys:
- neon-{{ checksum "package-lock.json" }}
- neon-
- run: npm run test:unit
integration-test:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- neon-{{ checksum "package-lock.json" }}
- neon-
- run: npm run test:integration

workflows:
version: 2
build_and_test:
jobs:
- build
- integration-test:
- setup
- build:
requires:
- build
- setup
filters:
branches:
only: master
ignore: gh-pages
- unit-test:
requires:
- build
- setup
filters:
branches:
ignore: gh-pages
- integration-test:
requires:
- setup
filters:
branches:
only: master
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"test": "./node_modules/.bin/mocha ./test",
"test:unit": "./node_modules/.bin/mocha ./test/unit",
"test:integration": "./node_modules/.bin/mocha ./test/integration",
"test:typings": "tsc",
"test:typings": "./node_modules/.bin/tsc",
"cover": "cross-env NODE_ENV=test ./node_modules/.bin/nyc ./node_modules/.bin/mocha ./test && ./node_modules/.bin/nyc report --reporter=lcov",
"cover:unit": "cross-env NODE_ENV=test ./node_modules/.bin/nyc ./node_modules/.bin/mocha ./test/unit && ./node_modules/.bin/nyc report --reporter=lcov",
"cover:integration": "cross-env NODE_ENV=test ./node_modules/.bin/nyc ./node_modules/.bin/mocha ./test/integration && ./node_modules/.bin/nyc report --reporter=lcov",
Expand All @@ -63,7 +63,7 @@
"build:docs": "cd docs && sphinx-versioning -g ../ -l ./conf.py build docs ../docs/_build/html",
"deploy:docs": "cd docs && sphinx-versioning -g ../ -l ./conf.py push docs gh-pages .",
"rebuild": "rm -rf ./node_modules && npm install && ./node_modules/.bin/webpack",
"prepublishOnly": "npm run test:typings && npm run lint && npm run build:prod"
"prepublishOnly": "npm run test:typings && npm run lint && npm run build:prod"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 3c3573d

Please sign in to comment.