-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (114 loc) · 5.07 KB
/
Copy pathsvelte-matrix.yml
File metadata and controls
131 lines (114 loc) · 5.07 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
name: Svelte 5.0 + 5.x Matrix
# Phase 5 Plan 05-02b — verify the emitted .svelte output works against
# the Svelte 5.0 floor (PROJECT.md constraint — runes era) AND the latest
# Svelte 5.x. Runs on PRs touching @rozie/target-svelte / @rozie/unplugin /
# the svelte-vite demo.
#
# Matrix: Svelte 5.0 floor + 5.x latest × Vite 5+6.
# (Vite 5 is the floor for unplugin v3; Vite 6 is what svelte-vite-demo
# pins via its own package.json, so exercising both confirms the
# @rozie/unplugin Svelte branch is Vite-version-agnostic.)
#
# Mirrors react-matrix.yml shape exactly.
on:
pull_request:
paths:
- 'packages/targets/svelte/**'
- 'packages/unplugin/**'
- 'packages/core/**'
- 'examples/consumers/svelte-vite/**'
- '.github/workflows/svelte-matrix.yml'
push:
branches: [main]
jobs:
svelte-matrix:
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
svelte-version: ['5.35', '5']
vite-version: ['5', '6']
exclude:
# @sveltejs/vite-plugin-svelte 5.x requires Vite ^6 — exclude
# combinations that violate the peer-dep constraint (would fail
# at install rather than test what we intend to test).
# Floor is 5.35: svelte@5.0–5.34 use esrap@^1.x which throws
# "Not implemented type annotation EmptyStatement" on TypeScript
# type/interface declarations. esrap@^2 (first in svelte@5.35)
# handles them correctly.
- svelte-version: '5.35'
vite-version: '5'
- svelte-version: '5'
vite-version: '5'
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache turbo build output
uses: actions/cache@v5
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.job }}-
${{ runner.os }}-turbo-
# Build the whole workspace via turbo. The swipe canary's emit tests
# (Plan 07.1-03) import every target's dist/ and the dts-identity test
# reads every target's dist/index.d.mts — so all 6 targets must be built
# even on Svelte-only CI runs.
#
# Phase 22 / REQ-6: `turbo run build` includes `svelte-vite-demo#build`
# (`vite build`), whose @rozie/unplugin `buildStart` hook emits the
# per-module `<Name>.d.rozie.ts` sidecars. Sidecars are gitignored (REQ-7),
# absent on a fresh checkout — this step generates them BEFORE the
# "Typecheck demo" step, closing the cold-checkout race.
- name: Build all packages (generates .d.rozie.ts sidecars before typecheck — REQ-6)
run: pnpm turbo run build
- name: Run unit tests (core + targets + runtime + unplugin)
run: |
pnpm exec vitest run --root packages/core
pnpm exec vitest run --root packages/targets/svelte
pnpm exec vitest run --root packages/targets/vue
pnpm exec vitest run --root packages/targets/react
pnpm exec vitest run --root packages/runtime/vue
pnpm exec vitest run --root packages/runtime/react
pnpm exec vitest run --root packages/unplugin
- name: Override Svelte + Vite versions for the demo
working-directory: examples/consumers/svelte-vite
run: |
# '5' = latest 5.x (^5); '5.35' = pinned floor (~5.35.x)
if [ "${{ matrix.svelte-version }}" = "5" ]; then
pnpm add svelte@^5
else
pnpm add svelte@~${{ matrix.svelte-version }}.0
fi
pnpm add -D vite@^${{ matrix.vite-version }}
- name: Re-install with version overrides
run: pnpm install --no-frozen-lockfile
# WR-03: a `.rozie` with no sidecar after the build means buildStart
# silently failed to emit it; --require-complete makes that a hard failure.
- name: Verify every demo .rozie has a fresh sidecar (WR-03)
run: node scripts/check-sidecar-staleness.mjs --require-complete
# REQ-6: the .d.rozie.ts sidecars this consumes were generated by the
# "Build all packages" step above (buildStart hook) — never reorder before it.
- name: Typecheck demo (sidecars generated above — REQ-6)
run: pnpm --filter svelte-vite-demo run typecheck
- name: Build demo
run: pnpm --filter svelte-vite-demo run build
- name: Install Playwright Chromium
run: pnpm --filter svelte-vite-demo run test:e2e:install
- name: Run Playwright e2e tests
run: pnpm --filter svelte-vite-demo run test:e2e
- name: Upload Playwright HTML report on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-report-svelte-${{ matrix.svelte-version }}-vite-${{ matrix.vite-version }}
path: examples/consumers/svelte-vite/playwright-report
retention-days: 7