This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
.evergreen.yml
247 lines (221 loc) · 5.33 KB
/
.evergreen.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
stepback: true
ignore:
- "*.md"
- ".github/*" # github CODEOWNERS configuration
variables:
- &node
NODEJS_VERSION: 8.11.3
- &drivers
CHROMEDRIVER_URL: https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip
GECKODRIVER_URL: https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz
functions:
preamble:
- *get-project
- *fetch-node
- *install
get-project: &get-project
command: git.get_project
type: setup
params:
directory: lobster
fetch-node: &fetch-node
command: shell.exec
type: setup
params:
working_dir: .
shell: bash
script: |
set -ex
if [ -d "nodejs" ]; then
exit 0
fi
curl --silent --show-error --fail --location --retry 3 --output nodejs.tar.xz https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.xz
tar xf nodejs.tar.xz
mv node-v* nodejs
chmod +x nodejs/bin/*
install: &install
command: shell.exec
type: setup
params:
working_dir: lobster
shell: bash
script: |
set -ex
export PATH="${workdir}/nodejs/bin:$PATH"
export CI=true
export NPM_CONFIG_CACHE="./.node_cache"
npm install || npm install || npm install
mkdir build
npm:
command: shell.exec
type: test
params:
working_dir: lobster
shell: bash
script: |
set -ex
export PATH="${workdir}/nodejs/bin:$PATH"
export CI=true
export NPM_CONFIG_CACHE="./.node_cache"
npm ${cmd}
results-attach:
command: attach.xunit_results
params:
files:
- "./lobster/build/*-junit.xml"
results-clean:
command: shell.exec
type: test
params:
working_dir: lobster
shell: bash
continue_on_err: true
ignore_standard_error: true
silent: true
script: rm build/*-junit.xml
chromedriver:
command: shell.exec
type: setup
params:
shell: bash
script: |
set -ex
export PATH="/opt/google/chrome:$PWD:${workdir}/nodejs/bin:$PATH"
which chrome
mkdir driver
cd driver
curl --silent --show-error --fail --location -o chromedriver.zip ${CHROMEDRIVER_URL} --retry 3
unzip chromedriver.zip
rm chromedriver.zip
geckodriver:
command: shell.exec
type: setup
params:
shell: bash
script: |
set -ex
which firefox
mkdir driver
cd driver
curl -L --silent --show-error --fail --location -o geckodriver.tar.gz ${GECKODRIVER_URL} --retry 3
tar xf geckodriver.tar.gz
rm geckodriver.tar.gz
e2e:
command: shell.exec
params:
working_dir: lobster
shell: bash
script: |
set -ex
export PATH="/opt/google/chrome:${workdir}/driver:${workdir}/nodejs/bin:$PATH"
export CI=true
export NPM_CONFIG_CACHE="./.node_cache"
export IS_VM=true
npm run test:e2e -- --browser ${browser}
killallthethings:
command: shell.exec
params:
working_dir: lobster
shell: bash
silent: true
ignore_standard_error: true
ignore_standard_out: true
script: |
# do not set -ex this!
killall node
killall npm
killall chromedriver
killall chrome
killall geckodriver
killall firefox
post:
- command: shell.exec
params:
working_dir: lobster
shell: bash
continue_on_err: true
ignore_standard_error: true
silent: true
script: |
cat ./.node_cache/_logs/*log
rm ./.node_cache/_logs/*log
- func: results-attach
- func: results-clean
- func: killallthethings
tasks:
- name: dist
commands:
- func: preamble
- func: npm
vars:
cmd: run-script build
- name: lint
commands:
- func: preamble
- func: npm
vars:
cmd: run-script lint
- name: flow
commands:
- func: preamble
- func: npm
vars:
cmd: run-script flow -- check --temp-dir=.node_cache/_logs
- name: generate-tests
commands:
- func: preamble
- func: npm
vars:
cmd: run-script generate-tasks
- command: generate.tasks
params:
files:
- lobster/build/.tasks.json
- name: e2e-chrome
depends_on:
- name: dist
variant: ubuntu1604
commands:
- func: preamble
- func: chromedriver
- func: npm
vars:
cmd: run-script build
- func: e2e
vars:
browser: chrome
- name: e2e-firefox
depends_on:
- name: dist
variant: ubuntu1604
commands:
- func: preamble
- func: geckodriver
- func: npm
vars:
cmd: run-script build
- func: e2e
vars:
browser: firefox
buildvariants:
- name: ubuntu1604
display_name: Ubuntu 16.04
expansions:
<<: *node
run_on:
- ubuntu1604-test
tasks:
- name: "dist"
- name: "lint"
- name: "generate-tests"
- name: "flow"
- name: ubuntu1804
display_name: Ubuntu 18.04 (e2e)
expansions:
<<: *node
<<: *drivers
run_on:
- ubuntu1804-test
tasks:
- name: "e2e-chrome"
- name: "e2e-firefox"