Skip to content

Commit

Permalink
ci: run code coverage reporter only if env var is set
Browse files Browse the repository at this point in the history
the add directive doesn't seem to be effective, and the secret env vars
are not exposed on branches that are not created by the project owner

Semver: patch
  • Loading branch information
esatterwhite committed Nov 30, 2018
1 parent a76a01a commit 857b030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ sudo: required
services:
- docker

script: npm test
language: node_js
script: npm test
after_script:
- if [ -n "${CODECLIMATE_REPO_TOKEN}" ]; then npm run coverage; fi
before_install:
- docker pull nats:latest
- docker run --name=nats -p 4222:4222 -d nats:latest
- docker ps -a
git:
depth: 3

node_js:
- "6"
- "7"
- "8"
addons:
code_climate:
repo_token: 248135f96061f77d2e5f78526432fd096785d2914d8f5a73a04c061000939d5d
env:
- NODE_ENV=test

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"test": "tap --cov -Rtap test",
"posttest": "tap --coverage-report=text-lcov | ./node_modules/.bin/codeclimate-test-reporter",
"coverage": "tap --coverage-report=text-lcov | ./node_modules/.bin/codeclimate-test-reporter",
"docs": "jsdoc -c jsdoc.json && apidoc -i lib/server -o docs/api",
"start": "npm run compose:up",
"stop": "npm run compose:down",
Expand Down

0 comments on commit 857b030

Please sign in to comment.