Test Pipeline #83
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: Test Pipeline | |
| # Fail fast on cheap checks before paying for expensive ones. | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| # Nightly full run (full browser matrix, full E2E suite) | |
| - cron: "0 2 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true # don't waste CI minutes on superseded pushes | |
| jobs: | |
| lint-and-typecheck: | |
| name: Lint & Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 | |
| - run: corepack enable | |
| - run: corepack prepare pnpm@latest --activate | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| - run: pnpm typecheck | |
| # unit tests | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-and-typecheck | |
| steps: | |
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 | |
| - run: corepack enable | |
| - run: corepack prepare pnpm@latest --activate | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm test:unit --coverage | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 | |
| with: | |
| name: unit-coverage | |
| path: coverage/ | |
| - name: Enforce coverage thresholds | |
| run: pnpm test:coverage-check | |
| # Integration tests - needs Docker for Testcontainers | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| steps: | |
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 | |
| - run: corepack enable | |
| - run: corepack prepare pnpm@latest --activate | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm test:integration | |
| # e2e smoke - critical paths only, chromium only on PRs | |
| e2e-smoke: | |
| name: E2E Smoke Tests | |
| runs-on: ubuntu-latest | |
| needs: integration-tests | |
| steps: | |
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 | |
| - run: corepack enable | |
| - run: corepack prepare pnpm@latest --activate | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm exec playwright install chromium | |
| - run: pnpm test:e2e --grep @smoke --project=chromium | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 14 | |
| # full browser matrix (nightly + PRs, not in required checks) | |
| e2e-full-matrix: | |
| name: E2E Full Browser Matrix | |
| if: github.event_name == 'schedule' || github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| browser: [chromium, firefox, webkit] | |
| steps: | |
| - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 | |
| - run: corepack enable | |
| - run: corepack prepare pnpm@latest --activate | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm exec playwright install ${{ matrix.browser }} | |
| - run: pnpm test:e2e --project=${{ matrix.browser }} | |
| env: | |
| FULL_BROWSER_MATRIX: "true" | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 | |
| with: | |
| name: playwright-report-${{ matrix.browser }} | |
| path: playwright-report/ | |
| retention-days: 14 | |
| # required status check for branch protection | |
| required-checks-passed: | |
| name: All Required Checks Passed | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-typecheck, unit-tests, integration-tests, e2e-smoke] | |
| if: always() | |
| steps: | |
| - name: Check all jobs succeeded | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then | |
| echo "One or more required jobs failed." | |
| exit 1 | |
| fi |