-
-
Notifications
You must be signed in to change notification settings - Fork 117
422 lines (361 loc) · 12.7 KB
/
Copy pathci.yml
File metadata and controls
422 lines (361 loc) · 12.7 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
name: CI
# Single PR/push pipeline: one `changes` job evaluates path filters, every
# downstream job gates on exactly one output, so a change only runs the suites
# it can affect (a marketing-only PR runs just Biome; a Rust-only PR skips the
# frontend/sidecar/e2e lanes; etc.).
#
# Filters compose via YAML anchors — `global` (CI config, lockfile, root
# tool/build config, build scripts) is folded into every category, so a
# cross-cutting tooling change force-runs the full suite and can never
# silently skip a lane. paths-filter flattens nested anchor lists.
#
# macOS is the upstream reference platform; the windows-* jobs mirror the
# platform-sensitive parts on windows-latest (process/fs/paths/executable
# boundaries, the `.cmd` CLI shim, bundled-binary resolution, win32 vendor
# staging). The NSIS installer build is NOT run here — it's expensive and
# covered at release time by publish.yml (build-and-publish-windows).
on:
pull_request:
push:
branches:
- main
- windows-port
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
env:
CI: true
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
biome: ${{ steps.filter.outputs.biome }}
typecheck: ${{ steps.filter.outputs.typecheck }}
frontend: ${{ steps.filter.outputs.frontend }}
e2e: ${{ steps.filter.outputs.e2e }}
sidecar: ${{ steps.filter.outputs.sidecar }}
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
global: &global
- '.github/**'
- 'package.json'
- 'bun.lock'
- 'biome.json'
- 'tsconfig*.json'
- 'scripts/**'
frontend: &frontend
- *global
- 'src/**'
- 'public/**'
- 'index.html'
- 'vite.config.ts'
- 'vite.e2e.config.ts'
- 'vitest.shims.d.ts'
- 'components.json'
- '.storybook/**'
sidecar: &sidecar
- *global
- 'sidecar/**'
# Agent SDK bumps land in sidecar/package.json + sidecar/bun.lock;
# the SDK event shape is the contract the Rust accumulator depends
# on, so those two files must re-run the pipeline snapshot tests
# (see AGENTS.md "Bundled agent CLIs").
rust:
- *global
- 'src-tauri/**'
- 'sidecar/package.json'
- 'sidecar/bun.lock'
e2e:
- *global
- 'src/**'
- 'e2e/**'
- 'playwright.config.ts'
- 'vite.e2e.config.ts'
# Root tsc also checks playwright.config.ts via tsconfig.node.json
# references (vite configs are already in `frontend`).
typecheck:
- *frontend
- *sidecar
- 'playwright.config.ts'
# Biome lints the whole repo (biome.json includes: ["**"]), so gate
# on every extension Biome can parse, anywhere — this mirrors
# `biome check .` instead of trying to enumerate directories.
biome:
- *global
- '**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,json,jsonc,css,html,vue,svelte,astro,graphql}'
# ---------- Quality ----------
biome:
name: Biome
needs: changes
if: needs.changes.outputs.biome == 'true'
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run Biome
run: bunx biome check . --config-path=./biome.json
clippy:
name: Clippy
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Setup Rust Tauri
uses: ./.github/actions/setup-rust-tauri
# Stage the sidecar vendor tree, but NOT the release helmor-cli. The crate
# compile needs `sidecar/dist/vendor/` (a Tauri bundle resource) to exist;
# `cargo clippy --all-targets` compiles helmor-cli from source and
# build.rs stubs the externalBin placeholders. This skips the
# `cargo build --bin helmor-cli --release` the full build-sidecar action
# runs — ~3m16s clippy never uses.
- name: Stage sidecar vendor tree
shell: bash
run: cd sidecar && bun install --frozen-lockfile && bun run build
- name: Run clippy
run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
typecheck:
name: Typecheck
needs: changes
if: needs.changes.outputs.typecheck == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run typecheck
run: bun run typecheck
# ---------- Test ----------
frontend-test:
name: Frontend Test
needs: changes
if: needs.changes.outputs.frontend == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run frontend tests
run: bun run test:frontend
sidecar-test:
name: Sidecar Test
needs: changes
if: needs.changes.outputs.sidecar == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run sidecar tests
shell: bash
run: bun run test:sidecar
rust-test:
name: Rust Test
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Setup Rust Tauri
uses: ./.github/actions/setup-rust-tauri
# rust-test stages for the host arch (macos-latest is arm64) — `bun run
# build` below has no TAURI_TARGET_TRIPLE, so it downloads aarch64 archives.
- name: Cache bundle archives
uses: ./.github/actions/cache-bundle-archives
with:
target-triple: aarch64-apple-darwin
# Stage the sidecar vendor tree, but NOT the release helmor-cli. The crate
# compile needs `sidecar/dist/vendor/` (a Tauri bundle resource) to exist;
# build.rs stubs the helmor-cli / helmor-sidecar externalBin placeholders,
# and no test spawns the real sidecar. This skips the
# `cargo build --bin helmor-cli --release` the full build-sidecar action
# runs — ~3m16s the tests never use. (`bun run build` = stage-vendor plus
# the ~4s bun sidecar compile.)
- name: Stage sidecar vendor tree
shell: bash
run: cd sidecar && bun install --frozen-lockfile && bun run build
- name: Run Rust tests with nextest
shell: bash
run: cd src-tauri && cargo nextest run
- name: Run Rust doctests
shell: bash
run: cd src-tauri && cargo test --doc
e2e-test:
name: E2E Test
needs: changes
if: needs.changes.outputs.e2e == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
# Cache the WebKit bundle (~90MB) so cold runs aren't gated on the
# Playwright CDN. Keyed on bun.lock so a `@playwright/test` bump busts
# the cache automatically — under-specifying the key risks booting with
# a mismatched browser after a version bump.
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/Library/Caches/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright WebKit
shell: bash
run: bunx playwright install webkit
- name: Run E2E tests
shell: bash
run: bun run test:e2e
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 14
if-no-files-found: ignore
# ---------- Build ----------
app-build:
name: App Build
needs: changes
if: needs.changes.outputs.frontend == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run app build
run: bun run build
storybook-build:
name: Storybook Build
needs: changes
if: needs.changes.outputs.frontend == 'true'
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
- name: Run Storybook build
run: bun run build-storybook
# ---------- Windows ----------
windows-typecheck:
name: Windows Typecheck
needs: changes
if: needs.changes.outputs.typecheck == 'true'
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
with:
# sccache is unused by the Windows jobs and its installer is flaky
# on Windows runners; skip it.
install-sccache: "false"
# Covers the win32 branches added to sidecar/scripts/vendor-platform.ts
# and the frontend, neither of which the macOS typecheck exercises with
# `process.platform === "win32"`.
- name: Run typecheck
shell: bash
run: bun run typecheck
windows-sidecar-test:
name: Windows Sidecar Test
needs: changes
if: needs.changes.outputs.sidecar == 'true'
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
with:
# sccache is unused by the Windows jobs and its installer is flaky
# on Windows runners; skip it.
install-sccache: "false"
- name: Run sidecar tests
shell: bash
run: bun run test:sidecar
windows-rust-test:
name: Windows Rust Test
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: windows-latest
timeout-minutes: 40
env:
# src-tauri/.cargo/config.toml sets rustc-wrapper = "sccache" for the
# macOS jobs (where setup-rust-tauri installs sccache). Override it
# back to empty on Windows so cargo doesn't try to invoke a binary
# that isn't on PATH.
RUSTC_WRAPPER: ""
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup JS toolchain
uses: ./.github/actions/setup-js
with:
# sccache is unused by the Windows jobs and its installer is flaky
# on Windows runners; skip it.
install-sccache: "false"
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
# boring-sys2 (transitive native dep) assembles with NASM on Windows;
# the runner ships Perl (Strawberry) but not NASM.
- name: Setup NASM
uses: ilammy/setup-nasm@v1
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
shared-key: windows-tauri-v1
workspaces: src-tauri -> target
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
# The crate compile needs `sidecar/dist/vendor/` (a Tauri bundle resource)
# to exist; build.rs stubs the externalBin placeholders. On Windows this
# stages the win32 vendor tree (see vendor-platform.ts).
- name: Stage sidecar vendor tree
shell: bash
run: cd sidecar && bun install --frozen-lockfile && bun run build
- name: Run Rust tests with nextest
shell: bash
run: cd src-tauri && cargo nextest run
- name: Run Rust doctests
shell: bash
run: cd src-tauri && cargo test --doc