sudo: required dist: trusty language: node_js node_js: - "7" os: - linux - osx addons: apt: packages: - xvfb - shellcheck cache: directories: - node_modules before_install: - npm config set progress=false install: - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew update; brew cleanup; brew cask cleanup; fi - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew uninstall --force brew-cask; brew update; fi - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew cask install --force google-chrome; fi - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew install shellcheck; fi - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then export DISPLAY=':99.0'; fi - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then sh -e /etc/init.d/xvfb start; fi # - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then sudo apt-get update; fi # - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then sudo apt-get install -y shellcheck; fi - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb; fi - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then sudo dpkg -i google-chrome*.deb; fi - npm --progress false --loglevel warn install script: - echo $TRAVIS_OS_NAME - node --version - npm --version - shellcheck bin/*.sh - npm run lint - npm run dist - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then WECHATY_LOG=silly npm run test:phantomjs; fi - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then WECHATY_LOG=silly npm run test:chrome; fi - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then WECHATY_LOG=verbose npm run nycava; fi notifications: webhooks: urls: - https://webhooks.gitter.im/e/41a19fbf1d54a04e5217 on_success: always # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: never # options: [always|never|change] default: always notifications: email: on_success: change on_failure: change after_success: - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then npm run coverage; fi before_deploy: - npm version - npm run dist deploy: provider: npm email: zixia@zixia.net api_key: "$NPM_TOKEN" skip_cleanup: true