Skip to content

Smart code lab testing #62

Smart code lab testing

Smart code lab testing #62

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
backend:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
JWT_SECRET: ${{secrets.JWT_SECRET}}
ALLOWED_ORIGINS: "http://localhost:5173"
NODE_ENV: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install backend deps
run: cd backend && npm ci
- name: Generate Prisma Client
run: cd backend && npx prisma generate
- name: Run backend tests with coverage
run: cd backend && npm test -- --coverage --ci
- name: Build Backend
run: cd backend && npm run build
frontend:
runs-on: ubuntu-latest
needs: backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install frontend deps
run: cd frontend && npm ci
- name: Run frontend tests
run: cd frontend && npm run test:coverage
env:
VITE_BACKEND_URL: "http://localhost:8000"
- name: Build frontend
run: cd frontend && npm run build
env:
VITE_BACKEND_URL: "http://localhost:8000"