Merge branch 'main' into perf/react-query-caching-strategy #9
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: Visual Regression | ||
|
Check failure on line 1 in .github/workflows/visual-regression.yml
|
||
| on: | ||
| pull_request: | ||
| branches: [main, develop] | ||
| push: | ||
| branches: [main] | ||
| jobs: | ||
| visual: | ||
| name: Percy Visual Snapshots | ||
| runs-on: ubuntu-latest | ||
| # Only run when PERCY_TOKEN is available (skip on forks without the secret) | ||
| if: ${{ vars.PERCY_TOKEN != '' || secrets.PERCY_TOKEN != '' }} | ||
| defaults: | ||
| run: | ||
| working-directory: frontend | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| # Percy needs full git history to associate snapshots with commits | ||
| fetch-depth: 0 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: frontend/package-lock.json | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Install Playwright browsers | ||
| run: npx playwright install chromium --with-deps | ||
| - name: Build frontend | ||
| run: npm run build | ||
| - name: Run Percy visual snapshots | ||
| run: npm run test:visual:ci | ||
| env: | ||
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
| - name: Upload Playwright artifacts on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: visual-test-results | ||
| path: frontend/test-results/ | ||
| retention-days: 7 | ||