forked from cerner/terra-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
172 lines (168 loc) · 6.66 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
language: node_js
sudo: required
services:
- docker
branches:
only:
- main
cache:
directories:
- travis-build
before_install:
# Clean install on any new build
- npm run clean
jobs:
include:
- stage: danger lint jest and compile
script:
# clear the cache of any old build artifacts
- rm -rf ./travis-build
- npm run danger
- npm run lint
- npm run jest
# These can't be built in parallel because the cache is a single object and you can't add to it in parallel
- npm run compile:prod -- --env.disableAggregateThemes --output-path $TRAVIS_BUILD_DIR/travis-build/default
- npm run compile:lowlight -- --output-path $TRAVIS_BUILD_DIR/travis-build/lowlight
- npm run compile:fusion -- --output-path $TRAVIS_BUILD_DIR/travis-build/fusion
# Split out all the sizes to not eat up all the travis executors at once.
- stage: tiny & small
name: tiny default-theme
# Don't clean install
before_install: skip
# Rely on the cache for node_modules.. this won't work for any node modules in the packages dir but works for running wdio
install: skip
script:
# we start up our own standalone chrome instance because the Selenium Docker Service doesn't seem to work here.
- docker-compose up -d standalone-chrome-travis
# using the travis env section to set env variables seems to break cache
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=tiny npm run wdio-default
- name: tiny lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=tiny npm run wdio-lowlight
- name: tiny fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=tiny npm run wdio-fusion
- name: small default-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=small npm run wdio-default
- name: small lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=small npm run wdio-lowlight
- name: small fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=small npm run wdio-fusion
- stage: medium & large
name: medium default-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=medium npm run wdio-default
- name: medium lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=medium npm run wdio-lowlight
- name: medium fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=medium npm run wdio-fusion
- name: large default-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=large npm run wdio-default
- name: large lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=large npm run wdio-lowlight
- name: large fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=large npm run wdio-fusion
- stage: huge & enormous
name: huge default-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=huge npm run wdio-default
- name: huge lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=huge npm run wdio-lowlight
- name: huge fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=huge npm run wdio-fusion
- name: enormous default-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default FORM_FACTOR=enormous npm run wdio-default
- name: enormous lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight FORM_FACTOR=enormous npm run wdio-lowlight
- name: enormous fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion FORM_FACTOR=enormous npm run wdio-fusion
- stage: publish & deploy
script:
- rm -rf ./travis-build
# add auth token to .npmrc for lerna publish
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
# Publish to npm write output to file
- npx lerna publish from-package --yes > publish-output.txt
# push tags to github based on output written to file
- node ./scripts/release/gitTagMonoRepo.js
before_deploy:
# Build again for deployment because we need the Public path to be updated.
- TERRA_DEV_SITE_NEW_RELIC_LICENSE_KEY='c494ac44c8' TERRA_DEV_SITE_NEW_RELIC_APPLICATION_ID='144458769' TERRA_DEV_SITE_PUBLIC_PATH='/terra-framework/' npm run compile:prod
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.com dashboard
local_dir: $TRAVIS_BUILD_DIR/build
on:
branch: main
stages:
- danger lint jest and compile
- tiny & small
- medium & large
- huge & enormous
- name: publish & deploy
if: type != pull_request