From 4c80b563de6b0c17647fb3d060f32a31bbcf2577 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 Apr 2026 16:43:40 +0530 Subject: [PATCH] feat: add ci for frontend and backend --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b6e553d --- /dev/null +++ b/.github/workflows/ci.yml @@ -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