ci: Add script to workflow for testing storybooks. #1
Workflow file for this run
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: Smoke Tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
defaults: | |
run: | |
working-directory: typescript | |
jobs: | |
test: | |
name: Smoke Tests | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Test Dependencies | |
run: npm install concurrently http-server wait-on | |
- name: Build Storybook | |
run: npm run build-storybook | |
- name: Serve Storybook and run tests | |
env: | |
PORT: 8080 | |
HOST: 127.0.0.1 | |
run: | | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server storybook-static --port $PORT -a $HOST" \ | |
"npx wait-on http://$HOST:$PORT/ && npm run storybook:test -- --ci --url http://$HOST:$PORT/" |