Skip to content

Commit

Permalink
Merge pull request #4 from JordanHood/civ2
Browse files Browse the repository at this point in the history
ci v2
  • Loading branch information
JordanHood committed Aug 5, 2017
2 parents 6dcd6ae + f60bae0 commit 4507bce
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 17 deletions.
101 changes: 101 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
version: 2
jobs:
build:
working_directory: ~/UserApi
docker:
- image: circleci/node:6.10.3
steps:
- checkout
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- save_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
paths:
- ~/UserApi
install:
working_directory: ~/UserApi
docker:
- image: circleci/node:6.10.3
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
keys:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: install depencancies
command: npm install
- save_cache:
key: v1-node-modules-{{ checksum ".circle-sha" }}
paths:
- ~/UserApi/node_modules
lint:
working_directory: ~/UserApi
docker:
- image: circleci/node:6.10.3
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- restore_cache:
key: v1-node-modules-{{ checksum ".circle-sha" }}
- run:
name: Linting
command: npm run lint
test:
working_directory: ~/UserApi
docker:
- image: circleci/node:6.10.3
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- restore_cache:
key: v1-node-modules-{{ checksum ".circle-sha" }}
- run:
name: Create coverage directory
command: mkdir -p ~/unit
- run:
name: Unit Tests
command: npm run ci
coveralls:
working_directory: ~/UserApi
docker:
- image: circleci/node:6.10.3
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- restore_cache:
key: v1-node-modules-{{ checksum ".circle-sha" }}
- run:
name: Unit Tests
command: npm run test:coveralls
workflows:
version: 2
build_accept_deploy:
jobs:
- build
- install:
requires:
- build
- lint:
requires:
- build
- install
- test:
requires:
- build
- install
- coveralls:
requires:
- build
- install
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.9.4
6.10.3
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Coverage Status](https://coveralls.io/repos/github/JordanHood/UserApi/badge.svg?branch=master)](https://coveralls.io/github/JordanHood/UserApi?branch=master)
[![CircleCI](https://circleci.com/gh/JordanHood/UserApi/tree/master.svg?style=svg)](https://circleci.com/gh/JordanHood/UserApi/tree/master)
[![CircleCI](https://circleci.com/gh/JordanHood/UserApi.svg?style=svg)](https://circleci.com/gh/JordanHood/UserApi)


[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/JordanHood/UserApi/blob/master)
Expand Down Expand Up @@ -32,4 +32,4 @@ On startup the app will create a users table and insert some users read from `sc
* Linting is run using [StandardJs](http://standardjs.com/) which can be run with `npm run lint`.

## Documentation
Once the server is running, the api is documented using swagger, which can be accessed by going to http://localhost:3500/
Once the server is running, the api is documented using swagger, which can be accessed by going to `http://localhost:3500/`
12 changes: 0 additions & 12 deletions circle.yml

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "user_api",
"version": "2.0.0",
"version": "2.1.0",
"engines": {
"node": "6.9.4"
},
"description": "Users API build with express and Sequalize",
"private": true,
"scripts": {
"ci": "istanbul cover _mocha -- -R xunit > $CIRCLE_TEST_REPORTS/unit/results.xml",
"ci": "istanbul cover _mocha -- -R xunit > ~/unit/results.xml",
"lint": "standard",
"test": "npm run lint && npm run test:coverage",
"start": "scripts/start.sh",
"test:coverage": "NODE_PATH=${PWD} istanbul cover _mocha",
"test:coveralls": "NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"test:watch": "NODE_PATH=${PWD} mocha --watch",
"posttest": "istanbul check-coverage"
},
Expand Down

0 comments on commit 4507bce

Please sign in to comment.