-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (75 loc) · 2.43 KB
/
Copy pathci.yml
File metadata and controls
94 lines (75 loc) · 2.43 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
name: CI
on:
pull_request:
push:
branches: [main]
# Supersede in-flight runs on the same branch — a new push makes the old one
# irrelevant, and waiting for it is the main way CI stops feeling fast.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: Lint, typecheck, build
runs-on: ubuntu-latest
timeout-minutes: 10
env:
TURBO_TELEMETRY_DISABLED: 1
steps:
- uses: actions/checkout@v4
# Must precede setup-node, which reads the pnpm version for its cache.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Restore turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: ${{ runner.os }}-turbo-
# One turbo invocation, not three: it schedules all three tasks across
# one graph and runs independent packages in parallel.
- name: Lint, typecheck, build
run: pnpm exec turbo run lint check-types build
# Separate job because it needs a database; guards DDL (HNSW index,
# immutability trigger) that fails silently and won't show up in lint,
# types or build.
schema:
name: Migrations and schema invariants
runs-on: ubuntu-latest
timeout-minutes: 10
services:
postgres:
# Must be pgvector/pgvector, not plain postgres.
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: relivo
POSTGRES_PASSWORD: relivo
POSTGRES_DB: relivo
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U relivo -d relivo"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
# db:* scripts read the root .env via dotenv-cli.
- name: Write .env
run: echo "DATABASE_URL=postgres://relivo:relivo@localhost:5432/relivo" > .env
- name: Migrate
run: pnpm --filter @repo/db db:migrate
- name: Verify schema invariants
run: pnpm --filter @repo/db db:verify