Skip to content

add update snapshot worklfow #2

add update snapshot worklfow

add update snapshot worklfow #2

Workflow file for this run

name: Update-snaphots

Check failure on line 1 in .github/workflows/update-snaphots.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-snaphots.yml

Invalid workflow file

`workflow-dispatch` is not a valid event name
on:
workflow-dispatch:
jobs:
update-snaphots:
name: Update Visual Tests snaphots
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js from .nvmrc file
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build
run: npm run build
- name: Visual regression tests
run: npm run test:visual -- --update-snapshots
- name: Copy modified snapshots
run: |
git ls-files --other --modified --exclude-standard | grep '^test-components/__snapshots__/' | while IFS= read -r file; do
mkdir -p "updated_snapshots/$(dirname "$file")"
cp "$file" "updated_snapshots/$file"
done
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: snapshots
path: updated_snapshots/
retention-days: 20