fix(ci): improve E2E workflow with Prisma generate, browser cache, and trace artifacts
- Add missing `pnpm db:generate` step before migrations (Prisma client was not generated) - Add Playwright browser caching to speed up CI runs - Upload trace artifacts on failure for easier debugging - Remove redundant `pnpm build` step (Playwright webServer uses dev commands) Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
28
.github/workflows/e2e.yml
vendored
28
.github/workflows/e2e.yml
vendored
@@ -104,25 +104,45 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Cache Playwright browsers
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
|
||||
- name: Install Playwright browsers
|
||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||
run: npx playwright install --with-deps chromium
|
||||
|
||||
- name: Install Playwright system deps
|
||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||
run: npx playwright install-deps chromium
|
||||
|
||||
- name: Generate Prisma client
|
||||
run: pnpm db:generate
|
||||
|
||||
- name: Run database migrations
|
||||
run: pnpm db:migrate:deploy
|
||||
|
||||
- name: Seed database
|
||||
run: pnpm db:seed
|
||||
|
||||
- name: Build apps
|
||||
run: pnpm build
|
||||
|
||||
- name: Run E2E tests
|
||||
run: pnpm test:e2e
|
||||
|
||||
- name: Upload test report
|
||||
- name: Upload Playwright report
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload Playwright traces
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-traces
|
||||
path: test-results/
|
||||
retention-days: 7
|
||||
|
||||
Reference in New Issue
Block a user