Skip to content

Merge branch 'main' into perf/optimize-contract-storage-access #11

Merge branch 'main' into perf/optimize-contract-storage-access

Merge branch 'main' into perf/optimize-contract-storage-access #11

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: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