forked from senecajs/seneca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (46 loc) · 1.61 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
language: node_js
sudo: false
node_js:
- '4'
- '6'
- '8'
- '10'
env:
global:
- TIMEOUT_MULTIPLIER=8
matrix:
- TEST_SUITE=senecajs/seneca
- TEST_SUITE=senecajs/seneca-entity
- TEST_SUITE=senecajs/seneca-transport
install:
- NODE_VERSION=$(node -v); if [ ${NODE_VERSION:1:2} -ge 10 ]; then npm i -g npm@6; npm ci; else npm install; fi
before_script:
- export SENECA_REPO_NAME=${TRAVIS_REPO_SLUG%/*}
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- if [ "null" == "$BRANCH" ]; then BRANCH=""; else BRANCH="#$BRANCH"; fi
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
- TEST_SUITE_FOLDER=$(basename $TEST_SUITE)
- echo "TEST_SUITE:$TEST_SUITE"
- echo "TEST_SUITE_FOLDER:$TEST_SUITE_FOLDER"
- SENECA_INSTALL=https://github.com/$SENECA_REPO_NAME/seneca$BRANCH;
- echo "SENECA_INSTALL:$SENECA_INSTALL";
- if [ $TEST_SUITE_FOLDER != 'seneca' ]; then
git clone https://github.com/$TEST_SUITE;
cd $TEST_SUITE_FOLDER;
npm i;
npm uninstall seneca;
npm install $SENECA_INSTALL;
fi
script:
- npm test
- if [ ${NODE_VERSION:1:2} -ge 10 ]; then npm audit; fi
after_script:
- npm run coveralls
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/b98f41fd6ac7d5740632
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false