forked from wechaty/wechaty
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
79 lines (63 loc) · 2.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
sudo: required
dist: trusty
language: node_js
node_js:
- "6"
- "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 install phantomjs-prebuilt
- 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