forked from cerner/terra-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
115 lines (113 loc) · 5.16 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
language: generic
sudo: required
services:
- docker
branches:
only:
- master
cache:
directories:
- $HOME/$TRAVIS_BUILD_ID
- $HOME/docker
env:
global:
- DOCKER_IMAGE='cerner/terra-core'
- TAG="${TRAVIS_PULL_REQUEST_SHA:=latest}"
before_install:
- sudo chown -R travis:travis $HOME/docker
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
before_cache:
- sudo chown -R travis:travis $HOME/docker
- if [ $TRAVIS_TEST_RESULT == 1 ]; then rm -f $HOME/docker/*.tar.gz; fi
jobs:
include:
- stage: build
before_install: true
script:
- sudo chown -R travis:travis $HOME/docker
- 'rm -f $HOME/docker/*.tar.gz'
- travis_wait docker-compose build test-ci
- travis_wait docker-compose --verbose pull standalone-chrome
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
- stage: danger lint and jest
script: travis_wait docker-compose run -e DANGER_GITHUB_API_TOKEN=$DANGER_GITHUB_API_TOKEN -e HAS_JOSH_K_SEAL_OF_APPROVAL=$HAS_JOSH_K_SEAL_OF_APPROVAL -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST -e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG test-ci sh -c 'npm run danger && npm run lint && npm run jest'
- stage: compile - default theme
script: travis_wait docker-compose run test-ci npm run compile:prod
- stage: wdio - default theme
name: tiny
script: travis_wait docker-compose run -e FORM_FACTOR=tiny test-ci
- name: small
script: travis_wait docker-compose run -e FORM_FACTOR=small test-ci
- name: medium
script: travis_wait docker-compose run -e FORM_FACTOR=medium test-ci
- name: large
script: travis_wait docker-compose run -e FORM_FACTOR=large test-ci
- name: huge
script: travis_wait docker-compose run -e FORM_FACTOR=huge test-ci
- name: enormous
script: travis_wait docker-compose run -e FORM_FACTOR=enormous test-ci
# This should be enabled once after all the 3 mono repos have been merged with the lowlight theme files and screenshots have been generated.
# - stage: compile - lowlight theme
# script: travis_wait docker-compose run test-ci npm run compile:lowlight
# - stage: wdio - lowlight theme
# name: tiny
# script: travis_wait docker-compose run -e FORM_FACTOR=tiny test-ci sh -c 'npm run wdio-lowlight'
# - name: small
# script: travis_wait docker-compose run -e FORM_FACTOR=small test-ci sh -c 'npm run wdio-lowlight'
# - name: medium
# script: travis_wait docker-compose run -e FORM_FACTOR=medium test-ci sh -c 'npm run wdio-lowlight'
# - name: large
# script: travis_wait docker-compose run -e FORM_FACTOR=large test-ci sh -c 'npm run wdio-lowlight'
# - name: huge
# script: travis_wait docker-compose run -e FORM_FACTOR=huge test-ci sh -c 'npm run wdio-lowlight'
# - name: enormous
# script: travis_wait docker-compose run -e FORM_FACTOR=enormous test-ci sh -c 'npm run wdio-lowlight'
- stage: compile - fusion theme
script: travis_wait docker-compose run test-ci npm run compile:fusion
- stage: wdio - fusion theme
name: tiny
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=tiny test-ci
- name: small
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=small test-ci
- name: medium
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=medium test-ci
- name: large
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=large test-ci
- name: huge
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=huge test-ci
- name: enormous
script: travis_wait docker-compose run -e THEME=orion-fusion-theme -e FORM_FACTOR=enormous test-ci
- stage: deploy
script: skip
before_deploy:
- sudo chown -R travis:travis $HOME/docker
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
- "travis_wait docker-compose run --volume=$TRAVIS_BUILD_DIR/build:/opt/module/build -e TERRA_DEV_SITE_NEW_RELIC_LICENSE_KEY='c494ac44c8' -e TERRA_DEV_SITE_NEW_RELIC_APPLICATION_ID='142450088' -e TERRA_DEV_SITE_PUBLIC_PATH='/terra-core/' test-ci npm run compile:prod"
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.com dashboard
local_dir: build
on:
branch: master
- stage: clean up cache
before_install: true
script:
- sudo chown -R travis:travis $HOME/docker
- 'rm -f $HOME/docker/*.tar.gz'
stages:
- build
- danger lint and jest
- compile - default theme
- wdio - default theme
# - compile - lowlight theme
# - wdio - lowlight theme
- compile - fusion theme
- wdio - fusion theme
- name: deploy
if: type != pull_request
- clean up cache