Files
kandev/.github/workflows/e2e-tests.yml
T

133 lines
3.2 KiB
YAML

name: E2E Tests
on:
push:
branches: [main]
paths:
- "apps/backend/**"
- "apps/web/**"
- "apps/packages/**"
- "apps/pnpm-lock.yaml"
- ".github/workflows/e2e-tests.yml"
- "!**/*.md"
pull_request:
branches: [main]
paths:
- "apps/backend/**"
- "apps/web/**"
- "apps/packages/**"
- "apps/pnpm-lock.yaml"
- ".github/workflows/e2e-tests.yml"
- "!**/*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
e2e:
name: E2E Shard ${{ matrix.shard }}/4
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: apps/backend/go.mod
cache-dependency-path: apps/backend/go.sum
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: "9"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Install dependencies
working-directory: apps
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
working-directory: apps/web
run: npx playwright install chromium --with-deps
- name: Build backend and web
run: make build-backend build-web
- name: Run E2E tests (shard ${{ matrix.shard }}/4)
working-directory: apps/web
run: npx playwright test --config e2e/playwright.config.ts --shard=${{ matrix.shard }}/4
- name: Upload blob report
if: always()
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shard }}
path: apps/web/e2e/blob-report/
retention-days: 3
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.shard }}
path: apps/web/e2e/test-results/
retention-days: 7
e2e-report:
name: Merge E2E Reports
needs: e2e
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
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@v6
with:
node-version: "24"
- name: Install dependencies
working-directory: apps
run: pnpm install --frozen-lockfile
- name: Download blob reports
uses: actions/download-artifact@v4
with:
path: apps/web/e2e/blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge reports
working-directory: apps/web
run: npx playwright merge-reports --reporter=html ./e2e/blob-reports
- name: Upload merged report
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/web/playwright-report/
retention-days: 14