-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
284 lines (279 loc) · 9.97 KB
/
ci.yml
File metadata and controls
284 lines (279 loc) · 9.97 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
name: CI
on:
push:
branches:
- main
paths-ignore: &paths_ignore
- '.changeset/**'
- '.githooks/**'
- '.github/ISSUE_TEMPLATE/**'
- '.github/copilot-instructions.md'
- '.github/FUNDING.yml'
- '.github/PULL_REQUEST_TEMPLATE.md'
- 'documentation/**'
- 'packages/*/CHANGELOG*.md'
- 'packages/kit/src/types/synthetic/**'
- 'AGENTS.md'
- 'CLAUDE.md'
- 'CONTRIBUTING.md'
- 'FUNDING.json'
- 'LICENSE'
- 'README.md'
pull_request:
paths-ignore: *paths_ignore
env:
# we call `pnpm playwright install` instead
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
# 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 # to fetch code (actions/checkout)
jobs:
pkg-pr-new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpx pkg-pr-new publish --comment=off ./packages/*
lint-all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: cd packages/kit && pnpm prepublishOnly && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please run prepublishOnly locally and commit the changes after you have reviewed them"; git diff; exit 1); }
- run: pnpm run check
test-kit:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'baseline'
- node-version: 20
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 22
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'beta'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
MATRIX_VITE: ${{matrix.vite}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: setup overrides for matrix.vite
if: matrix.vite != 'current'
run:
| # copies catalogs.vite-xxx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."vite-${{matrix.vite}}"' pnpm-workspace.yaml
pnpm install --no-frozen-lockfile
git checkout pnpm-lock.yaml pnpm-workspace.yaml # revert changes to pnpm files to avoid cache key changes
pnpm --dir packages/kit ls vite
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:kit
env:
NODE_OPTIONS: ${{matrix.node-version == 22 && '--experimental-strip-types' || ''}} # allows loading svelte.config.ts
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}-vite-${{matrix.vite}}
path: test-results.tar.gz
test-kit-cross-browser:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: 24
os: windows-latest
e2e-browser: 'chromium'
mode: 'dev'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'dev'
- node-version: 24
os: macOS-latest
e2e-browser: 'webkit'
mode: 'dev'
- node-version: 24
os: windows-latest
e2e-browser: 'chromium'
mode: 'build'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'build'
- node-version: 24
os: macOS-latest
e2e-browser: 'webkit'
mode: 'build'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:cross-platform:${{ matrix.mode }}
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results-cross-platform-${{ matrix.mode }}.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
retention-days: 3
name: test-failure-cross-platform-${{ matrix.mode }}-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
path: test-results-cross-platform-${{ matrix.mode }}.tar.gz
test-kit-server-side-route-resolution:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- mode: 'dev'
- mode: 'build'
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install chromium --no-shell
- run: pnpm run sync-all
- run: pnpm test:server-side-route-resolution:${{ matrix.mode }}
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results-server-side-route-resolution-${{ matrix.mode }}.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
retention-days: 3
name: test-failure-server-side-route-resolution-${{ matrix.mode }}-${{ github.run_id }}
path: test-results-server-side-route-resolution-${{ matrix.mode }}.tar.gz
test-kit-svelte-async:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- mode: 'dev'
- mode: 'build'
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install chromium --no-shell
- run: pnpm run sync-all
- run: pnpm test:svelte-async:${{ matrix.mode }}
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results-svelte-async-${{ matrix.mode }}.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
retention-days: 3
name: test-failure-svelte-async-${{ matrix.mode }}-${{ github.run_id }}
path: test-results-svelte-async-${{ matrix.mode }}.tar.gz
test-others:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22, 24]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5.0.0
- uses: actions/setup-node@v6
with:
node-version: ${{matrix.node-version}}
cache: pnpm
# required for testing netlify edge functions
- uses: denoland/setup-deno@v2
with:
deno-version: ^2.2.4
- run: pnpm install --frozen-lockfile
- name: setup overrides for matrix.node
if: matrix.node-version == 18
run:
| # copies catalogs.node-xx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."node-18"' pnpm-workspace.yaml
pnpm install --no-frozen-lockfile
git checkout pnpm-lock.yaml pnpm-workspace.yaml # revert changes to pnpm files to avoid cache key changes
pnpm --dir packages/kit ls vite @sveltejs/vite-plugin-svelte
- run: pnpm playwright install chromium --no-shell
- run: cd packages/kit && pnpm prepublishOnly
- run: pnpm run test:others
env:
NODE_OPTIONS: ${{matrix.node-version == 22 && '--experimental-strip-types' || ''}} # allows loading svelte.config.ts