AI-489 QA Workflows Fix #5
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 Quality Assurance | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: [main, develop] | |
| paths: | |
| - '.github/workflows/backend-qa.yml' | |
| - 'apps/backend-services/src/**' | |
| workflow_dispatch: | |
| jobs: | |
| get-environment: | |
| name: Prepare Environment | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./apps/backend-services | |
| outputs: | |
| environment: ${{ steps.env.outputs.environment }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get Environment | |
| id: env | |
| uses: ./.github/actions/get-environment | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| # cache: 'node_modules' | |
| # cache-dependency-path: 'apps/backend-services/package-lock.json' | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| unit-tests: | |
| name: Unit Tests | |
| needs: get-environment | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./apps/backend-services | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| # cache: 'node_modules' | |
| # cache-dependency-path: 'apps/backend-services/package-lock.json' | |
| - name: Restore Node.js modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma Client | |
| run: npm run db: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: '24' | |
| # 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 | |