Skip to content

Commit

Permalink
Merge pull request #4 from bartstc/basic-storybook-ci
Browse files Browse the repository at this point in the history
CI - update storybook flow for basic
  • Loading branch information
bartstc authored Oct 21, 2023
2 parents 4926350 + 0b8fad8 commit 47fee63
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:

storybook-tests:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.35.0-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -35,6 +33,12 @@ jobs:
version: 8
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "pnpm"

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
Expand All @@ -52,8 +56,17 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile --ignore-scripts

- name: Run storybook tests
run: pnpm test-storybook:ci
- name: Install Playwright
run: npx playwright install --with-deps

- name: Build Storybook
run: pnpm build-storybook --quiet

- name: Serve Storybook and run tests
run: |
pnpm exec concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"pnpm exec http-server storybook-static --port 6006 --silent" \
"pnpm exec wait-on tcp:6006 && pnpm exec test-storybook --json --outputFile storybook-report.json a"
- name: Upload json report artifacts
uses: actions/upload-artifact@v3
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
"lint": "CI=true eslint --ignore-pattern '*.d.ts' --ignore-pattern '*.test.*' --ext ts,tsx --max-warnings 0 src",
"prepare": "husky install",
"storybook": "storybook dev -p 6006",
"storybook-latest-node": "export NODE_OPTIONS=--openssl-legacy-provider; storybook dev -p 6006",
"test-storybook": "pnpm exec test-storybook --watch",
"build-storybook": "storybook build",
"preview-storybook": "http-server storybook-static --port 6006 --silent",
"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"pnpm build-storybook --quiet && pnpm preview-storybook\" \"wait-on tcp:127.0.0.1:6006 && pnpm exec test-storybook --json --outputFile storybook-report.json a\""
"build-storybook": "storybook build"
},
"dependencies": {
"lodash-es": "^4.17.21",
Expand Down

0 comments on commit 47fee63

Please sign in to comment.