Repository navigation
83 lines (68 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
83 lines (68 loc) · 2.71 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Explicit least privilege, so a change to the repo-wide default can't widen it.
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v7
with:
# Changesets compares package changes with the pull request base.
fetch-depth: 0
persist-credentials: false
# Pinned to the packageManager version, not "latest". bun.lock was
# resolved by this version, and a newer bun can dedupe transitive
# dependencies differently — which is exactly how a duplicate
# prosemirror-model slipped past local checks and broke the Vercel build.
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.8
- uses: actions/setup-node@v7
with:
node-version-file: .node-version
package-manager-cache: false
# Generates .source (postinstall: fumadocs-mdx) so the docs build compiles.
- run: bun install --frozen-lockfile
- name: Changeset status
# A Changesets-generated version PR has consumed its changesets already.
if: >-
github.event_name == 'pull_request' &&
!(github.event.pull_request.user.login == 'github-actions[bot]' &&
startsWith(github.head_ref, 'changeset-release/'))
run: bunx changeset status --since=${{ github.event.pull_request.base.sha }}
- name: Lint
run: bunx biome check
- name: Typecheck
run: bunx tsc --noEmit
- name: Package tests
run: bun test
working-directory: packages/chat
- name: Package build (publint gate)
working-directory: packages/chat
run: |
bun run build
bunx --no-install publint
# The docs demos are the styled reference people copy, so they must
# compile against the built package with no app aliases in scope. Runs
# after the build above, which produces the dist this typechecks against.
- name: Demo portability gate
run: bunx tsc -p tsconfig.demos.json
# Docs drift silently — a renamed part or dropped prop breaks no build, so
# pages go on documenting an API that no longer exists. This resolves the
# real parts through the type checker and fails on any contradiction.
- name: Docs match the package
run: node scripts/audit-docs.mjs
# No credentials: the chat route takes the visitor's own key from a cookie
# at request time, so the build needs nothing in the environment.
- name: App build
run: bun run build