forked from valor-software/ngx-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
128 lines (120 loc) · 3.25 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
sudo: false
language: node_js
node_js: "8"
notifications:
email: false
git:
depth: 3
submodules: false
env:
global:
- SAUCE_USERNAME_PR=valorkinpr
- SAUCE_ACCESS_KEY_PR=e0a97bd3-4b74-4408-89bf-cce1b44a8bf1
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
- LOGS_DIR=/tmp/logs
stages:
- name: precache
if: ( branch = development AND type = push ) OR type = pull_request
- name: lint
if: ( branch = development AND type = push ) OR type = pull_request
- name: test
if: ( branch = development AND type = push ) OR type = pull_request
- name: build
if: ( branch = development AND type = push ) OR type = pull_request
- name: deploy-surge
if: branch = development AND type = push
- name: deploy-heroku
if: branch = development AND type = push
- name: sauce-tests
if: ( branch = development AND type = push ) OR type = pull_request
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- rm -rf node_modules/ngx-bootstrap
install:
- npm install > /dev/null
- npm run build > /dev/null
- if [[ "$NGV" == "latest" ]]; then ./scripts/ci/npm-ng-latest.sh; fi
- if [[ "$NGV" == "next" ]]; then ./scripts/ci/npm-ng-next.sh; fi
- npm i ./dist > /dev/null
- if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi
jobs:
fast_finish: true
allow_failures:
- env: NGV=next
- env: SAUCE=true
- stage: sauce-tests
include:
# precache npm and apt dependencies
- stage: precache
install: npm install > /dev/null
script: true
addons:
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
# required by node-gyp to build some packages
packages:
- g++-4.8
# lint code
- stage: lint
install: true
script: npm run lint
# test
- &test
stage: test
script: npm run test-coverage
after_success:
- ./node_modules/.bin/codecov
- <<: *test
env: NGV=latest
- <<: *test
env: NGV=next
# check prod build
- &build
stage: build
script: npm run demo.ng-build
- <<: *build
env: NGV=latest
- <<: *build
env: NGV=next
- stage: sauce-tests
env: SAUCE=true
before_script:
- mkdir -p $LOGS_DIR
- ./scripts/sauce/sauce_connect_setup.sh
script:
- ./scripts/sauce/sauce_connect_block.sh
- npm run test-cross
after_script: ./scripts/sauce/sauce_connect_teardown.sh
# deploy to ngx-bootstrap.surge.sh
- &surge
stage: deploy-surge
script: npm run demo.build
deploy:
provider: surge
project: ./gh-pages/
domain: ngx-bootstrap.surge.sh
on: development
- <<: *surge
env: NGV=latest
deploy:
provider: surge
project: ./gh-pages/
domain: ngx-bootstrap-latest.surge.sh
on: development
- stage: deploy-heroku
script: npm run build:dynamic
deploy:
provider: heroku
api_key: $HEROKU_API_KEY
skip_cleanup: true
app: ngx-universal
on: development
cache:
apt: true
npm: true
directories:
- node_modules