skillhub/.github/workflows/pr-e2e.yml
dongmucat 50a6c4b7fe test(e2e,ci): migrate web e2e to real API and add PR e2e workflow (#198)
* chore(workflow): align local hooks and e2e guidance

* test(e2e): expand reusable api mock helpers

* test(skill): stabilize share button e2e assertions

* chore(test): add e2e make target and tune playwright workers

* test(web): expand e2e coverage and smoke suite

* test(e2e): migrate to real API flows and add request-based data builder

* ci(e2e): add PR workflow for real-service frontend e2e

* ci(e2e): install playwright chromium in PR workflow

* test(e2e): relax timeout and force single worker in CI

* test(e2e): stabilize not-found assertions and harden CI session bootstrap

* chore(agents): align tester role with web/e2e workflow
2026-04-01 14:41:23 +08:00

89 lines
2.1 KiB
YAML

name: PR E2E Tests
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
paths:
- 'web/**'
- 'server/**'
- 'scripts/**'
- 'docker-compose.yml'
- 'docker-compose.staging.yml'
- 'Makefile'
- '.github/workflows/pr-e2e.yml'
workflow_dispatch:
concurrency:
group: pr-e2e-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
e2e-tests:
name: E2E (Real Services)
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Ensure Maven wrapper is executable
run: chmod +x server/mvnw
- name: Start full dev stack
run: make dev-all
- name: Install Playwright browsers
run: cd web && pnpm exec playwright install --with-deps chromium
- name: Run frontend E2E tests
run: make test-e2e-frontend
- name: Upload Playwright HTML report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: web/playwright-report/
if-no-files-found: warn
retention-days: 30
- name: Upload Playwright raw test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-test-results
path: web/test-results/
if-no-files-found: warn
retention-days: 14
- name: Stop full dev stack
if: ${{ always() }}
run: make dev-all-down