Skip to content

Improvment: improved ci.yml for related to test fixes #7

Improvment: improved ci.yml for related to test fixes

Improvment: improved ci.yml for related to test fixes #7

Workflow file for this run

name: CI pipeLine
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: arun
POSTGRES_PASSWORD: 12arun
POSTGRES_DB: BrainVector
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U arun -d BrainVector"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
working-directory: backend
run: npm ci
- name: Run database migrations
working-directory: backend
run: npx prisma migrate deploy
- name: Run E2E tests
working-directory: backend
env:
DATABASE_URL: postgres://arun:12arun@localhost:5432/BrainVector
NODE_ENV: test
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: |
echo "✅ Loading environment variables..."
export $(grep -v '^#' .env | xargs) || true
npm run test:e2e