Merge pull request #4 from liuxian496/developer #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Storybook Test | |
on: | |
push: | |
branches: ["main", "developer"] | |
pull_request: | |
branches: ["main", "developer"] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: yarn | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Build Storybook | |
run: yarn build-storybook --quiet | |
- name: Serve Storybook and run tests | |
run: | | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && yarn test-storybook -- --coverage && yarn test-storybook" | |
- name: Locv Report | |
run: npx nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/storybook | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@v2 |