From 66ddb7eec961005b73c3ce54f1cc9eb31676e8f6 Mon Sep 17 00:00:00 2001 From: naporin0624 Date: Wed, 26 Feb 2025 11:06:28 +0000 Subject: [PATCH 1/4] chore: fix storybook build action --- .github/workflows/gh-pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index d864a7ca8..12609a842 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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: | From 942461e29aba180fd4281d6568d921cbc81d466b Mon Sep 17 00:00:00 2001 From: naporin0624 Date: Wed, 5 Mar 2025 06:35:37 +0000 Subject: [PATCH 2/4] ci: fix Storybook test runner issues by adding timeout and limiting workers --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a554ac512..156c93e74 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "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: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:*'", From 444870df0dfb63be3a2db2607081f1d557459ae7 Mon Sep 17 00:00:00 2001 From: naporin0624 Date: Wed, 5 Mar 2025 06:41:45 +0000 Subject: [PATCH 3/4] ci: enhance Storybook test stability in CI environment --- .github/workflows/test-storybook.yml | 14 ++++++++++++-- package.json | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-storybook.yml b/.github/workflows/test-storybook.yml index f8354c2c2..d1fced26a 100644 --- a/.github/workflows/test-storybook.yml +++ b/.github/workflows/test-storybook.yml @@ -122,12 +122,22 @@ 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 + env: + DEBUG_PRINT_LIMIT: 10000 - 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 + env: + DEBUG_PRINT_LIMIT: 10000 - name: Archive image snapshot diffs uses: actions/upload-artifact@v4 if: failure() && steps.label-checking.outputs.result != 'true' diff --git a/package.json b/package.json index 156c93e74..47cf3f247 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "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 -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", From 5ebbe880d97e3527cf16a5d9d3f9ad8e57cd99ff Mon Sep 17 00:00:00 2001 From: naporin0624 Date: Wed, 5 Mar 2025 07:01:30 +0000 Subject: [PATCH 4/4] ci: remove DEBUG_PRINT_LIMIT from test-storybook workflow --- .github/workflows/test-storybook.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-storybook.yml b/.github/workflows/test-storybook.yml index d1fced26a..96784f73e 100644 --- a/.github/workflows/test-storybook.yml +++ b/.github/workflows/test-storybook.yml @@ -131,13 +131,9 @@ jobs: - name: Serve Storybook and run tests if: steps.label-checking.outputs.result != 'true' run: pnpm test:image-snapshot:ci - env: - DEBUG_PRINT_LIMIT: 10000 - name: Serve Storybook and take new image snapshots if: steps.label-checking.outputs.result == 'true' run: pnpm test:image-snapshot:ci --updateSnapshot - env: - DEBUG_PRINT_LIMIT: 10000 - name: Archive image snapshot diffs uses: actions/upload-artifact@v4 if: failure() && steps.label-checking.outputs.result != 'true'