Skip to content

feat/storybook

feat/storybook #29

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set node
uses: actions/[email protected]
with:
node-version: lts/*
cache: pnpm
- name: Setup
run: npm i -g @antfu/ni
- name: Install
run: nci
- name: Lint
run: nr lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set node
uses: actions/[email protected]
with:
node-version: lts/*
cache: pnpm
- name: Setup
run: npm i -g @antfu/ni
- name: Install
run: nci
- name: Typecheck
run: nr typecheck
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [lts/*]
os: [ubuntu-latest] # adding "windows-latest" and "macos-latest" will only slows down CI/CD
fail-fast: false
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set node version to ${{ matrix.node }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Setup
run: npm i -g @antfu/ni
- name: Install
run: nci
- name: Build
run: nr build
- name: Test
run: nr test
- name: Save test report as artifact on failure
uses: actions/[email protected]
if: failure()
with:
name: test-report
path: html/
retention-days: 2
storybook-test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Setup node
uses: actions/[email protected]
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Install Playwright
run: pnpm dlx playwright install --with-deps
- name: Build Storybook
run: pnpm story:build --quiet
- name: Serve Storybook and run tests
run: |
pnpm dlx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"pnpm dlx http-server storybook-static --port 6006 --silent" \
"pnpm dlx wait-on tcp:6006 && yarn story:test"