Skip to content

Commit

Permalink
Merge pull request #703 from pixiv/fix/github-actions-storybook-build
Browse files Browse the repository at this point in the history
chore: fix storybook build action
  • Loading branch information
naporin0624 authored Mar 5, 2025
2 parents 859e48a + 5ebbe88 commit b4ca5f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
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

0 comments on commit b4ca5f1

Please sign in to comment.