forked from styleguidist/react-styleguidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (61 loc) · 1.8 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
language: node_js
node_js:
- 4
- 6
- 8
cache:
directories:
- node_modules
- travis_phantomjs
before_install:
# Upgrade npm
- if [[ `npm -v` != 5* ]]; then npm install -g npm@latest; fi
# Upgrade PhantomJS
- |
export PHANTOMJS_VERSION=2.1.1
export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then
rm -rf $PWD/travis_phantomjs
mkdir -p $PWD/travis_phantomjs
wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
tar -xvf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs
fi
phantomjs -v
script:
# Run lint
- npm run lint
# Run tests and Danger.js
- |
if [[ "$TRAVIS_NODE_VERSION" == "4" ]]; then
NODE_ENV=test node --harmony-proxies $(npm bin)/jest --runInBand
else
if [[ "$TRAVIS_NODE_VERSION" == "8" ]]; then
npm run danger
npm run test:coverage -- --runInBand
else
npm run test:jest -- --runInBand
fi
fi
# Build all examples
- npm run build
- npm run build:customised
- npm run build:sections
# Check that examples really works: no JS errors on load
- npm run phantomjs
- npm run phantomjs:customised
- npm run phantomjs:sections
after_success:
# Make release with semantic-release if needed
- npm run semantic-release
- |
if [[ "$TRAVIS_NODE_VERSION" == "8" ]]; then
# Upload coverage report to Codecov
bash <(curl -s https://codecov.io/bash)
# Update site
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
curl -X POST -d '{}' https://api.netlify.com/build_hooks/591308eba700c425fc1e8a54
fi
fi
branches:
except:
- /^v\d+\.\d+\.\d+$/