-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathconfig.yml
189 lines (180 loc) · 5.4 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
# https://circleci.com/docs/2.0/configuration-reference/
version: 2.1
orbs:
# https://github.com/cypress-io/circleci-orb
cypress: cypress-io/cypress@3.0.0 # used to run e2e tests
win: circleci/windows@5.0.0 # run a test job on Windows
jobs:
lint:
description: Checks the code formatting
docker:
- image: cimg/node:21.7.1
environment:
# we don't need Cypress to check code style
CYPRESS_INSTALL_BINARY: '0'
steps:
- attach_workspace:
at: ~/
- run:
name: Code style check 🧹
command: npm run format:check
- run: npm run check:markdown
install_and_persist:
executor: cypress/default
steps:
- cypress/install
- run: npm run check:markdown
- persist_to_workspace:
paths:
- .cache/Cypress
- project
root: ~/
windows_test:
executor:
# executor comes from the "windows" orb
name: win/default
shell: bash.exe
steps:
- checkout
- run:
name: Install node 16
command: nvm install 16.16.0
- run:
name: Use node 16
command: nvm use 16.16.0
- run:
name: Install deps for code coverage
command: npm ci
- cypress/run-tests:
# no-workspace: true
start-command: npm run start:windows --prefix test-apps/all-files
# wait-on: 'http://localhost:1234'
cypress-command: npx cypress run --project test-apps/all-files
# store screenshots and videos
# store_artifacts: true
- run:
# make sure the examples captures 100% of code
name: Verify Code Coverage
command: npm run coverage:verify
working_directory: test-apps/all-files
- run:
name: Check code coverage files 📈
# we will check the final coverage report
# to make sure it only has files we are interested in
# because there are files covered at 0 in the report
command: npm i -D check-code-coverage && npm run coverage:check-files
working_directory: test-apps/all-files
publish:
description: Publishes the new version of the plugin to NPM
docker:
- image: cimg/node:21.7.1
environment:
# we don't need Cypress to do the release
CYPRESS_INSTALL_BINARY: '0'
# trick semantic-release into thinking this is NOT a pull request
# (under the hood the module env-ci is used to check if this is a PR)
CIRCLE_PR_NUMBER: ''
CIRCLE_PULL_REQUEST: ''
CI_PULL_REQUEST: ''
steps:
- attach_workspace:
at: ~/
- run: npm run semantic-release
cyrun:
docker:
- image: cypress/base:16.18.1
parameters:
jobname:
type: string
steps:
- attach_workspace:
at: ~/
- run:
command: npm run test
working_directory: test-apps/<< parameters.jobname >>
- store_artifacts:
path: test-apps/<< parameters.jobname >>/coverage
- run:
name: Verify Code Coverage
command: npm run coverage:verify
working_directory: test-apps/<< parameters.jobname >>
- run:
name: Check code coverage files 📈
# we will check the final coverage report
# to make sure it only has files we are interested in
# because there are files covered at 0 in the report
command: npm run coverage:check-files
working_directory: test-apps/<< parameters.jobname >>
test-code-coverage-plugin:
docker:
- image: cypress/base:16.18.1
steps:
- attach_workspace:
at: ~/
- run:
command: npm run test
- store_artifacts:
path: coverage
- run:
name: Verify Code Coverage
command: npm run coverage:verify
workflows:
build:
jobs:
- install_and_persist
- lint:
requires:
- install_and_persist
- test-code-coverage-plugin:
requires:
- install_and_persist
- cyrun:
name: test-<< matrix.jobname>>
requires:
- install_and_persist
matrix:
parameters:
jobname:
- all-files
- backend
- before-all-visit
- before-each-visit
- cra-e2e-and-ct
- exclude-files
- frontend
- fullstack
- one-spec
- same-folder
- support-files
- ts-example
- unit-tests-js
- use-webpack
- redirect
- windows_test
- publish:
filters:
branches:
only:
- master
- beta
- next
- dev
requires:
- lint
- test-code-coverage-plugin
- test-all-files
- test-backend
- test-before-all-visit
- test-before-each-visit
- test-cra-e2e-and-ct
- test-exclude-files
- test-frontend
- test-fullstack
- test-one-spec
- test-same-folder
- test-support-files
- test-ts-example
- test-unit-tests-js
- test-use-webpack
- test-redirect
- windows_test