Skip to content

Commit

Permalink
Init visual regression, skip inconsistent and broken stories
Browse files Browse the repository at this point in the history
  • Loading branch information
juliewongbandue committed Jul 31, 2023
1 parent 294fcb6 commit eb3d6ca
Show file tree
Hide file tree
Showing 277 changed files with 710 additions and 22 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
version: 7.26.3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 16

- uses: actions/cache@v3
name: Setup pnpm cache
Expand All @@ -119,3 +119,35 @@ jobs:

- run: pnpm i --frozen-lockfile
- run: pnpm jest

visual-regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.26.3
- uses: actions/setup-node@v3
with:
node-version: 16

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
.pnpm-store
pnpm
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}

- run: pnpm i --frozen-lockfile
- run: pnpm build-storybook

- name: Lost Pixel
uses: lost-pixel/[email protected]

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: lost-pixel-artifacts
path: ./lost-pixel
2 changes: 2 additions & 0 deletions lost-pixel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
current
difference
Binary file added lost-pixel/baseline/color-accent--all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--amethyst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--cerise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--cerulean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--fuschia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--lapis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--peridot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--taupe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-accent--vermilion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--grayscale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--slate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/color-system--yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/components-avatar--avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/components-avatar--size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/components-badge--badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lost-pixel/baseline/components-button--button.png
Binary file added lost-pixel/baseline/components-card--card.png
Binary file added lost-pixel/baseline/components-grid--grid.png
Binary file added lost-pixel/baseline/components-input--input.png
Binary file added lost-pixel/baseline/components-menu--menu.png
Binary file added lost-pixel/baseline/components-modal--modal.png
Binary file added lost-pixel/baseline/components-notice--notice.png
Binary file added lost-pixel/baseline/components-path--path.png
Binary file added lost-pixel/baseline/components-radio--radio.png
Binary file added lost-pixel/baseline/components-ribbon--ribbon.png
Binary file added lost-pixel/baseline/components-select--select.png
Binary file added lost-pixel/baseline/components-slider--slider.png
Binary file added lost-pixel/baseline/components-tag--on-close.png
Binary file added lost-pixel/baseline/components-tag--size.png
Binary file added lost-pixel/baseline/components-tag--src.png
Binary file added lost-pixel/baseline/components-tag--tag.png
Binary file added lost-pixel/baseline/components-tip--tip.png
Binary file added lost-pixel/baseline/components-toggle--toggle.png
Binary file added lost-pixel/baseline/icons-icons--all.png
Binary file added lost-pixel/baseline/icons-icons--brand.png
Binary file added lost-pixel/baseline/icons-icons--media.png
Binary file added lost-pixel/baseline/icons-icons--payment.png
Binary file added lost-pixel/baseline/icons-icons--social.png
Binary file added lost-pixel/baseline/icons-icons--ui.png
Binary file added lost-pixel/baseline/icons-icons--vimeo.png
Binary file added lost-pixel/baseline/labs-pronouns--comments.png
Binary file added lost-pixel/baseline/labs-pronouns--video-list.png
Binary file added lost-pixel/baseline/labs-themekit--common.png
Binary file added lost-pixel/baseline/themes-theme--common.png
Binary file added lost-pixel/baseline/tokens-color--format.png
Binary file added lost-pixel/baseline/tokens-color--livestream.png
Binary file added lost-pixel/baseline/tokens-color--rainbow.png
Binary file added lost-pixel/baseline/tokens-color--status.png
Binary file added lost-pixel/baseline/tokens-color--stroke.png
Binary file added lost-pixel/baseline/tokens-color--surface.png
Binary file added lost-pixel/baseline/tokens-color--text.png
Binary file added lost-pixel/baseline/tokens-color--upsell.png
Binary file added lost-pixel/baseline/tokens-edge--edge.png
Binary file added lost-pixel/baseline/tokens-space--space.png
Binary file added lost-pixel/baseline/tokens-typography--size.png
Binary file added lost-pixel/baseline/typography-header--header.png
Binary file added lost-pixel/baseline/typography-link--link.png
Binary file added lost-pixel/baseline/typography-meta--meta.png
Binary file added lost-pixel/baseline/typography-text--text.png
15 changes: 15 additions & 0 deletions lostpixel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CustomProjectConfig } from 'lost-pixel';

// https://docs.lost-pixel.com/user-docs/api-reference/lost-pixel.config.js-or-ts
export const config: CustomProjectConfig = {
browser: 'chromium',
storybookShots: {
storybookUrl: './storybook-static',
},
threshold: 3,
imagePathBaseline: './lost-pixel/baseline',
imagePathCurrent: './lost-pixel/current',
imagePathDifference: './lost-pixel/difference',
generateOnly: true,
failOnDifference: true,
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"framer-motion": "^6.5.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lost-pixel": "^3.4.1",
"polished": "^4.2.2",
"pre-commit": "^1.2.2",
"prettier": "^2.8.8",
Expand Down
Loading

0 comments on commit eb3d6ca

Please sign in to comment.