This directory contains GitHub Actions workflows for automated testing and deployment.
Runs end-to-end tests using Playwright on every push and pull request.
Features:
- ✅ Headless execution in CI environment
- ✅ Virtual display setup for Linux runners (Xvfb)
- ✅ Browser caching to speed up test runs
- ✅ Test artifacts upload on failure
- ✅ PR status reports with detailed results
- ✅ Concurrent run prevention to avoid conflicts
- ✅ Chrome-only execution (as per project requirements)
Triggers:
- Push to
main
ormaster
branches - Pull requests to
main
ormaster
branches - Manual workflow dispatch with optional commit SHA
Environment:
- Platform: Ubuntu Latest (cost-efficient)
- Browser: Chrome (headless mode)
- Display: Virtual display via Xvfb
- Timeout: 15 minutes
Test Flow:
- Checkout code and setup Node.js
- Install dependencies with npm cache
- Install Playwright browsers with system dependencies
- Configure virtual display for headless execution
- Build Next.js application
- Start server on random port (20000-30000)
- Run Playwright tests with data-testid selectors
- Upload test results and reports on failure
- Report status to PR with detailed summary
Reusable action for setting up Playwright with optimal caching and system dependencies.
Inputs:
working-directory
: Working directory (default: ".")browsers
: Browsers to install (default: "chromium")
Features:
- Browser caching based on package-lock.json hash
- Automatic system dependency installation on Linux
- Support for multiple browser types
-
Caching Strategy:
- Playwright browsers cached by package-lock.json hash
- npm dependencies cached by Node.js action
-
Resource Optimization:
- Chrome-only execution (per user requirements)
- Ubuntu-only for cost efficiency
- Concurrent run prevention
-
Reliability:
- Virtual display (Xvfb) for stable headless execution
- Proper timeout handling (15 minutes)
- Artifact retention for debugging
-
Reporting:
- Detailed PR comments with test results
- Job summaries with status tables
- Artifact uploads for failed tests
-
Security:
- Minimal permissions (read, checks, PR comments)
- No secrets required for basic functionality
- Controlled concurrent execution
The workflow runs automatically on pushes and PRs. For manual execution:
gh workflow run playwright.yml
Or with a specific commit:
gh workflow run playwright.yml -f commit_sha=abc123
To add more platforms or browsers:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
To test with multiple browsers:
- name: Setup Playwright
uses: ./.github/actions/setup-playwright
with:
browsers: chromium firefox webkit