Merge pull request #1435 from Wizleap-Inc/changeset-release/main #2732
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Visual Regression Test Wiz-UI library | |
on: [push] | |
env: | |
REG_NOTICE_CLIENT_ID: ${{ secrets.REG_NOTICE_CLIENT_ID }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: 📥 Monorepo install | |
uses: ./.github/composite/prepare_node | |
- name: Install fonts | |
run: sudo apt-get install fonts-ipafont-gothic fonts-ipafont-mincho | |
- name: workaround for detached HEAD | |
run: | | |
git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "::set-output name=version::$(pnpm list playwright | grep playwright | sed 's/.*@//' | tail -1)" | |
- uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: "~/.cache/ms-playwright" | |
key: "${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}" | |
restore-keys: | | |
${{ runner.os }}-playwright- | |
- name: Install Playwright's dependencies | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: run storybook generate | |
run: pnpm storybook:build | |
- name: run storycap | |
run: pnpm storycap | |
- name: hoist screenshots | |
run: | | |
mkdir -p __screenshots__ | |
for dir in ./packages/*/; do | |
if [ -d "$dir"__screenshots__ ]; then | |
package_name=$(basename "$dir") | |
mkdir -p __screenshots__/"$package_name" | |
cp -r "$dir"__screenshots__/* __screenshots__/"$package_name/" | |
fi | |
done | |
- name: run reg-suit | |
run: pnpm vrt |