Merge pull request #335 from sammajayi/feat/quiz-retake-limit #155
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: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| backend: | |
| name: Backend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| env: | |
| JWT_SECRET: ci-test-secret-minimum-32-characters-long | |
| NODE_ENV: test | |
| 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: backend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Unit Tests | |
| run: npm run test --passWithNoTests | |
| - name: E2E Tests | |
| run: npm run test:e2e --passWithNoTests | |
| frontend: | |
| name: Frontend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| env: | |
| NEXT_PUBLIC_API_URL: http://localhost:3001 | |
| 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: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| frontend-e2e: | |
| name: Frontend E2E Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| JWT_SECRET: ci-test-secret-minimum-32-characters-long | |
| NEXT_PUBLIC_API_URL: http://localhost:3001 | |
| NODE_ENV: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install backend dependencies | |
| working-directory: backend | |
| run: npm ci | |
| - name: Start backend | |
| working-directory: backend | |
| run: npm run start:dev & | |
| - name: Install frontend dependencies | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| working-directory: frontend | |
| run: npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| working-directory: frontend | |
| run: npm run test:e2e |