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 92c1838
Showing 1 changed file with 39 additions and 8 deletions.
47 changes: 39 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ jobs:
needs:
- check
- prep-artifact-for-pages
- test-storybook
- test-player-storybook
- test-builder-storybook
permissions:
pages: write
id-token: write
Expand All @@ -149,9 +150,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 +191,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,16 +208,15 @@ 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:
needs:
- deploy
- test-storybook
- test-builder-storybook
- test-player-storybook
runs-on: ubuntu-latest
steps:
- name: Delete artifacts
Expand Down

0 comments on commit 92c1838

Please sign in to comment.