forked from cypress-io/cypress-example-kitchensink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
167 lines (148 loc) · 4.88 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
# 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/[email protected]
# for testing on Windows
# https://circleci.com/docs/2.0/hello-world-windows/
win: circleci/windows@1
executors:
mac:
macos:
xcode: "10.1.0"
jobs:
win-test:
working_directory: ~/app
executor:
name: win/vs2019
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
# if you want to test execa's behavior on Windows
# - run: node ./scripts/test-execa
- run:
name: 'Start server'
command: npm run start:ci:windows
background: true
- run:
name: 'Run Cypress tests'
command: npm run e2e:record -- --env circle=true
no_output_timeout: '1m'
- store_artifacts:
path: cypress\screenshots
- store_artifacts:
path: cypress\videos
release:
executor: cypress/base-10
steps:
- attach_workspace:
at: ~/
- run: npm run semantic-release
workflows:
win-build:
jobs:
- win-test
mac-build:
jobs:
- cypress/install:
name: 'Mac install'
executor: mac
# and builds the app using this command
build: 'npm run build'
post-steps:
# 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:
name: Mac test
executor: mac
requires:
- Mac install
record: true
parallel: true
parallelism: 2
start: 'npm run start:ci'
group: 'Mac build'
linux-build:
jobs:
# checks out code and installs dependencies once
- cypress/install:
name: 'Linux install'
# and builds the app using this command
build: 'npm run build'
post-steps:
# 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
# runs on 3 machines, load balances tests
# and records on Cypress Dashboard
- cypress/run:
# name this job because we are running "cypress/run" several times
# with different parameters
name: '3 machines'
# job will use workspace with code and dependencies
# installed by the "install" job
requires:
- Linux install
record: true # record results on Cypress dashboard
parallel: true # load balance all tests
parallelism: 3 # across 3 machines
group: '3x-electron on CircleCI' # name this group
start: 'npm run start:ci' # start server before running tests
# run on 2 machines using Chrome browser
- cypress/run:
name: '2 machines using Chrome'
# job will use workspace with code and dependencies
# installed by the "install" job
requires:
- Linux install
# use executor with Chrome installed
executor: cypress/browsers-chrome76
# use browser "chrome" for running tests
browser: chrome
record: true
parallel: true
parallelism: 2
group: '2x-chrome on CircleCI'
start: 'npm run start:ci'
- cypress/run:
name: '2 machines using Firefox'
# job will use workspace with code and dependencies
# installed by the "install" job
requires:
- Linux install
# use executor with Chrome installed
executor: cypress/browsers-chrome73-ff68
# use browser "chrome" for running tests
browser: firefox
record: true
parallel: true
parallelism: 2
group: '2x-firefox on CircleCI'
start: 'npm run start:ci'
- release:
filters:
branches:
only:
- master
requires:
- 3 machines