Skip to content

Commit 15c2d42

Browse files
Sam Sahbaei Razaviclaude
andcommitted
chore: GitHub Actions CI — typecheck and build on PR
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e7f3eae commit 15c2d42

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
server:
11+
name: Server — typecheck & test
12+
runs-on: ubuntu-latest
13+
14+
services:
15+
postgres:
16+
image: postgres:16-alpine
17+
env:
18+
POSTGRES_DB: rostid_test
19+
POSTGRES_USER: postgres
20+
POSTGRES_PASSWORD: postgres
21+
ports:
22+
- 5432:5432
23+
options: >-
24+
--health-cmd pg_isready
25+
--health-interval 10s
26+
--health-timeout 5s
27+
--health-retries 5
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
cache: 'npm'
36+
cache-dependency-path: server/package-lock.json
37+
38+
- name: Install server deps
39+
run: cd server && npm ci
40+
41+
- name: Typecheck
42+
run: cd server && npm run build
43+
44+
- name: Run migrations on test DB
45+
run: cd server && npx prisma migrate deploy
46+
env:
47+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/rostid_test
48+
49+
- name: Run tests
50+
run: cd server && npm test
51+
env:
52+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/rostid_test
53+
JWT_ACCESS_SECRET: test-access-secret-min-32-chars-long
54+
JWT_REFRESH_SECRET: test-refresh-secret-min-32-chars-long
55+
JWT_ACCESS_EXPIRES_IN: 15m
56+
JWT_REFRESH_EXPIRES_IN: 7d
57+
COOKIE_SECRET: test-cookie-secret
58+
CLIENT_URL: http://localhost:5173
59+
NODE_ENV: test
60+
61+
client:
62+
name: Client — typecheck & build
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: actions/setup-node@v4
69+
with:
70+
node-version: '20'
71+
cache: 'npm'
72+
cache-dependency-path: client/package-lock.json
73+
74+
- name: Install client deps
75+
run: cd client && npm ci
76+
77+
- name: Typecheck & build
78+
run: cd client && npm run build
79+
env:
80+
VITE_API_URL: http://localhost:4000
81+
82+
- name: Run tests
83+
run: cd client && npm test
84+
env:
85+
VITE_API_URL: http://localhost:4000

0 commit comments

Comments
 (0)