Skip to content

fix: prisma env during ci #2

fix: prisma env during ci

fix: prisma env during ci #2

Workflow file for this run

name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
# Cancel in-progress runs for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: Lint, Typecheck, Test, Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 25
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate Prisma Client
run: cd apps/api && npx prisma generate
env:
DATABASE_URL: postgresql://test:test@localhost:5432/test
- name: Run migrations
run: cd apps/api && npx prisma migrate deploy
env:
DATABASE_URL: postgresql://test:test@localhost:5432/test
- name: Lint (Biome)
run: npm run lint:ci
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm run test
env:
DATABASE_URL: postgresql://test:test@localhost:5432/test
JWT_SECRET: test-secret-that-is-at-least-32-chars-long
JWT_REFRESH_SECRET: test-refresh-secret-at-least-32-chars
NODE_ENV: test
- name: Build
run: npm run build