[WIP - storybook test] #127
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: "Storybook Tests" | |
on: | |
pull_request: | |
branches: | |
- integration | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: packages/webapp/ | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v2.0.1 | |
with: | |
version: 6.26.1 | |
- name: Install pnpm dependencies | |
run: pnpm install | |
- name: Install Playwright | |
run: npx playwright install --with-deps | |
- name: Run storybook | |
working-directory: packages/webapp | |
run: pnpm run storybook & | |
- name: Wait for Storybook to start | |
run: | | |
until nc -z 127.0.0.1 6006; do sleep 1; done | |
echo "Storybook is now running on port 6006." | |
sleep 15 # Add a short delay (adjust as needed) to ensure Storybook is fully ready | |
- name: Run storybook tests | |
working-directory: packages/webapp | |
run: | | |
# Run tests in the background and capture their PIDs | |
while read -r test; do | |
pnpm test-storybook "$test" --maxWorkers=1 & echo $! >> test_pids.txt | |
done < allowed-storybook-tests.txt | |
# Wait for all background processes to finish | |
for pid in $(cat test_pids.txt); do | |
wait $pid | |
exit_code=$? | |
echo "Process $pid exited with code $exit_code" | |
done |