Skip to content

Commit

Permalink
Make CI run storybook locally
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisDuarte1 committed Mar 7, 2024
1 parent 6d38a89 commit fc5f41c
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ node_modules/
docker-compose.yml
Dockerfile*
*.md
*.sh
*.sh
storybook-static/
11 changes: 1 addition & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,8 @@ jobs:
- name: Install Playwright
run: npx playwright install

- name: Wait for the Netlify Preview
uses: kamranayub/[email protected]
id: waitForNetlify
with:
site_name: 'niaefeup-frontend-storybook'
max_timeout: 300 # 5 minutes
env:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}

- name: Test
run: npm run test-storybook:coverage -- --url ${{ steps.waitForNetlify.outputs.url }} --ci
run: npm run test-storybook:ci

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ vite.config.ts.timestamp-*

# Test Reports
/coverage
storybook-static/
74 changes: 74 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"test-vite:watch": "vitest --watch",
"test-storybook": "test-storybook --browsers firefox",
"test-storybook:coverage": "npm run test-storybook -- --coverage",
"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"npm run build-storybook --quiet && npx http-server storybook-static --port 6006 --silent\" \"wait-on tcp:6006 && npm run test-storybook:coverage\"",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"storybook": "storybook dev -p 6006",
Expand All @@ -41,6 +42,7 @@
"@typescript-eslint/parser": "^7.1.0",
"autoprefixer": "^10.4.17",
"axe-playwright": "^2.0.1",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down

0 comments on commit fc5f41c

Please sign in to comment.