symphonyoss/hubot-symphony

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: node_js
node_js:
  - 8

env:
  # setup for integration tests & turn off any internal logging in tests
  - SYMPHONY_HOST=foundation-dev.symphony.com SYMPHONY_KM_HOST=foundation-dev-api.symphony.com SYMPHONY_SESSIONAUTH_HOST=foundation-dev-api.symphony.com SYMPHONY_AGENT_HOST=foundation-dev-api.symphony.com HUBOT_SYMPHONY_LOG_LEVEL=alert

before_script:
  # fetch certificates for integration tests against foundation-dev pod
  - "if [[ $TRAVIS_PULL_REQUEST -eq 'false' ]]; then curl -s https://raw.githubusercontent.com/symphonyoss/contrib-toolbox/master/scripts/download-files.sh | bash; fi;"

script:
  # run flow typing
  - npm run flow
  # execute tests with coverage instrumentation
  - npm run test-cov
  # execute integration tests against foundation-dev pod
  - "if [[ $TRAVIS_PULL_REQUEST -eq 'false' ]]; then npm run-script it; fi;"
  - npm run build
  # Cannot run on external PRs due to https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
  - "if [[ $TRAVIS_PULL_REQUEST -eq 'false' ]]; then npm install ; npm run whitesource; fi;"
  # Break the build, if any Whitesource policy violation is found
  - "if [[ -e 'ws-log-policy-violations.json' ]]; then echo 'Found Whitesource Policy violation, build failed.' ; exit -1; fi;"

after_success:
  # publish coverage results to coveralls
  - 'cat ./coverage/lcov.info | ./node_modules/.bin/coveralls'
  # publish coverage results to codeclimate
  - 'cat ./coverage/lcov.info | ./node_modules/.bin/codeclimate-test-reporter'
  # deploy to npm if required
  - npx semantic-release