Merge pull request #26 from Nandgopal-R/fix/form-fields #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Backend CI Pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**' | |
| - 'prisma/**' | |
| - 'package.json' | |
| - 'bun.lock' | |
| - 'tsconfig.json' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**' | |
| - 'prisma/**' | |
| - 'package.json' | |
| - 'bun.lock' | |
| - 'tsconfig.json' | |
| jobs: | |
| backend-ci: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: 1234 | |
| POSTGRES_DB: test_db | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| .bun | |
| ~/.bun/install/cache | |
| prisma/generated | |
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'package.json', 'tsconfig.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Generate Prisma client | |
| run: bunx prisma generate | |
| env: | |
| DATABASE_URL: postgresql://postgres:1234@localhost:5432/test_db | |
| - name: Code quality check (Biome) | |
| run: bun run check | |
| - name: Type checking | |
| run: bun run typecheck | |
| - name: Run database migrations | |
| run: bunx prisma migrate deploy | |
| env: | |
| DATABASE_URL: postgresql://postgres:1234@localhost:5432/test_db | |
| - name: Security audit | |
| run: bun audit | |
| - name: Build application | |
| run: bun run build | |
| - name: Build verification | |
| run: | | |
| # Verify the built application can start without errors | |
| timeout 10s bun dist/index.js || true | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-build-artifacts | |
| path: | | |
| dist/ | |
| prisma/generated/ | |
| retention-days: 7 |