Skip to content

Commit

Permalink
test: add visual regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ssssota committed May 4, 2024
1 parent 22ddcb4 commit 87a4eec
Show file tree
Hide file tree
Showing 7 changed files with 2,935 additions and 2,298 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/vrt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: npx playwright install --with-deps
- run: pnpm test
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.svelte-kit
/site/build
test-results
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"build": "tsx scripts/build.ts && tsc",
"lint": "prettier --check .",
"fmt": "prettier --write .",
"test": "pnpm -r test",
"changeset": "changeset",
"release": "pnpm build && pnpm changeset publish"
},
Expand All @@ -42,7 +43,7 @@
"url": "https://github.com/ssssota/svelte-twc/issues"
},
"homepage": "https://github.com/ssssota/svelte-twc#readme",
"packageManager": "pnpm@8.15.6",
"packageManager": "pnpm@9.0.6",
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
Expand Down
Loading

0 comments on commit 87a4eec

Please sign in to comment.