forked from js-joda/js-joda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (72 loc) · 2.17 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
language: node_js
os:
- linux
node_js:
- "--lts" # use latest stable node version
# to speed up/parallelize the build, we use the travis matrix feature
# - CI_STEP=build will run the (webpack) build and doc build
# - CI_STEP=node will run the mocha/typescript (node local) tests as well as providing testcoverage
# - CI_STEP=karma will run the karma tests with the travis local browsers (Firefox and PhantomJS)
# - CI_STEP=saucelabs will run the karma tests with the saucelabs browsers
env:
- CI_STEP=build
- CI_STEP=node
- CI_STEP=karma
- CI_STEP=saucelabs
before_script:
# for karma tests, start xvfb and give it some time to start
- if [[ "$CI_STEP" == "karma" ]]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3; fi
install:
- npm install
- npx lerna clean -y
- npx lerna link
- npx lerna bootstrap --no-ci
script:
- #export
# CI_STEP = build steps to run
- if [[ "$CI_STEP" == "build" ]]; then
(
set -evx;
npx lerna run --stream build-dist;
npx lerna run --stream build-all;
npx lerna run --stream lint;
npm run build-esdoc;
)
fi
# CI_STEP = node steps to run
- if [[ "$CI_STEP" == "node" ]]; then
(
set -evx;
npx lerna run --stream test;
npx lerna run --stream test-ts-definitions;
npx lerna run --stream test-coverage;
)
fi
# CI_STEP = karma steps to run
- if [[ "$CI_STEP" == "karma" ]]; then
(
set -evx;
npx lerna run --stream test-browser -- -- --browsers PhantomJS --browserNoActivityTimeout 20000;
)
fi
# CI_STEP = saucelabs steps to run,
# since it needs encrypted env variables, it cannot run on Pull Requests!
- if [[ "$CI_STEP" == "saucelabs" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ -n "$SAUCE_USERNAME" ]]; then
(
set -evx;
npx lerna run --stream test-saucelabs;
)
fi
after_success:
- if [[ "$CI_STEP" == "node" ]]; then
(
npm run build-test-coverage-report;
cat ./build/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js;
)
fi
addons:
sauce_connect: true
notifications:
slack:
rooms:
- js-joda:WtVY1EJYfAiiDW3QMnAWJZe2#travis