refactor: setup workspaces and monorepo with turbo repo #351
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 Tests (Pre-Deployment) | |
on: push | |
jobs: | |
test-storybook: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Build Storybook | |
run: pnpm build | |
- name: Serve Storybook and run tests | |
run: | | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server apps/storybook/storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && pnpm test-storybook" | |
chromatic: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
# ⚠️ Pick one of these, matching the package manager for your project | |
run: pnpm install | |
- name: Publish to Chromatic | |
uses: chromaui/action@latest | |
with: | |
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} |