AI-426 OCR Service #11
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: Unit Tests | |
| on: | |
| push: | |
| branches: [main, stage, develop] | |
| pull_request: | |
| branches: [main, stage, develop] | |
| workflow_dispatch: | |
| jobs: | |
| get-environment: | |
| name: Get Environment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| environment: ${{ steps.env.outputs.environment }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get Environment | |
| id: env | |
| uses: ./.github/actions/get-environment | |
| test-backend: | |
| name: Test Backend | |
| needs: get-environment | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/backend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: apps/backend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma Client | |
| run: npx prisma generate | |
| - name: Run tests | |
| run: npm test | |
| - name: Run lint | |
| run: npm run lint || true | |
| test-frontend: | |
| name: Test Frontend | |
| needs: get-environment | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/frontend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: apps/frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run lint | |
| run: npm run lint | |
| - name: Type check | |
| run: npx tsc --noEmit | |