Skip to content

Commit

Permalink
Fix Storybook tests on CI aborts early
Browse files Browse the repository at this point in the history
  • Loading branch information
pocka committed Aug 30, 2024
1 parent c366899 commit 3a15d06
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,39 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4

test-storybook:
test-player-storybook:
needs:
- build-player-storybook
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download built Storybook
uses: actions/download-artifact@v4
with:
path: "storybook-static"
name: "player-storybook"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: "1.1"
# Needs Node.js since bunx is not compatible with npx
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install dependencies
run: "bun i"
- name: Setup Playwright
run: "npx playwright install --with-deps"
- name: Run tests
run: |
npx concurrently -k -s first -n "SB,TEST" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:6006 && bun run test:storybook/player --browsers chromium,firefox,webkit"
test-builder-storybook:
needs:
- build-builder-storybook
runs-on: ubuntu-latest
steps:
Expand All @@ -160,7 +190,8 @@ jobs:
- name: Download built Storybook
uses: actions/download-artifact@v4
with:
pattern: "*-storybook"
path: "storybook-static"
name: "builder-storybook"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
Expand All @@ -176,10 +207,8 @@ jobs:
run: "npx playwright install --with-deps"
- name: Run tests
run: |
npx concurrently -k -s first -n "SB_PLAYER,SB_BUILDER,TEST_PLAYER,TEST_BUILDER" \
"npx http-server player-storybook --port 6006 --silent" \
"npx http-server builder-storybook --port 6007 --silent" \
"npx wait-on tcp:6006 && bun run test:storybook/player --browsers chromium,firefox,webkit" \
npx concurrently -k -s first -n "SB,TEST" \
"npx http-server storybook-static --port 6007 --silent" \
"npx wait-on tcp:6007 && bun run test:storybook/builder --browsers chromium,firefox,webkit"
cleanup:
Expand Down

0 comments on commit 3a15d06

Please sign in to comment.