test: temporarily enable debug #219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions workflow for running Playwright end-to-end tests | |
# Features: | |
# - Automated testing on push/PR | |
# - Environment setup | |
# - Test execution | |
# - Results reporting | |
# - Deployment trigger | |
# | |
# By Dulapah Vibulsanti (https://dulapahv.dev) | |
name: 🎭 Playwright Tests | |
permissions: | |
contents: read | |
actions: write | |
checks: write | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
jobs: | |
test: | |
name: 🧪 Run E2E Tests | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
SENTRY_SUPPRESS_TURBOPACK_WARNING: 1 | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
BETTERSTACK_API_KEY: ${{ secrets.BETTERSTACK_API_KEY }} | |
steps: | |
# Checkout code | |
- name: 📥 Checkout code | |
uses: actions/checkout@v4 | |
# Install pnpm | |
- name: 📦 Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | |
# Setup Node.js | |
- name: 🔧 Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
# Turbo cache | |
- name: 💾 Cache Turbo | |
id: turbo-cache | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
# Next.js cache | |
- name: 💾 Cache Next.js bundle | |
id: nextjs-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.pnpm-store | |
${{ github.workspace }}/apps/client/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('apps/client/src/**/*.{js,jsx,ts,tsx}') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
${{ runner.os }}-nextjs- | |
# Playwright browsers cache | |
- name: 💾 Cache Playwright browsers | |
id: cache-playwright | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-playwright- | |
# Install dependencies | |
- name: 🏗️ Install dependencies | |
run: pnpm install | |
# Build packages | |
- name: 🔨 Build packages | |
run: pnpm build | |
# Install Playwright browsers | |
- name: 🎭 Install Playwright browsers | |
if: steps.cache-playwright.outputs.cache-hit != 'true' | |
run: pnpm --filter client exec playwright install --with-deps | |
# Run Playwright tests | |
- name: 🧪 Run Playwright tests | |
run: pnpm test:client | |
# Upload test results | |
- name: 📊 Upload test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: playwright-report | |
path: | | |
apps/client/playwright-report/ | |
apps/client/test-results.xml | |
retention-days: 30 | |
# Upload test screenshots on failure | |
- name: 📸 Upload test screenshots | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: playwright-screenshots | |
path: apps/client/test-results/ | |
retention-days: 30 | |
# Trigger Vercel deployment if tests pass | |
- name: 🚀 Trigger Vercel Deployment | |
if: success() && github.ref == 'refs/heads/main' | |
run: | | |
curl -X POST "${{ secrets.VERCEL_DEPLOY_HOOK }}" |