Skip to content

Commit

Permalink
Configure CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Sep 30, 2019
1 parent 5f367cb commit 43fca74
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,111 @@
version: 2.1

references:
x-workdir: &work-dir
working_directory: ~/source

x-save-workspace: &persist-step
persist_to_workspace:
root: ~/source
paths:
- .

x-attach: &attach-step
attach_workspace:
at: .

jobs:
install-dependencies:
<<: *work-dir
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache:
keys:
- v1-npm-{{ checksum "package-lock.json" }}
- run:
name: Install dependencies
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- save_cache:
key: v1-npm-{{ checksum "package-lock.json" }}
paths:
- node_modules
- *persist-step

lint:
<<: *work-dir
docker:
- image: node
steps:
- *attach-step
- run:
name: lint
command: npm run lint

node-8:
docker:
- image: circleci/node:8
steps:
- *attach-step
- run:
name: Test
command: npm test

node-10:
docker:
- image: circleci/node:10
steps:
- *attach-step
- run:
name: Test
command: npm test

node-12:
docker:
- image: circleci/node:12
steps:
- *attach-step
- run:
name: Test with coverage
command: npm run coverage
- run:
name: Upload coverage report
command: bash <(curl -s https://codecov.io/bash) -F unit -s coverage/lcov.info

integration-test:
docker:
- image: circleci/node:12
steps:
- *attach-step
- run:
name: Integration test
command: npm run integration-test

workflows:
version: 2
sinon-test:
jobs:
- install-dependencies
- lint:
requires:
- install-dependencies
- node-8:
requires:
- install-dependencies
- node-10:
requires:
- install-dependencies
- node-12:
requires:
- install-dependencies
- integration-test:
requires:
- install-dependencies
- lint
- node-8
- node-10
- node-12

0 comments on commit 43fca74

Please sign in to comment.