docs(readme): Add badges
This adds badges to the readme, including the coverage one (through coveralls).
This commit is contained in:
parent
cf79202ba1
commit
bfa06b26c3
9 changed files with 49 additions and 5 deletions
1
.coveralls.yml
Normal file
1
.coveralls.yml
Normal file
|
|
@ -0,0 +1 @@
|
|||
service_name: travis-ci
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
coverage/
|
||||
dist/
|
||||
docs/
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
|||
.DS_Store
|
||||
coverage/
|
||||
node_modules/
|
||||
dist/
|
||||
npm-debug.log*
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ before_install:
|
|||
before_cache: npm prune
|
||||
install: npm install
|
||||
script: ./scripts/test-ci
|
||||
after_script: ./scripts/travis-after-script
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
|
|
|||
18
README.md
18
README.md
|
|
@ -2,11 +2,23 @@
|
|||
|
||||
The easiest way to add search to your documentation. For free.
|
||||
|
||||
[![build status][1]](http://travis-ci.org/algolia/docsearch)
|
||||
[![NPM version][2]](http://badge.fury.io/js/docsearch.js)
|
||||
|
||||
Check out our [website][3] to add an outstanding search to your documentation.
|
||||
|
||||
[![Version][version-svg]][package-url] [![Build Status][travis-svg]][travis-url] [![Coverage Status][coveralls-svg]][coveralls-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[version-svg]: https://img.shields.io/npm/v/docsearch.js.svg?style=flat-square
|
||||
[package-url]: https://npmjs.org/package/docsearch.js
|
||||
[travis-svg]: https://img.shields.io/travis/algolia/docsearch/master.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/algolia/docsearch
|
||||
[coveralls-svg]: https://img.shields.io/coveralls/algolia/docsearch/master.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/github/algolia/docsearch?branch=docs%2Fbadges
|
||||
[license-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square
|
||||
[downloads-url]: http://npm-stat.com/charts.html?package=docsearch.js
|
||||
[docsearch-website]: https://community.algolia.com/docsearch/?utm_medium=social-owned&utm_source=GitHub&utm_campaign=docsearch%20repository
|
||||
[docsearch-website-docs]: https://community.algolia.com/docsearch/documentation/?utm_medium=social-owned&utm_source=GitHub&utm_campaign=docsearch%20repository
|
||||
|
||||
![Eslint][4]
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
"lint": "eslint .",
|
||||
"test": "BABEL_ENV=test mocha --reporter dot ./test/helpers.js ./test/*-test.js",
|
||||
"test:watch": "BABEL_ENV=test mocha --reporter min --watch ./test/helpers.js ./test/*-test.js",
|
||||
"test:coverage": "./scripts/test-coverage",
|
||||
"gh-pages": "./scripts/gh-pages"
|
||||
},
|
||||
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)",
|
||||
|
|
@ -27,9 +28,11 @@
|
|||
"babel": "^5.8.29",
|
||||
"babel-core": "^5.8.29",
|
||||
"babel-eslint": "^4.1.3",
|
||||
"babel-istanbul": "^0.5.9",
|
||||
"babel-loader": "^5.3.2",
|
||||
"babel-plugin-rewire": "^0.1.22",
|
||||
"conventional-changelog": "^0.5.1",
|
||||
"coveralls": "^2.11.6",
|
||||
"cssnano": "^3.4.0",
|
||||
"doctoc": "^0.15.0",
|
||||
"eslint": "^1.6.0",
|
||||
|
|
@ -43,6 +46,7 @@
|
|||
"json": "^9.0.3",
|
||||
"mocha": "^2.3.4",
|
||||
"mocha-jsdom": "^1.0.0",
|
||||
"mocha-lcov-reporter": "^1.0.0",
|
||||
"mversion": "^1.10.1",
|
||||
"nd": "^1.2.0",
|
||||
"node-sass": "^3.4.2",
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
set -ev # exit when error
|
||||
|
||||
./scripts/validate-pr-done-on-develop
|
||||
npm test
|
||||
npm run test:coverage
|
||||
npm prune
|
||||
npm run shrinkwrap --dev
|
||||
NODE_ENV=production npm run build
|
||||
./scripts/validate-commit-msgs
|
||||
|
||||
if [ $TRAVIS_PULL_REQUEST == 'false' ] && [ $TRAVIS_BRANCH == 'master' ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" == 'false' ] && [ "$TRAVIS_BRANCH" == 'master' ]; then
|
||||
./scripts/finish-release
|
||||
fi
|
||||
|
|
|
|||
19
scripts/test-coverage
Executable file
19
scripts/test-coverage
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
# Will run the test and export the coverage information in ./coverage
|
||||
# This file will then be read by Travis to push it to Coveralls
|
||||
#
|
||||
# The command is long and was quite hard to write correctly.
|
||||
# We need babel-istanbul and not instanbul
|
||||
# We need the _mocha and not mocha
|
||||
# We need to use full path for each binaries
|
||||
# We need to run everything through babel-node
|
||||
|
||||
npm_bin="$(npm bin)"
|
||||
babel_istanbul_bin="${npm_bin}/babel-istanbul"
|
||||
mocha_bin="${npm_bin}/_mocha"
|
||||
|
||||
BABEL_ENV=test \
|
||||
babel-node "$babel_istanbul_bin" cover "$mocha_bin" \
|
||||
--report lcov -- \
|
||||
-R spec --reporter dot \
|
||||
./test/helpers.js ./test/*-test.js
|
||||
5
scripts/travis-after-script
Executable file
5
scripts/travis-after-script
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# Will push coverage info to coveralls. Should be ran from Travis, in the
|
||||
# `after_script` section
|
||||
|
||||
$(npm bin)/coveralls < ./coverage/lcov.info
|
||||
Loading…
Reference in a new issue