phpMyFAQ Nightly E2E Tests #29
This file contains hidden or 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
| name: "phpMyFAQ Nightly E2E Tests" | |
| # Runs the Playwright end-to-end suite against a freshly installed and seeded | |
| # instance (bilingual DE + EN test data). Uses the lightweight php -S + SQLite | |
| # path for speed; the same suite can be run locally against Docker/MariaDB via | |
| # `bin/e2e docker`. | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 3 * * *' | |
| jobs: | |
| e2e: | |
| runs-on: ubuntu-latest | |
| # Fail fast instead of burning up to GitHub's 6h cap if a step hangs. | |
| timeout-minutes: 30 | |
| # Suppress the interactive needrestart prompt that otherwise hangs | |
| # `playwright install --with-deps` (sudo apt-get) forever on Ubuntu runners. | |
| # DEBIAN_FRONTEND survives sudo via the runner's env_keep; NEEDRESTART_MODE=a | |
| # auto-restarts services without prompting. | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| NEEDRESTART_MODE: a | |
| NEEDRESTART_SUSPEND: 1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ['8.4'] | |
| name: Playwright E2E (PHP ${{ matrix.php-versions }}, php -S + SQLite) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.0 | |
| with: | |
| # This workflow only reads the repo; it never pushes. | |
| persist-credentials: false | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, curl, fileinfo, filter, gd, json, zip, xml, sqlite3, pdo_sqlite, intl | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install PHP dependencies | |
| run: composer install --no-progress --prefer-dist | |
| - name: Setup Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version: 24.x | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6.0.9 | |
| with: | |
| version: 8.15.5 | |
| run_install: false | |
| - name: Install JS dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build assets | |
| run: pnpm build | |
| - name: Install Playwright browser | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Run end-to-end tests | |
| run: ./bin/e2e local | |
| - name: Upload Playwright report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-report-php${{ matrix.php-versions }} | |
| path: playwright-report/ | |
| retention-days: 14 | |
| - name: Upload test results (traces, screenshots, videos) | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: playwright-test-results-php${{ matrix.php-versions }} | |
| path: test-results/ | |
| retention-days: 14 |