forked from sweetalert2/sweetalert2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
58 lines (48 loc) · 1.56 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
language: node_js
dist: xenial
node_js: lts/*
sudo: true
addons:
firefox: latest
chrome: stable
# limit the Travis 'build on push' feature to master and dist branches only
branches:
only:
- master
install:
- yarn install
- yarn build
# bundlesize
- yarn global add bundlesize@^0.17.0
- bundlesize -f dist/sweetalert2.all.min.js -s 15kB
# prevent adding devDependencies with a shitload of subdependencies
- if [ `yarn list | wc -l` -gt 4000 ]; then
exit 1;
fi
script:
- if [[ "$TRAVIS_EVENT_TYPE" != "cron" ]]; then
yarn run check;
fi;
- if [[ "$TRAVIS_EVENT_TYPE" = "cron" ]]; then
travis_retry yarn check:sauce &&
yarn check:third-party;
fi;
notifications:
email:
on_success: never
after_success:
# run automated release process with semantic-release
- if [[ "$TRAVIS_BRANCH" = "master" ]]; then
yarn global add [email protected] @semantic-release/changelog@3 @semantic-release/[email protected] @semantic-release/[email protected];
semantic-release;
fi;
# report coverage to coveralls.io and deploy to surge.sh
# https://github.com/travis-ci/travis-ci/issues/6652#issuecomment-255597049
# '/' symbols must be replaced, https://stackoverflow.com/a/13210909
- if [[ "$TRAVIS_EVENT_TYPE" != "cron" ]]; then
yarn global add coveralls@3 surge &&
cat ./coverage/lcov.info | coveralls &&
BRANCH_NAME=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} &&
BRANCH_NAME=${BRANCH_NAME//\//-} &&
surge coverage "sweetalert2-coverage-${BRANCH_NAME}.surge.sh";
fi;