-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathconfig.yml
162 lines (151 loc) · 3.74 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
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.5.0
commands:
pnpm_setup:
steps:
- run:
name: Install pnpm package manager
command: |
sudo corepack enable
pnpm config set store-dir ~/repo/.pnpm-store
- restore_cache:
name: Restore pnpm package cache
keys:
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
- run:
name: Install Dependencies
command: pnpm install --frozen-lockfile
jobs:
install:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
steps:
- checkout
- pnpm_setup
- save_cache:
name: Save pnpm package cache
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
paths:
- .pnpm-store
validate:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
steps:
- checkout
- pnpm_setup
- run:
name: Lint + Typecheck
command: pnpm validate
test-unit:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
resource_class: medium+
parameters:
react-major-version:
type: string
steps:
- checkout
- pnpm_setup
- run:
name: Jest Suite
command: pnpm test
environment:
JEST_JUNIT_OUTPUT: 'test-reports/junit/js-test-results.xml'
REACT_MAJOR_VERSION: << parameters.react-major-version >>
- store_test_results:
path: test-reports/junit
test-bundle:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
steps:
- checkout
- pnpm_setup
- run:
name: Check Bundle Size
command: pnpm run bundle-size:check
build:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
steps:
- checkout
- pnpm_setup
- run:
name: Build asset
command: pnpm build
- persist_to_workspace:
root: dist
paths:
- '*'
test-browser:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
environment:
CYPRESS_CACHE_FOLDER: ~/repo/.cache/Cypress
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- pnpm_setup
- run:
name: Make sure cypress binary is installed
command: pnpm cypress install
- attach_workspace:
at: ~/repo/dist
- run:
name: 'Run cypress'
command: node browser-test-harness.js browser
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
test-a11y:
docker:
- image: cimg/node:22.12.0-browsers
working_directory: ~/repo
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
- pnpm_setup
- attach_workspace:
at: ~/repo/dist
- run:
name: Accessibility Audit
command: node browser-test-harness.js accessibility
- store_artifacts:
path: test-reports/lighthouse
- store_test_results:
path: test-reports/lighthouse
workflows:
version: 2
build:
jobs:
- install
- validate:
requires:
- install
- test-unit:
matrix:
parameters:
react-major-version: ['18', '19']
requires:
- install
- test-bundle:
requires:
- install
- build:
requires:
- install
- test-browser:
requires:
- build
- test-a11y:
requires:
- build