feat(transactions): improve search relevance and server-side filtering #614
Workflow file for this run
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/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| tags: | |
| - "v*" | |
| paths: | |
| - "backend/**" | |
| - ".github/workflows/backend-ci-cd.yml" | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| paths: | |
| - "backend/**" | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }}/backend | |
| jobs: | |
| # ============================================================================ | |
| # TEST: Unit Tests | |
| # ============================================================================ | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| cache-dependency-path: "backend/pnpm-lock.yaml" | |
| - name: Install dependencies | |
| run: cd backend && pnpm install --frozen-lockfile | |
| - name: Run unit tests | |
| run: cd backend && pnpm run test | |
| - name: Generate coverage report | |
| run: cd backend && pnpm run test:cov | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./backend/coverage/coverage-final.json | |
| flags: unittests | |
| fail_ci_if_error: false | |
| # ============================================================================ | |
| # BUILD: Ensure the NestJS project compiles cleanly | |
| # ============================================================================ | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| cache-dependency-path: "backend/pnpm-lock.yaml" | |
| - name: Install dependencies | |
| run: cd backend && pnpm install --frozen-lockfile | |
| - name: Build | |
| run: cd backend && pnpm run build | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-dist | |
| path: backend/dist | |
| retention-days: 7 | |
| # ============================================================================ | |
| # MIGRATIONS: Validate migrations and test rollbacks | |
| # ============================================================================ | |
| migrations-check: | |
| runs-on: ubuntu-latest | |
| name: Validate Migrations | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: user | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: nestera | |
| 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 pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| cache-dependency-path: "backend/pnpm-lock.yaml" | |
| - name: Install dependencies | |
| run: cd backend && pnpm install --frozen-lockfile | |
| - name: Check idempotency (down methods exist) | |
| run: cd backend && node scripts/check-migrations-down.js | |
| - name: Test Migration Rollbacks | |
| env: | |
| DATABASE_URL: postgresql://user:password@localhost:5432/nestera | |
| run: cd backend && bash scripts/test-rollback.sh |