fix: i suggestion bug #348
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: "Tests Storybook" | |
on: push | |
concurrency: | |
group: storybook-tests-${{ github.ref }} # This ensures that only one workflow runs per branch | |
cancel-in-progress: true # This cancels any previous runs in the same group | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Cache Build | |
id: cache-build | |
uses: actions/cache@v4 | |
with: | |
path: dist | |
key: ${{ runner.os }}-build-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }} # Cache key based on OS and file hashes | |
restore-keys: | | |
${{ runner.os }}-build- | |
- name: Build | |
if: steps.cache-build.outputs.cache-hit != 'true' | |
run: pnpm build | |
- name: Cache Storybook build | |
uses: actions/cache@v4 | |
with: | |
path: storybook-static | |
key: ${{ runner.os }}-storybook-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-storybook- | |
- name: Build Storybook | |
run: pnpm build-storybook --quiet | |
- name: Cache Playwright browsers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }} # Cache key based on OS and file hashes | |
restore-keys: | | |
${{ runner.os }}-playwright- | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- 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:127.0.0.1:6006 && pnpm test-storybook" |