Skip to content
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: fix storybook build action #703

Merged
merged 4 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: pnpm
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'

- name: Prepare deps
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ jobs:
with:
name: base__image-snapshots__
path: __image_snapshots__/
- name: Verify Storybook server can start
run: |
pnpm http-server storybook-static --port 6006 --silent &
PID=$!
pnpm wait-on -t 60000 tcp:127.0.0.1:6006
kill $PID
- name: Serve Storybook and run tests
if: steps.label-checking.outputs.result != 'true'
run: pnpm test:image-snapshot
run: pnpm test:image-snapshot:ci
- name: Serve Storybook and take new image snapshots
if: steps.label-checking.outputs.result == 'true'
run: pnpm test:image-snapshot --updateSnapshot
run: pnpm test:image-snapshot:ci --updateSnapshot
- name: Archive image snapshot diffs
uses: actions/upload-artifact@v4
if: failure() && steps.label-checking.outputs.result != 'true'
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"build": "pnpm -r --sort --workspace-concurrency=Infinite --stream run build",
"clean": "pnpm -r --workspace-concurrency=Infinity --stream run clean",
"test": "vitest",
"test:image-snapshot": "TEST_RUNNER=vrt concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on tcp:127.0.0.1:6006 && test-storybook ${*}\"",
"test:a11y": "TEST_RUNNER=a11y concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on tcp:127.0.0.1:6006 && test-storybook ${*}\"",
"test:image-snapshot": "TEST_RUNNER=vrt concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on -t 30000 tcp:127.0.0.1:6006 && test-storybook --maxWorkers=2 ${*}\"",
"test:image-snapshot:ci": "TEST_RUNNER=vrt concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on -t 60000 tcp:127.0.0.1:6006 && test-storybook --maxWorkers=1 --timeout=60000 ${*}\"",
"test:a11y": "TEST_RUNNER=a11y concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on -t 30000 tcp:127.0.0.1:6006 && test-storybook ${*}\"",
"typecheck": "pnpm recursive run typecheck",
"typecheck:config": "tsc",
"lint": "run-p 'lint:*'",
Expand Down
Loading