Skip to content

Merge pull request #10 from CodePapi/instructions #12

Merge pull request #10 from CodePapi/instructions

Merge pull request #10 from CodePapi/instructions #12

Workflow file for this run

name: BE Tests
on:
push:
branches:
- main
- develop
paths:
- 'BE/**'
- 'package.json'
pull_request:
branches:
- main
- develop
paths:
- 'BE/**'
- 'package.json'
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: runner
POSTGRES_PASSWORD: password
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://runner:password@localhost:5432/testdb
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies (Root and Workspaces)
run: npm install
- name: ⏳ Wait for DB to be ready
run: sleep 5
- name: 🧬 Run Prisma Migrations (Apply schema to test DB)
run: cd BE && npx prisma migrate deploy
- name: 🛠️ Generate Prisma Client
run: cd BE && npx prisma generate
- name: 🧪 Run Backend Tests
run: npm run test:be