-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
config.yml
232 lines (202 loc) · 6.45 KB
/
config.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
# testing using CircleCI orb
# see https://on.cypress.io/circleci-orb
# for non-orb configuration see old commit
# https://github.com/cypress-io/cypress-example-kitchensink/blob/aabb10cc1bb9dee88e1bf28e0af5e9661427ee7a/circle.yml
# to use CircleCI orbs need to use version >= 2.1
version: 2.1
orbs:
# use Cypress orb from CircleCI registry
cypress: cypress-io/cypress@3.4.0
win: circleci/windows@5.0.0
executors:
mac:
macos:
xcode: "15.4.0"
resource_class: macos.m1.medium.gen1
browsers:
docker:
- image: 'cypress/browsers:node-22.11.0-chrome-130.0.6723.69-1-ff-132.0-edge-130.0.2849.56-1'
jobs:
win-test:
working_directory: ~/app
executor:
name: win/default
size: medium
shell: bash.exe
steps:
- checkout
- restore_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
- run: npm ci
- run: npm run cy:verify
- run: npm run cy:info
- save_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
paths:
# could not use environment variables for some reason
- C:\Users\circleci\AppData\Local\Cypress\Cache
- C:\Users\circleci\AppData\Roaming\npm-cache
- run:
name: 'Start server'
command: npm run start
background: true
- run:
name: 'Run Cypress tests'
command: npm run e2e:record -- --env circle=true
no_output_timeout: '1m'
- store_artifacts:
path: cypress\screenshots
win-test-chrome:
working_directory: ~/app
executor:
name: win/default
size: medium
shell: bash.exe
steps:
- checkout
- restore_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
# install Chrome browser on Windows machine using Chocolatey
# https://chocolatey.org/packages/GoogleChrome
- run: choco install googlechrome --ignore-checksums -y
- run: npm ci
- run: npm run cy:verify
- run: npm run cy:info
- save_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
paths:
# could not use environment variables for some reason
- C:\Users\circleci\AppData\Local\Cypress\Cache
- C:\Users\circleci\AppData\Roaming\npm-cache
- run:
name: 'Start server'
command: npm run start
background: true
- run:
name: 'Run Cypress tests'
command: npm run e2e:record:chrome -- --env circle=true
no_output_timeout: '1m'
- store_artifacts:
path: cypress\screenshots
win-test-firefox:
working_directory: ~/app
executor:
name: win/default
size: medium
shell: bash.exe
steps:
- checkout
- restore_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
# install Firefox browser on Windows machine using Chocolatey
# https://chocolatey.org/packages/Firefox
- run: choco install firefox -y
- run: npm ci
- run: npm run cy:verify
- run: npm run cy:info
- save_cache:
key: dependencies-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
paths:
# could not use environment variables for some reason
- C:\Users\circleci\AppData\Local\Cypress\Cache
- C:\Users\circleci\AppData\Roaming\npm-cache
- run:
name: 'Start server'
command: npm run start
background: true
- run:
name: 'Run Cypress tests'
command: npm run e2e:record:firefox -- --env circle=true
no_output_timeout: '1m'
- store_artifacts:
path: cypress\screenshots
mac-test:
executor: mac
steps:
- cypress/install:
post-install: "npm run build"
# show Cypress cache folder and binary versions
# to check if we are caching previous binary versions
- run: npx cypress cache path
- run: npx cypress cache list
- run: npx cypress info
- cypress/run-tests:
start-command: 'npm run start'
cypress-command: 'npx cypress run --record --group Mac build'
linux-test:
# checks out code and installs dependencies once
# runs on 3 machines, load balances tests
# and records on Cypress Cloud
parallelism: 3
executor:
name: cypress/default
node-version: '22.11.0'
steps:
- cypress/install:
post-install: 'npm run build'
- cypress/run-tests:
start-command: 'npm run start'
cypress-command: 'npx cypress run --record --parallel --group 3x-electron on CircleCI'
- run: npx cypress cache path
- run: npx cypress cache list
- run: npx cypress info
# let's print version info
- run: npx cypress version
- run: npx cypress version --component package
- run: npx cypress version --component binary
- run: npx cypress version --component electron
- run: npx cypress version --component node
linux-test-chrome:
# runs on 2 machines using Chrome browser
parallelism: 2
executor:
name: cypress/default
node-version: '22.11.0'
steps:
- cypress/install:
install-browsers: true
- cypress/run-tests:
start-command: 'npm run start'
cypress-command: 'npx cypress run --browser chrome --record --parallel --group 2x-chrome on CircleCI'
linux-test-firefox:
# runs on 2 machines using Firefox browser
parallelism: 2
executor:
name: cypress/default
node-version: '22.11.0'
steps:
- cypress/install:
install-browsers: true
- cypress/run-tests:
start-command: 'npm run start'
cypress-command: 'npx cypress run --browser firefox --record --parallel --group 2x-firefox on CircleCI'
release:
executor:
name: cypress/default
node-version: '22.11.0'
steps:
- checkout
- run: npx semantic-release@23.1.1
workflows:
win-build:
jobs:
- win-test
- win-test-chrome
- win-test-firefox
mac-build:
jobs:
- mac-test
linux-build:
jobs:
- linux-test
- linux-test-chrome
- linux-test-firefox
- release:
filters:
branches:
only:
- master
requires:
- linux-test
- linux-test-chrome
- linux-test-firefox