feat: Add end-to-end test for creating and exporting a new document w… #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: CI — Lint + Playwright E2E | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run lint | |
| run: npm run lint | |
| unit-tests: | |
| name: Unit tests (Jest) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Jest unit tests | |
| run: npm test -- --coverage | |
| e2e: | |
| needs: unit-tests | |
| name: Playwright E2E (matrix) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| browser: [chromium] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps | |
| - name: Build app | |
| run: npm run build | |
| - name: Run Playwright tests (browser = ${{ matrix.browser }}) | |
| env: | |
| CI: true | |
| run: npx playwright test --project=${{ matrix.browser }} --reporter=list | |
| - name: Upload Playwright report | |
| if: failure() || always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report-${{ matrix.browser }} | |
| path: playwright-report |