forked from mjhenkes/terra-model-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (69 loc) · 2.38 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
language: node_js
sudo: required
services:
- docker
branches:
only:
- main
cache:
directories:
- travis-build
- docker_images
before_install:
# Clean install on any new build
- npm run clean
before_script:
# Load Docker Cache
- docker load -i docker_images/images.tar || true
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 -- --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
# Prime the docker cache
- docker-compose --file ./node_modules/@cerner/terra-functional-testing/lib/docker/docker-compose.yml pull
# Save docker cache
- docker save -o docker_images/images.tar $(docker images -a -q)
# 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:
# 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: lowlight-theme
before_install: skip
install: skip
script:
- SITE=$TRAVIS_BUILD_DIR/travis-build/lowlight npm run wdio-lowlight
- name: fusion-theme
before_install: skip
install: skip
script:
- SITE=$TRAVIS_BUILD_DIR/travis-build/fusion npm run wdio-fusion
- stage: deploy
before_deploy:
# Build again for deployment because we need the Public path to be updated.
- 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 AND branch = main