mirror of
https://github.com/Drop-OSS/drop
synced 2026-08-27 14:23:05 -04:00
ci: add Playwright E2E workflow
Adds .github/workflows/e2e.yml — separate from main ci.yml so the ~15-30min e2e pipeline doesn't slow down PR feedback loops for unit-test changes. Triggers: changes to server/** (which is where the e2e tests live) or the workflow/playwright config itself. Does NOT run on every PR — only when server code or e2e infra changes. Setup: - pnpm install - Playwright chromium with deps - pnpm run test:e2e (Playwright auto-spawns the dev server via webServer config — no explicit start needed) - On failure: upload playwright-report/ as CI artifact (7-day retention) Pipeline budget: ~15-30min on a warm cache, longer on cold. Adds another SHA-pinned action (actions/upload-artifact@v4) consistent with the rest of the workflow files in this repo.
This commit is contained in:
parent
9bd7deb086
commit
6558f4b737
1 changed files with 62 additions and 0 deletions
62
.github/workflows/e2e.yml
vendored
Normal file
62
.github/workflows/e2e.yml
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
name: E2E
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
paths:
|
||||
- "server/**"
|
||||
- ".github/workflows/e2e.yml"
|
||||
- "server/playwright.config.ts"
|
||||
pull_request:
|
||||
branches: [develop]
|
||||
paths:
|
||||
- "server/**"
|
||||
- ".github/workflows/e2e.yml"
|
||||
- "server/playwright.config.ts"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
name: Playwright E2E
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: server
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libpng-dev
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: "22.16.0"
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# Playwright config sets webServer.command = "pnpm dev", so the
|
||||
# dev server is auto-spawned. No explicit start needed.
|
||||
- name: Install Playwright browsers
|
||||
run: pnpm exec playwright install --with-deps chromium
|
||||
|
||||
- name: Run E2E tests
|
||||
run: pnpm run test:e2e
|
||||
|
||||
- name: Upload Playwright report on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@5d5d0a4aa1ee7b0aef45891cd63f31b86a3e3514 # v4
|
||||
with:
|
||||
name: playwright-report
|
||||
path: server/playwright-report/
|
||||
retention-days: 7
|
||||
Loading…
Add table
Add a link
Reference in a new issue