wongjiahau/ttap-web

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
warnings_are_errors: false # So that travis don't treat warning as errors
# set notification options
notifications:
  email:
    recipients:
      - hou32hou@gmail.com
      - dheenodararao@gmail.com
    on_success: always
    on_failure: always

language: node_js # specify your language

node_js: # specify version of node js
  - "6.11.3"

cache: # cache node modules so that every build don't have to reinstall those node package again
  directories:
    - "node_modules"

before_script:
  # This is needed so that the command $(git rev-list --count --all) can work properly
  # That command will be run by ./scripts/build
  # For more info, refer https://github.com/travis-ci/travis-ci/issues/3412
  - git fetch --unshallow

script:
  - echo "Running script:"
  - ./scripts/build
  - npm test
  # Only upload coverage report if is on master branch and not on a PR
  - if [ $(git branch | grep master | wc -l) = 1 -a "$TRAVIS_PULL_REQUEST" = "false" ]; then ./scripts/upload-coverage-report; fi
  - rm -rf  ./src/core/tests/ # remove test data which is not needed in production build

after_script:
  - echo "script finished."

after_success: # upload source-analysis-report
  - source-map-explorer --html build/static/js/main.* > source_analysis/index.html
  - surge -d ttap-source-analysis.surge.sh -p ./source_analysis/

deploy:
  provider: surge
  project: ./build/
  domain: https://ttap.surge.sh
  skip_cleanup: true