Skip to content

fix CI e2e tests: prevent .env.test from overriding DATABASE_URL #10

fix CI e2e tests: prevent .env.test from overriding DATABASE_URL

fix CI e2e tests: prevent .env.test from overriding DATABASE_URL #10

Workflow file for this run

name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
client:
name: Frontend Build & Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: client/pnpm-lock.yaml
- run: pnpm install
- run: pnpm build
- run: pnpm lint
server:
name: Backend Build & Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: server/pnpm-lock.yaml
- run: pnpm install
- run: npx prisma generate
- run: pnpm build
- run: pnpm lint
server-test:
name: Backend Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: violet
POSTGRES_PASSWORD: violet
POSTGRES_DB: violet_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: server/pnpm-lock.yaml
- run: pnpm install
- run: npx prisma generate
- run: npx prisma migrate deploy
env:
DATABASE_URL: postgresql://violet:violet@localhost:5432/violet_test
- run: pnpm run test
env:
DATABASE_URL: postgresql://violet:violet@localhost:5432/violet_test
REDIS_HOST: localhost
REDIS_PORT: 6379