forked from unchained-capital/caravan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (62 loc) · 1.83 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
language: node_js
notifications:
email:
recipients:
on_success: change
on_failure: always
jobs:
include:
- stage: "Tests"
node_js: 8
name: "Node JS 8"
script: npm run test
- node_js: 10
name: "Node JS 10"
script: npm run test
- node_js: 12
name: "Node JS 12"
script: npm run ci
- stage: "Cypress Tests"
node_js: 10
addons:
apt:
packages:
# Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
- libgconf-2-4
cache:
# Caches $HOME/.npm when npm ci is default script commandK
# Caches node_modules in all other cases
npm: true
directories:
# we also need to cache folder with Cypress binary
- ~/.cache
install:
- npm ci
before_script:
- npm run build:ci
# The server from create-react-app doesn't work well with travis
- npm i -g http-server
# Necessary because create-react-app assumes you want to deploy to /caravan
- mkdir ./build/caravan
- shopt -s extglob
- mv ./build/!(caravan) ./build/caravan/
- http-server build -p 3000 -c-1 --silent &
script:
- $(npm bin)/cypress run --env configFile=travis
- stage: build
node_js: 10
script: npm run build:ci
node_js: 12
script: npm run build:ci
before_deploy:
- git remote set-url origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git config --global user.email "Travis CI<[email protected]>"
- git config --global user.name "TravisCI"
deploy:
provider: script
script: "npm run deploy"
skip_cleanup: true
on:
tags: true
branch: master