Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI Pipeline

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

env:
NODE_VERSION: '20'

jobs:
backend:
name: Backend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: backend/package-lock.json

- name: Install & Build
run: npm ci && npm run build

- name: Test
run: npm test
env:
DB_HOST: localhost
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
NODE_ENV: test

frontend:
name: Frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install & Build
run: npm ci && npm run build
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}

- name: Lint
run: npm run lint

- name: Test
run: npm test -- --passWithNoTests
env:
CI: true
Loading
Loading