diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c4f9d6..5a747a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,67 @@ jobs: - name: Web build run: pnpm --filter @notelett/web run build + web-e2e: + name: Web E2E — Playwright + runs-on: ubuntu-latest + needs: web + steps: + - uses: actions/checkout@v4 + + - name: Checkout common-plat (for @bytelyst/* packages) + uses: actions/checkout@v4 + with: + repository: saravanakumardb1/learning_ai_common_plat + path: learning_ai_common_plat + token: ${{ secrets.GH_PAT }} + + - name: Link common-platform workspace path + run: | + mkdir -p ../learning_ai + ln -sfn "$GITHUB_WORKSPACE/learning_ai_common_plat" ../learning_ai/learning_ai_common_plat + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + + - name: Enable pnpm + run: corepack enable + + - name: Build @bytelyst/* packages + working-directory: learning_ai_common_plat + run: | + pnpm install --frozen-lockfile + pnpm build + + - name: Install workspace dependencies + run: pnpm install --frozen-lockfile + + - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright- + + - name: Install Playwright Chromium + run: pnpm --filter @notelett/web exec playwright install --with-deps chromium + + - name: Web Playwright E2E + run: pnpm --filter @notelett/web run test:e2e -- --reporter=list + + - name: Upload Playwright report + if: always() + uses: actions/upload-artifact@v4 + with: + name: web-playwright-report + path: | + web/playwright-report + web/test-results + if-no-files-found: ignore + mobile: name: Mobile — lint + typecheck + test runs-on: ubuntu-latest diff --git a/web/playwright.config.ts b/web/playwright.config.ts index 08aabf0..ec4f37f 100644 --- a/web/playwright.config.ts +++ b/web/playwright.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ trace: "on-first-retry", }, webServer: { - command: "npm run dev", + command: "pnpm run dev", url: "http://localhost:3000", reuseExistingServer: !process.env.CI, timeout: 120_000,