forked from cypress-io/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
201 lines (197 loc) · 5.19 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
version: 2
# testing jobs are all the same, so just use a template
defaults: &defaults
parallelism: 1
working_directory: ~/app
docker:
- image: cypress/base:10
steps:
- attach_workspace:
at: ~/
- run:
command: |
cd examples/$CIRCLE_JOB
npm run start
name: start the server
background: true
- run:
command: |
cd examples/$CIRCLE_JOB
npm run cypress:run -- --record --group $CIRCLE_JOB
name: Cypress tests
jobs:
# a single job that installs dependencies (NPM and Cypress)
build:
working_directory: ~/app
docker:
- image: cypress/base:10
steps:
- checkout
- restore_cache:
key: cache-dirs-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "circle.yml" }}
- run: npm ci
# run verify and then save cache.
# this ensures that the Cypress verified status is cached too
- run: npm run cypress:verify
- save_cache:
key: cache-dirs-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "circle.yml" }}
paths:
- ~/.npm
- ~/.cache
# all other test jobs will run AFTER this build job finishes
# to avoid reinstalling dependencies, we persist the source folder "app"
# and the Cypress binary to workspace, which is the fastest way
# for Circle jobs to pass files
- persist_to_workspace:
root: ~/
paths:
- app
- .cache/Cypress
# define a new job with defailts for each "examples/*" subfolder
blogs__application-actions:
<<: *defaults
blogs__codepen-demo:
<<: *defaults
blogs__direct-control-angular:
<<: *defaults
blogs__e2e-api-testing:
<<: *defaults
blogs__e2e-snapshots:
<<: *defaults
blogs__element-coverage:
<<: *defaults
blogs__testing-redux-store:
<<: *defaults
blogs__vue-vuex-rest:
<<: *defaults
extending-cypress__chai-assertions:
<<: *defaults
file-upload-react:
<<: *defaults
fundamentals__node-modules:
<<: *defaults
logging-in__csrf-tokens:
<<: *defaults
logging-in__html-web-forms:
<<: *defaults
logging-in__single-sign-on:
<<: *defaults
logging-in__xhr-web-forms:
<<: *defaults
preprocessors__typescript-browserify:
<<: *defaults
preprocessors__typescript-webpack:
<<: *defaults
server-communication__bootstrapping-your-app:
<<: *defaults
stubbing-spying__functions:
<<: *defaults
stubbing-spying__window-fetch:
<<: *defaults
stubbing-spying__google-analytics:
<<: *defaults
testing-dom__drag-drop:
<<: *defaults
testing-dom__form-interactions:
<<: *defaults
testing-dom__hover-hidden-elements:
<<: *defaults
testing-dom__tab-handling-links:
<<: *defaults
unit-testing__application-code:
<<: *defaults
unit-testing__react-enzyme:
<<: *defaults
server-communication__env-variables:
<<: *defaults
workflows:
version: 2
# when adding new example subfolder with a recipe
# add its name here to "create" CircleCI job
all-recipes:
jobs:
- build
- blogs__codepen-demo:
requires:
- build
- blogs__application-actions:
requires:
- build
- blogs__direct-control-angular:
requires:
- build
- blogs__e2e-api-testing:
requires:
- build
- blogs__e2e-snapshots:
requires:
- build
- blogs__element-coverage:
requires:
- build
- blogs__testing-redux-store:
requires:
- build
- blogs__vue-vuex-rest:
requires:
- build
- extending-cypress__chai-assertions:
requires:
- build
- file-upload-react:
requires:
- build
- fundamentals__node-modules:
requires:
- build
- logging-in__csrf-tokens:
requires:
- build
- logging-in__html-web-forms:
requires:
- build
- logging-in__single-sign-on:
requires:
- build
- logging-in__xhr-web-forms:
requires:
- build
- preprocessors__typescript-browserify:
requires:
- build
- preprocessors__typescript-webpack:
requires:
- build
- server-communication__bootstrapping-your-app:
requires:
- build
- stubbing-spying__functions:
requires:
- build
- stubbing-spying__window-fetch:
requires:
- build
- stubbing-spying__google-analytics:
requires:
- build
- testing-dom__drag-drop:
requires:
- build
- testing-dom__form-interactions:
requires:
- build
- testing-dom__hover-hidden-elements:
requires:
- build
- testing-dom__tab-handling-links:
requires:
- build
- unit-testing__application-code:
requires:
- build
- unit-testing__react-enzyme:
requires:
- build
- server-communication__env-variables:
requires:
- build