Skip to content

feat: implement React Query caching strategy #8

feat: implement React Query caching strategy

feat: implement React Query caching strategy #8

name: Visual Regression

Check failure on line 1 in .github/workflows/visual-regression.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/visual-regression.yml

Invalid workflow file

(Line: 14, Col: 9): Unrecognized named-value: 'secrets'. Located at position 27 within expression: vars.PERCY_TOKEN != '' || secrets.PERCY_TOKEN != ''
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
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}