forked from cerner/terra-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (73 loc) · 2.86 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
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: lint jest and compile
script:
# clear the cache of any old build artifacts
- rm -rf ./travis-build
- 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:prod -- --env.defaultLocale=de --env.disableAggregateThemes --output-path $TRAVIS_BUILD_DIR/travis-build/default-locale
- 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 wdio runs to not eat up all the travis executors at once.
- stage: wdio
name: 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 npm run wdio-default
- name: default-locale
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/default-locale LOCALE=de npm run wdio-default
- name: lowlight-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight npm run wdio-lowlight
- name: fusion-theme
before_install: skip
install: skip
script:
- docker-compose up -d standalone-chrome-travis
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion npm run wdio-fusion
- stage: deploy
script: skip
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='141260567' TERRA_DEV_SITE_PUBLIC_PATH='/terra-application/' 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:
- lint jest and compile
- wdio
- name: deploy
if: type != pull_request