-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: 🤖 Introduce VRT #41
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: reg-suit | ||
|
||
on: push | ||
|
||
jobs: | ||
visual-regression-test: | ||
name: Visual Regression Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
container: | ||
image: regviz/node-xcb | ||
env: | ||
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 | ||
GITHUB_WORKSPACE: /home/runner/work/ubie-oss/ubie-ui | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: /home/runner/work/ubie-oss/ubie-ui | ||
|
||
- uses: ./actions/setup-node-and-install-deps | ||
|
||
- name: Installing Chrome via Puppeteer | ||
run: node ./node_modules/puppeteer/install.js | ||
|
||
- name: Build | ||
if: success() | ||
run: npm run build | ||
|
||
# https://github.com/reg-viz/reg-suit/tree/master?tab=readme-ov-file#workaround-for-detached-head | ||
- name: workaround for detached HEAD | ||
run: | | ||
git config --global --add safe.directory /__w/ubie-oss/ubie-ui | ||
git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull | ||
|
||
- name: Capture screen shots | ||
run: npm run screenshot | ||
|
||
- name: Run reg-suit | ||
run: npm run regression | ||
|
||
env: | ||
# TODO: Set your service account key | ||
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }} | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import '@ubie/design-tokens/dist/tokens.css'; | ||
import type { Parameters, Decorator } from '@storybook/react'; | ||
import { withScreenshot, isScreenshot } from 'storycap'; | ||
|
||
export const decorators: Decorator[] = [ | ||
// https://github.com/reg-viz/storycap/issues/810 | ||
withScreenshot(), | ||
// https://github.com/reg-viz/storycap/issues/464 | ||
(StoryFn) => { | ||
Comment on lines
+5
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The workarounds I already know. |
||
if (isScreenshot()) { | ||
function addStyle(styleString: string) { | ||
const style = document.createElement('style'); | ||
style.textContent = styleString; | ||
document.head.append(style); | ||
} | ||
addStyle(` | ||
*, | ||
*::before, | ||
*::after { | ||
transition: none !important; | ||
animation: none !important; | ||
} | ||
input { | ||
caret-color: transparent !important; | ||
} | ||
`); | ||
} | ||
return StoryFn(); | ||
}, | ||
]; | ||
|
||
export const parameters: Parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
screenshot: { | ||
// TODO: スクリーンしショットをしたいデバイスがあれば指定する | ||
// viewport: 'iPhone X', | ||
}, | ||
Comment on lines
+40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have any preference. |
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the service account key for the cloud storage access.