-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathtest-deploy.yml
178 lines (176 loc) · 6.86 KB
/
test-deploy.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
version: 2.1
orbs:
cypress: cypress-io/cypress@dev:<<pipeline.git.revision>>
orb-tools: circleci/[email protected]
filters: &filters
tags:
only: /.*/
jobs:
install-and-persist:
executor:
name: cypress/default
node-version: "20.15.1"
steps:
- cypress/install:
working-directory: examples/angular-app
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
include-branch-in-node-cache-key: true
- persist_to_workspace:
root: ~/
paths:
- .cache/Cypress
- project
run-ct-tests-in-chrome:
docker:
- image: cypress/browsers:node-20.15.1-chrome-126.0.6478.126-1-ff-128.0-edge-126.0.2592.102-1
parallelism: 2
steps:
- run: echo "This step assumes dependencies were installed using the cypress/install job"
- attach_workspace:
at: ~/
- cypress/run-tests:
working-directory: examples/angular-app
cypress-command: "npx cypress run --component --parallel --record --group 2x-chrome --browser chrome"
run-ct-tests-in-firefox:
docker:
- image: cypress/browsers:node-20.15.1-chrome-126.0.6478.126-1-ff-128.0-edge-126.0.2592.102-1
parallelism: 2
steps:
- run: echo "This step assumes dependencies were installed using the cypress/install job"
- attach_workspace:
at: ~/
- cypress/run-tests:
working-directory: examples/angular-app
cypress-command: "npx cypress run --component --parallel --record --group 2x-firefox --browser firefox"
run-ct-tests-in-edge:
docker:
- image: cypress/browsers:node-20.15.1-chrome-126.0.6478.126-1-ff-128.0-edge-126.0.2592.102-1
parallelism: 2
steps:
- run: echo "This step assumes dependencies were installed using the cypress/install job"
- attach_workspace:
at: ~/
- cypress/run-tests:
working-directory: examples/angular-app
cypress-command: "npx cypress run --component --parallel --record --group 2x-edge --browser edge"
workflows:
test-deploy:
jobs:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
- cypress/run:
filters: *filters
name: Standard Npm Example
working-directory: examples/npm-install
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/npm-install/package.json" }}
post-install: "npm run say-hello && npm run say-goodbye"
- cypress/run:
filters: *filters
name: Custom Node Version Example
working-directory: examples/npm-install
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/npm-install/package.json" }}
node-version: "20.15.1"
post-install: |
if ! node --version | grep -q "20.15.1"; then
echo "Node version 20.15.1 not found"
exit 1
fi
- cypress/run:
filters: *filters
name: Yarn Example
working-directory: examples/yarn-install
cypress-cache-key: cypress-cache{{ arch }}-{{ checksum "examples/yarn-install/package.json" }}
post-install: "npx cypress install"
package-manager: "yarn"
- cypress/run:
filters: *filters
name: Pnpm Example
node-version: "22.11.0"
working-directory: examples/pnpm-install
cypress-cache-key: cypress-cache{{ arch }}-{{ checksum "examples/pnpm-install/package.json" }}
post-install: "pnpm dlx cypress install"
package-manager: "pnpm"
- cypress/run:
filters: *filters
name: Custom Install Example
working-directory: examples/custom-install
install-command: npm run custom-install
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/custom-install/package.json" }}
- cypress/run:
filters: *filters
name: Wait On Example
working-directory: examples/wait-on
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/wait-on/package.json" }}
start-command: npm start
# wait-on will wait for the server to be ready before running the tests
# -v only needed for demonstration purposes
cypress-command: npx wait-on@latest http://localhost:8080 -v && npx cypress run
- cypress/run:
filters: *filters
name: Angular Application
working-directory: examples/angular-app
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
start-command: "npm run start"
cypress-command: "npx cypress run --browser chrome"
install-browsers: true
- cypress/run:
filters: *filters
name: Run CT in Parallel
working-directory: examples/angular-app
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
cypress-command: "npx cypress run --component --parallel --record"
parallelism: 3
- cypress/run:
filters: *filters
name: Verify skip-checkout
working-directory: examples/angular-app
cypress-cache-key: cypress-cache-{{ arch }}-{{ checksum "examples/angular-app/package.json" }}
cypress-command: "npx cypress run --component --parallel --record"
pre-steps:
- checkout
- install-and-persist:
filters: *filters
name: Install & Persist
- run-ct-tests-in-chrome:
filters: *filters
name: Run CT Tests in Chrome
requires:
- Install & Persist
- run-ct-tests-in-firefox:
filters: *filters
name: Run CT Tests in Firefox
requires:
- Install & Persist
- run-ct-tests-in-edge:
filters: *filters
name: Run CT Tests in Edge
requires:
- Install & Persist
- orb-tools/pack:
filters: *filters
- orb-tools/publish:
orb-name: cypress-io/cypress
vcs-type: << pipeline.project.type >>
pub-type: production
enable-pr-comment: false
requires:
- orb-tools/pack
- Standard Npm Example
- Custom Node Version Example
- Yarn Example
- Pnpm Example
- Custom Install Example
- Wait On Example
- Angular Application
- Run CT in Parallel
- Install & Persist
- Run CT Tests in Chrome
- Run CT Tests in Firefox
- Run CT Tests in Edge
- Verify skip-checkout
context: circleci-orb-publishing
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
# VS Code Extension Version: 1.5.1