chore(deps): bump actions/setup-node from 4 to 6 #32
Workflow file for this run
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
| # ============================================================================= | |
| # Playwright Tests — functional + pixel-by-pixel visual regression. | |
| # | |
| # BASELINE STRATEGY (macOS dev vs. Linux CI): | |
| # Rendering differs between operating systems, so visual baselines are | |
| # platform-suffixed (see `snapshotPathTemplate` in playwright.config.ts: | |
| # `...-{projectName}-{platform}{ext}`). Locally on macOS you generate | |
| # `-darwin` snapshots; they are NOT the source of truth for CI. | |
| # | |
| # The authoritative `-linux` baselines are generated and committed by THIS | |
| # workflow, inside the official Playwright container, so they always match | |
| # the CI renderer exactly: | |
| # * push to main / manual dispatch -> regenerate Linux baselines with | |
| # `--update-snapshots`, then commit any changes under the snapshots dir. | |
| # * pull_request -> strict compare against the committed Linux baselines | |
| # (no updating); a real visual diff fails the build. | |
| # | |
| # The container image is pinned to the installed @playwright/test version | |
| # (1.61.1) so the browser binaries and the test runner stay in lockstep. | |
| # ============================================================================= | |
| name: Playwright Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| # Needed so the push-to-main job can commit regenerated Linux baselines. | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.61.1-jammy | |
| env: | |
| # The Playwright container expects HOME=/root; some Actions runners unset it. | |
| HOME: /root | |
| CI: 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: npm ci | |
| # ---- Pull requests: strict compare against committed Linux baselines ---- | |
| - name: Run Playwright tests (PR — strict compare) | |
| if: github.event_name == 'pull_request' | |
| run: npx playwright test | |
| # ---- Push to main / manual: (re)generate and commit Linux baselines ---- | |
| - name: Run Playwright tests (update Linux baselines) | |
| if: github.event_name != 'pull_request' | |
| run: npx playwright test --update-snapshots | |
| - name: Commit updated baselines | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| # Mark the checkout as a safe dir before any git command; the | |
| # Playwright container runs as root while the checkout is runner-owned. | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if [ -n "$(git status --porcelain tests)" ]; then | |
| git add tests/__screenshots__ | |
| if ! git diff --cached --quiet; then | |
| git commit -m "chore: update visual baselines [skip ci]" | |
| git push "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:${{ github.ref_name }} | |
| else | |
| echo "No screenshot changes staged; nothing to commit." | |
| fi | |
| else | |
| echo "No baseline changes detected." | |
| fi | |
| # ---- Always publish the report + raw results for inspection ---- | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 14 | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: test-results/ | |
| retention-days: 14 |