-
Notifications
You must be signed in to change notification settings - Fork 46
/
.travis.yml
174 lines (161 loc) · 8.3 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
173
174
dist: bionic
language: php
php:
- 7.3
addons:
chrome: stable
cache:
yarn: true
directories:
- node_modules
- docs-site/cache
- www
- cache
before_cache:
- mkdir -p node_modules
- mkdir -p docs-site/cache
- mkdir -p cache
- mkdir -p www
before_install:
- openssl aes-256-cbc -K $encrypted_4537e53f71e7_key -iv $encrypted_4537e53f71e7_iv -in scripts/bolt-design-system-bot.private-key.pem.enc -out scripts/bolt-design-system-bot.private-key.pem -d
- nvm install # version lifted from `.nvmrc`
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.19.1
- export PATH="$HOME/.yarn/bin:$PATH"
- composer config --global github-oauth.github.com ${GITHUB_TOKEN}
# see more conditions: https://docs.travis-ci.com/user/conditions-v1
# Stages run sequentially; the jobs in them run in parallel
stages:
- Pre-deploy
- Post-deploy
- Auto-release
# Just an example of having a whole stage be branch conditional; see more conditions: https://docs.travis-ci.com/user/conditions-v1
# - name: Super Hard Tests
# if: branch = master
jobs:
include:
- stage: Pre-deploy
name: 'Smoke Tests: Jest Component-Specific Tests'
install:
- yarn run setup
- yarn workspace @bolt/website prep # creates data and manifest files
# before_script: ./scripts/check-run-queue.js 'Jest Component Tests'
script:
- travis_retry yarn test:js
# - yarn test:js:quick --maxWorkers=1 # running both `test:js` as comparison; remove or comment out this or other one eventually
# after_success: ./scripts/check-run-success.js 'Jest Component Tests'
# after_failure: ./scripts/check-run-failure.js 'Jest Component Tests'
- stage: Pre-deploy
name: 'Smoke Tests: Lint + Jest Unit Tests'
install:
- yarn run setup
- yarn workspace @bolt/website prep # creates data and manifest files
# before_script: ./scripts/check-run-queue.js 'Lint + Unit Tests'
script:
- yarn run lint
- yarn test:php
- yarn test:monorepo --maxWorkers=1
- yarn test:pkgs
# after_success: ./scripts/check-run-success.js 'Lint + Unit Tests'
# after_failure: ./scripts/check-run-failure.js 'Lint + Unit Tests'
# - stage: Pre-deploy
# if: (tag =~ ^v) OR (branch =~ /(master|release)/)
# name: 'Build Drupal Lab'
# script:
# - npm run setup
# quicker build tests for feature branches
- stage: Pre-deploy
name: 'Build + Deploy Website + Lighthouse CLI'
if: (NOT tag =~ ^v) AND (NOT branch =~ /(master|release|bug|fix)/)
install:
- yarn run setup
- npx lerna run postbootstrap
- export GIT_SHA=$(./scripts/get-git-sha.js)
- echo $GIT_SHA
# - yarn global add @lhci/[email protected]
script:
# - yarn run generate # generate static version of Drupal Lab in the integration folder
# - cd ../../
- yarn run build
- travis_retry yarn gds -a create -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- travis_retry yarn gds -a in_progress -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- yarn run deploy
- export NOW_URL=$(./scripts/get-latest-deploy.js)
- travis_retry yarn gds -a success -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH} -l ${NOW_URL}
# - lhci autorun --collect.numberOfRuns=3 --collect.url=$NOW_URL --collect.url=$NOW_URL/pattern-lab/patterns/50-pages-10-d8-product-pages-product-t2/50-pages-10-d8-product-pages-product-t2.html --collect.url=$NOW_URL/pattern-lab/patterns/60-experiments-micro-journeys-90-micro-journeys/60-experiments-micro-journeys-90-micro-journeys.html
after_success:
- travis_retry yarn gds -a create -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
- travis_retry yarn gds -a in_progress -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
- ./scripts/deploy-branch-alias.js
- export NOW_BRANCH_URL=$(./scripts/get-branch-alias.js)
- travis_retry yarn gds -a success -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH} -l ${NOW_BRANCH_URL}
after_failure:
- travis_retry yarn gds -a failure -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- travis_retry yarn gds -a failure -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
after_script:
- travis_retry yarn gds -a fail_if_unsuccessful -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- travis_retry yarn gds -a fail_if_unsuccessful -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
# full build tests for non-feature branches + tagged releases
- stage: Pre-deploy
name: 'Build + Deploy Website (Full)'
if: (tag =~ ^v) OR (branch =~ /(master|release|bug|fix)/)
install:
- yarn run setup
- export GIT_SHA=$(./scripts/get-git-sha.js)
before_script:
- find . -name '.incache' -exec rm -rf {} +
script:
# - yarn run generate # generate static version of Drupal Lab in the integration folder
# - cd ../../
- travis_retry yarn gds -a create -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- yarn run build
- travis_retry yarn gds -a in_progress -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- yarn run deploy
after_success:
- export NOW_URL=$(./scripts/get-latest-deploy.js)
- travis_retry yarn gds -a success -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH} -l ${NOW_URL}
after_script:
- travis_retry yarn gds -a fail_if_unsuccessful -e ${TRAVIS_BRANCH}--${GIT_SHA}--commit-preview -r ${TRAVIS_BRANCH}
- stage: Post-deploy
name: 'Deploy Tagged Release'
if: (tag =~ ^v) OR (branch =~ /(master|release|bug|fix)/)
install:
- yarn
- npx lerna run postbootstrap
script:
- export NOW_URL=$(./scripts/get-latest-deploy.js)
- travis_retry yarn gds -a create -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
- travis_retry yarn gds -a in_progress -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
after_success:
- ./scripts/deploy-branch-alias.js
- export NOW_BRANCH_URL=$(./scripts/get-branch-alias.js)
- travis_retry yarn gds -a success -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH} -l ${NOW_BRANCH_URL}
- ./scripts/deploy-tagged-release.js
after_script:
- travis_retry yarn gds -a fail_if_unsuccessful -e ${TRAVIS_BRANCH}--branch-preview -r ${TRAVIS_BRANCH}
- stage: Auto-release
name: 'Full Release'
# TRUST YOUR INSTINCTS!
# If you don't trust your instincts...
# release/6.x will not trigger an auto release, update the range "[1-5]" to "[1-6]" to start the 6.x release
if: (branch =~ /(release)\/[1-5]/)
before_script:
- git config --global user.email ${GITHUB_EMAIL}
- git config --global user.name ${GITHUB_USER}
- git remote set-url origin "https://${GITHUB_TOKEN}@github.com/boltdesignsystem/bolt.git" > /dev/null 2>&1
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- git checkout ${TRAVIS_BRANCH}
install:
- yarn install --frozen-lockfile
- yarn run setup:php
- git reset --hard
script:
- yarn run release
after_success:
- cd "`git rev-parse --show-toplevel`" && git clean -fd && git reset --hard HEAD && cd -
- ./scripts/release/update-read-only-git-repos.sh
notifications:
email:
on_success: never
on_failure: never # @todo re-enable
slack:
secure: cNto+gWAoK1JM9jBNG4i4rMSybv3twMbqlFSCohQFBDMwKFMdlyWqFDX6iYKtHxWEDzrZyRz3qiJ8/S44mgjeKJ/xHbHDtPchp/KL2P1htipvwD2EZXobcBEGl83v2rmtFO1WNJUPB3RIJE2yt1wJsX7NIXpDw82hePmaIvNJmtbLpK/J5uaFqGNHIsctmULgVmGSNSTyK4nYxxjNNLd0EvO37Y6VN8FhsKNu2NHMKeeQxinEvETDUh8XuqXZYNWE3PBvVa4OiDhgnr5K27jsnWX+wEmqg0xY+CMf7mUSTqVN61fA7LnHyM0qcGGmB6YTv4QYLMwPydp+nsjDcm3St9D+KOTsQ4ExOaEAL/6EnAEpl8GtxST+ytdqswhCC4yMCO61Hy+M5AoXgDSGrrXHgZakDMAcEVcJdH38791hRxcuM3ldVmHAlAWFdgRLG5rRMVh3qoXz7jbraoTdjyKMegQIQdKR2SX7O9Dv0EEtLz4lTFN2RENvAjLggUPPU+ESoUHmSbwmPGnt7jy3ra2AI3nnYpfn/0e6Op/A3z7HLbdm3XyuNWoTPhy1mc4Adca+HosJ37UPv7nDRIGds1sKYAeWq94+rEk+/6IQ/oRIDRhSYsQbLLWnU6DH4o7iOj7D+X/ngjqmF75nW2s5+7rtdBHFvNzOJalCKHiDTMfdlQ=