machine:
  node:
    version: 4.0.0
test:
  override:
    - npm run lint
    - XUNIT_FILE=${CIRCLE_TEST_REPORTS}/mocha.xml npm test --coverage -- -R spec-xunit-file
    # Run integration test suite
    - npm run integration
    - npm run apidoc
  post:
    - npm run report-coverage
deployment:
  production:
    branch: master
    commands:
      # Necessary git config to run website deployment on CircleCI
      - git config --global user.email "info@circleci.com"
      - git config --global user.name "CircleCI"
      - git config --global push.default simple
      - node scripts/publish_web.js
      - mv npmrc-env .npmrc
      - if [ -z "$(npm info $(npm ls --depth=-1 2>/dev/null | head -1 | cut -f 1 -d " ") 2>/dev/null)" ] ; then npm publish ; fi
general:
  artifacts:
    - "coverage/lcov-report"
    - "apidoc-out"
