This repository has been archived by the owner on Feb 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
circle.yml
252 lines (237 loc) · 8.1 KB
/
circle.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
248
249
250
251
252
version: 2
# all images have same environment variables
environment: &environment
environment:
TERM: xterm
npm_config_loglevel: warn
# even when running as non-root user
# need to set unsafe perm to be able to do `npm postinstall`
npm_config_unsafe-perm: true
defaults: &defaults
parallelism: 1
working_directory: ~/app
docker:
# be explicit about the Docker image we use
# probably matches the current bundled version of Node in the test runner
- image: cypress/base:12.0.0-libgbm
jobs:
lint:
<<: *defaults
<<: *environment
steps:
- checkout
- restore_cache:
keys:
- cache-{{ checksum "package.json" }}
- run: npm ci
- save_cache:
key: cache-{{ checksum "package.json" }}
paths:
- ~/.npm
- run: npm run lint
## Docker image without XVFB - Cypress should NOT work
test-bare:
<<: *defaults
<<: *environment
# override just the docker image
docker:
- image: node:12
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run test-bare
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
## Docker image with XVFB - Cypress should NOT work
test-xvfb:
<<: *defaults
<<: *environment
docker:
# the image comes from https://github.com/cypress-io/cypress-internal-docker-images
- image: cypressinternal/xvfb:12.13.0
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run test-xvfb
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
## Docker image with all dependencies - Cypress should work
test-full:
<<: *defaults
<<: *environment
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: ls node_modules/.bin
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
# TODO: investgate why this began failing with 5.0.0
# Good image - except the user set DISPLAY to some wrong value
# our "cypress verify" and "cypress run" should retry automatically and work
# test-bad-display-variable:
# <<: *defaults
# <<: *environment
# steps:
# - run: echo "TERM is $TERM"
# - checkout
# - run: npm install
# - run: npm install @cypress/commit-message-install
# - run: ls node_modules/.bin
# - run: $(npm bin)/commit-message-install --else "npm install cypress"
# # do not verify Cypress binary - it will be done from the test
# - run: $(npm bin)/run-if npm run test-display-retry
# - run:
# when: on_fail
# name: Set status check
# command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
test-full-node10.15.3:
<<: *defaults
<<: *environment
docker:
- image: cypress/base:10.15.3
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
## Centos7 image - Cypress should work
test-centos7:
<<: *environment
<<: *defaults
# override just the docker image
docker:
- image: cypress/base:centos7
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
test-ubuntu16-node12:
<<: *defaults
<<: *environment
# override just the docker image
docker:
- image: cypress/base:ubuntu16-12.13.1
steps:
- run: git --version
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
test-ubuntu18-node12.14.1:
<<: *defaults
<<: *environment
# override just the docker image
docker:
- image: cypress/base:ubuntu18-node12.14.1
steps:
- run: git --version
- checkout
- run: apt-get update -y
- run: apt-get install -y libgbm-dev
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
test-ubuntu19-node12.14.1:
<<: *defaults
<<: *environment
# override just the docker image
docker:
- image: cypress/base:ubuntu19-node12.14.1
steps:
- run: git --version
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run: $(npm bin)/commit-message-install --else "npm install cypress"
- run: $(npm bin)/run-if npm run verify
- run: $(npm bin)/run-if npm run test-full
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "$CIRCLE_STAGE on CircleCI"
after-tests:
<<: *defaults
<<: *environment
steps:
- checkout
- run: npm install
- run: npm install @cypress/commit-message-install
- run:
when: on_success
name: Set status check
command: $(npm bin)/set-status --state success --description "on CircleCI"
workflows:
version: 2
build_and_test:
jobs:
- lint
- test-full:
context: test-runner:commit-status-checks
- test-full-node10.15.3:
context: test-runner:commit-status-checks
- test-bare:
context: test-runner:commit-status-checks
- test-xvfb:
context: test-runner:commit-status-checks
- test-ubuntu16-node12:
context: test-runner:commit-status-checks
- test-ubuntu18-node12.14.1:
context: test-runner:commit-status-checks
- test-ubuntu19-node12.14.1:
context: test-runner:commit-status-checks
# - test-bad-display-variable:
# context: test-runner:commit-status-checks
# disabling this test - has been failing forever
# https://github.com/cypress-io/cypress-test-ci-environments/issues/7
# - test-centos7
- after-tests:
context: test-runner:commit-status-checks
requires:
- lint
- test-full
- test-full-node10.15.3
- test-bare
- test-xvfb
- test-ubuntu16-node12
- test-ubuntu18-node12.14.1
- test-ubuntu19-node12.14.1
# - test-bad-display-variable