Skip to content

Commit

Permalink
ci: test-storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
shanexi committed Sep 19, 2024
1 parent f5e7139 commit 97b7e31
Show file tree
Hide file tree
Showing 4 changed files with 2,417 additions and 187 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/storybook-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Storybook Tests"

on:
push:
paths:
- "web/apps/web/**"
- "web/packages/**"
- ".github/**"
pull_request:
paths:
- "web/apps/web/**"
- "web/packages/**"
- ".github/**"

jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
env:
CYPRESS_INSTALL_BINARY: "0"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 9
run_install: false

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: "web/pnpm-lock.yaml"

- run: npm install concurrently http-server wait-on -g

- working-directory: ./web
run: pnpm install

- working-directory: ./web
run: |
pnpm turbo run build-storybook --filter=storybook
- working-directory: ./web/apps/storybook
run: ./node_modules/.bin/playwright install --with-deps chromium

- working-directory: ./web/apps/storybook
run: |
concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "http-server storybook-static --port 6006 --silent" "wait-on tcp:6006 && ./node_modules/.bin/test-storybook"
2 changes: 2 additions & 0 deletions web/apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"@storybook/nextjs": "^8.3.1",
"@storybook/react": "^8.3.1",
"@storybook/test": "^8.3.1",
"@storybook/test-runner": "^0.19.1",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.12",
"eslint-plugin-storybook": "^0.8.0",
"playwright": "^1.47.1",
"postcss": "^8",
"storybook": "^8.3.1",
"tailwindcss": "^3.4.1",
Expand Down
Loading

0 comments on commit 97b7e31

Please sign in to comment.