Skip to content

test: add visual regression test #3

test: add visual regression test

test: add visual regression test #3

Workflow file for this run

name: VRT
on:
push:
branches:
- main
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm build
- run: |
npx playwright install --with-deps
npx playwright test
working-directory: site
update-snapshot:
needs: [check]
runs-on: ubuntu-latest
defaults:
run:
working-directory: site
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: npx playwright install --with-deps
- run: npx playwright test --update-snapshots
- run: gi add -N .; git diff --name-only --exit-code
id: git-diff
continue-on-error: true
- if: steps.git-diff.outcome == 'failure'
run: |
set -x
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "chore: update snapshots"
git pull --rebase
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}