/
circle.yml
44 lines (37 loc) · 1.2 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
machine:
node:
version: 6.1
environment:
# Save mocha test results
MOCHA_FILE: "$CIRCLE_TEST_REPORTS/mocha.xml"
dependencies:
post:
# For some reason this plugin is not automatically installed inside the CircleCI container
- npm install eslint-plugin-import@latest
# Needed for proper mocha test results
- npm install mocha-circleci-reporter
- npm install codecov
# Needed for hosted API docs
- npm install esdoc-uploader
test:
override:
# Lint files
- node_modules/.bin/eslint -f junit src > $CIRCLE_TEST_REPORTS/eslint.xml
# Run mocha tests
- NODE_ENV=test node_modules/.bin/nyc npm test -- --reporter mocha-circleci-reporter
# Check coverage
- node_modules/.bin/nyc check-coverage --statements 90 --branches 90 --functions 90 --lines 90
# Report coverage
- node_modules/.bin/nyc report --reporter=lcov > coverage.lcov | node_modules/.bin/codecov
# Create API docs and validate coverage
- npm run docs
# Check API docs for broken links
- npm run test:docs
post:
# Save API docs
- cp -R docs/api $CIRCLE_ARTIFACTS
deployment:
staging:
branch: master
commands:
- node_modules/.bin/esdoc-uploader