-
Notifications
You must be signed in to change notification settings - Fork 17
96 lines (79 loc) · 3.02 KB
/
Copy pathci.yml
File metadata and controls
96 lines (79 loc) · 3.02 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel any in-progress run on the same ref when a new commit arrives.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: ${{ matrix.task }} (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# One Node version is enough for now — bump or expand the matrix when
# we need to verify across LTS lines.
node: ['22']
task:
- lint
- format-check
- typecheck
- test
- build
- browser-smoke
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
# Version is pinned via `packageManager` in package.json — pnpm/action-setup
# picks it up automatically.
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
if: matrix.task == 'lint'
run: pnpm lint
- name: Format check
if: matrix.task == 'format-check'
run: pnpm format:check
# mantine's typecheck/tests resolve @ai-react-markdown/core through its
# exports map, which points at dist/ — absent on a fresh checkout since
# matrix tasks run in isolated jobs. Build core first so dependents
# check against the real built artifact (what npm consumers get).
- name: Build core (dependents resolve its dist)
if: matrix.task == 'typecheck' || matrix.task == 'test' || matrix.task == 'browser-smoke'
run: pnpm --filter @ai-react-markdown/core build
- name: Typecheck (all packages)
if: matrix.task == 'typecheck'
run: pnpm -r typecheck
# `pnpm -r` skips the workspace root, so the root script — the only
# gate covering .storybook and packages/*/stories — must run
# explicitly. It also resolves core through dist, built above.
- name: Typecheck (storybook + stories)
if: matrix.task == 'typecheck'
run: pnpm typecheck
- name: Test (all packages)
if: matrix.task == 'test'
run: pnpm -r test
- name: Build (all packages)
if: matrix.task == 'build'
run: pnpm build
# The root vitest config's `storybook` project renders every story in
# headless Chromium (via @storybook/addon-vitest) — the only gate that
# exercises real browser DOM. `pnpm -r test` never reaches it because
# the project lives at the workspace root, so it gets its own task.
- name: Install Playwright Chromium
if: matrix.task == 'browser-smoke'
run: pnpm exec playwright install chromium --with-deps
- name: Browser smokes (storybook stories)
if: matrix.task == 'browser-smoke'
run: pnpm vitest run --project=storybook