mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
feat: add ci for frontend and backend
This commit is contained in:
@@ -0,0 +1,70 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
frontend:
|
||||||
|
name: Frontend CI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./frontend
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
- name: Code Quality (Biome)
|
||||||
|
run: bun run check
|
||||||
|
- name: Type Check & Build
|
||||||
|
run: bun run build
|
||||||
|
|
||||||
|
backend:
|
||||||
|
name: Backend CI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./backend
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: piku
|
||||||
|
POSTGRES_USER: atom
|
||||||
|
POSTGRES_PASSWORD: password123
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 # wait till up before starting (integrating) django app
|
||||||
|
env:
|
||||||
|
DB_NAME: piku
|
||||||
|
DB_USER: atom
|
||||||
|
DB_PASSWORD: password123
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_PORT: 5432
|
||||||
|
SECRET_KEY: ci-test-secret-key
|
||||||
|
DEBUG: True
|
||||||
|
FRONTEND_URL: http://localhost:5173
|
||||||
|
CORS_ALLOWED_ORIGINS: http://localhost:5173
|
||||||
|
EMAIL_HOST: localhost
|
||||||
|
EMAIL_PORT: 1025
|
||||||
|
FROM_EMAIL: ci@pi-ku.app
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
with:
|
||||||
|
version: "latest"
|
||||||
|
enable-cache: true
|
||||||
|
cache-dependency-glob: backend/uv.lock
|
||||||
|
- name: Install dependencies
|
||||||
|
run: uv sync
|
||||||
|
- name: Lint (Ruff)
|
||||||
|
run: uv run ruff check
|
||||||
|
- name: Run Tests
|
||||||
|
run: uv run python manage.py test
|
||||||
Reference in New Issue
Block a user