w3bdesign/dfweb-v4

View on GitHub
.github/workflows/playwright.yml

Summary

Maintainability
Test Coverage
name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: pnpm/action-setup@v2
      with:
        version: 9
    - uses: actions/setup-node@v4
      with:
        node-version: 20
        cache: 'pnpm'
    - name: Install dependencies
      run: pnpm install
    - name: Install Playwright Browsers
      run: pnpm exec playwright install --with-deps chromium firefox
    - name: Build the project
      run: pnpm build
    - name: Start the application
      run: pnpm start &
    - name: Wait for the application to be ready
      run: |
        npx wait-on http://localhost:3000
    - name: Run Playwright tests
      run: pnpm exec playwright test
    - uses: actions/upload-artifact@v4
      if: always()
      with:
        name: playwright-report
        path: playwright-report/
        retention-days: 30