dist: trusty
addons:
  sonarqube:
    organization: "$SONAR_ORGANIZATION"
    token:
      secure: "$SONAR_TOKEN"
    github_token:
      secure: "$GITHUB_ACCESS_TOKEN"
    branches:
      - master
      - /[build|chore|ci|docs|feat|fix|perf|refactor|revert|spike|style|test].*/
jdk:
  - oraclejdk8
language: node_js
cache:
  directories:
    - '$HOME/.sonar/cache'
    - node_modules
notifications:
  email: false
node_js:
  - 8
  - 7
  - 6
  - node
before_script:
  - chmod +x .github/assets/prepend-header.sh
  - npm prune
script:
  - npm run build
  - npm test
  - sonar-scanner -Dproject.settings=sonar-project.properties -Dsonar.organization=$SONAR_ORGANIZATION -Dsonar.login=$SONAR_TOKEN -X
after_script:
  - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
after_success:
  - npm run docs
  - .github/assets/prepend-header.sh
branches:
  except:
    - /^v\d+\.\d+\.\d+$/
