Skip to content

Commit

Permalink
Add workflows to CircleCI (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Rosario authored Jul 3, 2019
1 parent eaafcd1 commit f0b0e75
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
version: 2
general:
artifacts:
- coverage

# Set defaults to reuse
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.10.0

jobs:
build:
docker:
# specify the version you desire here
- image: node:8.10.0
working_directory: ~/repo
test:
<<: *defaults
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v2-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-

- run: npm install
- run:
name: Run tests
command: npm test
- run:
name: Send to Coveralls
command: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests
- run: npm test
# send to coveralls
- run: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
key: v2-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: ~/repo
paths:
- "."

workflows:
version: 2
test-deploy:
jobs:
- test:
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+/

0 comments on commit f0b0e75

Please sign in to comment.