-
Notifications
You must be signed in to change notification settings - Fork 58
133 lines (108 loc) · 3.78 KB
/
ci.yml
File metadata and controls
133 lines (108 loc) · 3.78 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
name: CI
on:
push:
branches: [main]
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
branches: [main]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Cache Turbo
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Production dependency audit
run: pnpm audit:prod
- name: Build
run: pnpm build
- name: TypeCheck
run: pnpm typecheck
- name: Lint
run: pnpm lint
- name: Test
run: TURBO_FORCE=true pnpm test
- name: Install Playwright Browsers
if: github.event_name == 'pull_request'
run: pnpm --filter @ownpilot/ui exec playwright install chromium --with-deps
- name: Playwright E2E
if: github.event_name == 'pull_request'
# E2E requires a full backend (Postgres + gateway + a configured
# password) that this job does not provision, so run it best-effort.
# Until full-stack E2E infra is added, its failure must not block the
# required check.
continue-on-error: true
run: pnpm --filter @ownpilot/ui exec playwright test
env:
CI: 'true'
- name: Format Check
run: pnpm format:check
migration-smoke-test:
name: Migration smoke test (pgvector/pg16)
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: ownpilot
POSTGRES_PASSWORD: ownpilot_ci_password
POSTGRES_DB: ownpilot
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U ownpilot"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6
- name: Use Node.js 22
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The smoke test imports gateway source via tsx, which in turn imports
# `@ownpilot/core` — and gateway's resolution points at core's compiled
# `dist/index.js`. Without this build step the smoke test fails with
# `Cannot find module '@ownpilot/core/dist/index.js'` before it ever
# touches the database.
- name: Build core dependency
run: pnpm --filter @ownpilot/core build
- name: Run migration smoke test
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: '5432'
POSTGRES_USER: ownpilot
POSTGRES_PASSWORD: ownpilot_ci_password
POSTGRES_DB: ownpilot
run: pnpm --filter @ownpilot/gateway exec tsx scripts/migration-smoke-test.ts