-
Notifications
You must be signed in to change notification settings - Fork 8
115 lines (90 loc) · 3.01 KB
/
Copy pathci.yml
File metadata and controls
115 lines (90 loc) · 3.01 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
name: CI
on:
pull_request:
branches: [main, release]
push:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
# Skip if commit message contains [skip ci]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node-version: [24.x]
# Postgres (with pgvector) for the DB-backed adapter suites. The image ships
# the `vector` extension that init-db.sql requires. The default `portos` DB
# exists so setup:db:test has a maintenance connection to CREATE portos_test
# from; the suites themselves only ever touch portos_test (the production
# `portos` name is hard-blocked by isTestDatabase()).
services:
postgres:
image: pgvector/pgvector:pg17
env:
POSTGRES_USER: portos
POSTGRES_PASSWORD: portos
POSTGRES_DB: portos
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U portos"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: portos
PGPASSWORD: portos
steps:
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install root dependencies
run: npm ci
- name: Install server dependencies
run: npm install --prefix server
- name: Install client dependencies
run: npm install --prefix client
# Main server suite runs WITHOUT PGDATABASE pointing at a test DB, so the
# DB-backed suites skip here (they'd see the non-test `portos` name). They
# run in their own serial step below against portos_test.
- name: Run server tests
run: npm run test:ci --prefix server
- name: Provision test database (portos_test)
run: npm run setup:db:test --prefix server
- name: Run DB-backed tests (portos_test)
run: npm run test:db:ci --prefix server
env:
PGDATABASE: portos_test
- name: Run client tests
run: npm test --prefix client
- name: Build client
run: npm run build --prefix client
- name: Smoke-boot server (fail if top-level init crashes)
run: npm run smoke
lint:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v7
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: 'npm'
- name: Install root dependencies
run: npm ci
- name: Install server dependencies
run: npm install --prefix server
- name: Install client dependencies
run: npm install --prefix client
- name: Check for syntax errors
run: node --check server/index.js
- name: Lint client
run: npm run lint --prefix client