-
-
Notifications
You must be signed in to change notification settings - Fork 424
247 lines (188 loc) Β· 7.51 KB
/
ci.yml
File metadata and controls
247 lines (188 loc) Β· 7.51 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
merge_group:
branches:
- main
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: π Lint project
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies (root only, no scripts)
run: pnpm install --ignore-scripts
- name: π Lint project
run: pnpm lint
types:
name: πͺ Type check
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: πͺ Type check
run: pnpm test:types
unit:
name: π§ͺ Unit tests
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: π§ͺ Unit tests
run: pnpm test:unit run --coverage --reporter=junit --outputFile=test-report.junit.xml
- name: β¬οΈ Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
test:
name: π§ͺ Component tests
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: π Install browser
run: pnpm playwright install chromium-headless-shell
- name: π§ͺ Component tests
run: pnpm test:nuxt run --coverage --reporter=junit --outputFile=test-report.junit.xml
- name: β¬οΈ Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: β¬οΈ Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
browser:
name: π₯οΈ Browser tests
runs-on: ubuntu-24.04-arm
container:
image: mcr.microsoft.com/playwright:v1.58.0-noble
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: ποΈ Build project
run: pnpm build:playwright
- name: π₯οΈ Test project (browser)
run: pnpm test:browser:prebuilt
a11y:
name: βΏ Accessibility audit
runs-on: ubuntu-latest # See https://github.com/GoogleChrome/lighthouse/discussions/16834
strategy:
matrix:
mode: [dark, light]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: ποΈ Build project
run: NODE_ENV=test pnpm build
- name: βΏ Accessibility audit (Lighthouse - ${{ matrix.mode }} mode)
run: ./scripts/lighthouse-a11y.sh
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LIGHTHOUSE_COLOR_MODE: ${{ matrix.mode }}
knip:
name: π§Ή Unused code check
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: lts/*
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
name: π§ Install pnpm
with:
cache: true
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: π¦ Install dependencies
run: pnpm install
- name: π§Ή Check for unused code
run: pnpm knip
- name: π§Ή Check for unused production code
run: pnpm knip --production