pkg: add ci

This commit is contained in:
Nodar Chkuaselidze 2018-06-15 02:45:07 +04:00 committed by Javed Khan
parent ce1f1fbcb2
commit 2086385f38
No known key found for this signature in database
GPG Key ID: 7E31745B904584E6
4 changed files with 80 additions and 0 deletions

68
.circleci/config.yml Normal file
View File

@ -0,0 +1,68 @@
version: 2.0
jobs:
install:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
test:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Tests with coverage
command: npm run test-ci
- run:
name: Install codecov
command: npm i codecov
- run:
name: Submit coverage
command: ./node_modules/.bin/codecov
lint:
docker:
- image: circleci/node:10.2
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Lint
command: npm run lint-ci
workflows:
version: 2
test_and_lint:
jobs:
- install
- lint:
requires:
- install
- test:
requires:
- install

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ docker_data/
browser/bcoin*
package-lock.json
npm-debug.log
coverage/

View File

@ -1,5 +1,8 @@
# Bcoin
[![Build Status][circleci-status-img]][circleci-status-url]
[![Coverage Status][coverage-status-img]][coverage-status-url]
__NOTE__: The latest release of bcoin contains a non-backward compatible change
to the rest API. Please read the [changelog]'s "migrating" section for more
details.
@ -69,3 +72,8 @@ See LICENSE for more info.
[freenode]: https://freenode.net/
[irc]: irc://irc.freenode.net/bcoin
[changelog]: https://github.com/bcoin-org/bcoin/blob/master/CHANGELOG.md
[coverage-status-img]: https://codecov.io/gh/bcoin-org/bcoin/badge.svg?branch=master
[coverage-status-url]: https://codecov.io/gh/bcoin-org/bcoin?branch=master
[circleci-status-img]: https://circleci.com/gh/bcoin-org/bcoin/tree/master.svg?style=shield
[circleci-status-url]: https://circleci.com/gh/bcoin-org/bcoin/tree/master

View File

@ -58,6 +58,7 @@
"babelify": "^8.0.0",
"browserify": "^16.2.2",
"eslint": "^4.19.1",
"istanbul": "^1.1.0-alpha.1",
"jsdoc": "^3.5.5",
"mocha": "^5.2.0",
"uglify-es": "^3.3.9",
@ -77,11 +78,13 @@
"clean": "rm -f {browser/,}{bcoin.js,bcoin-worker.js,app.js,worker.js}",
"docs": "jsdoc -c jsdoc.json",
"lint": "eslint $(cat .eslintfiles) || exit 0",
"lint-ci": "eslint $(cat .eslintfiles)",
"lint-file": "eslint",
"test": "mocha --reporter spec test/*.js",
"test-browser": "NODE_BACKEND=js mocha --reporter spec test/*.js",
"test-file": "mocha --reporter spec",
"test-file-browser": "NODE_BACKEND=js mocha --reporter spec",
"test-ci": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec test/*.js",
"webpack": "webpack --config webpack.browser.js",
"webpack-browser": "webpack --config webpack.browser.js",
"webpack-compat": "webpack --config webpack.compat.js",