Workflow file for this run
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: 'Storybook Tests' | |
on: | |
workflow_call: | |
inputs: | |
node-version: | |
required: true | |
type: string | |
jobs: | |
test: | |
defaults: | |
run: | |
working-directory: ui | |
shell: bash | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ inputs.node-version }} | |
- name: install deps | |
uses: ./.github/actions/cached-ui-deps | |
with: | |
node-version: ${{ inputs.node-version }} | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Build Storybook | |
run: yarn build-storybook --quiet | |
- name: Serve Storybook and run tests | |
run: | | |
npx concurrently --kill-others --success first -n "SB,TEST" \ | |
"npx http-server storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && yarn test-storybook -u" | |
- name: Push updated screenshots | |
uses: actions/checkout@v4 | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add \*.png | |
git commit -m "update screenshots [skip ci]" | |
git push | |
- uses: actions/upload-artifact@v4 | |
name: 'Upload test report' | |
if: ${{ failure() }} | |
with: | |
name: storybook-tests-report | |
path: ui/test-reports/ |