ci: Fix Storybook job for www

This commit is contained in:
deytenit committed 2026-01-31 00:53:24 +03:00
1 parent 6b1f6bf915
commit 13d5f11c4d
7 files changed
+245 -53

No files matched your search

@@ -163,7 +163,42 @@ jobs:
retention-days: 1
test-www:
name: Test - WWW & Storybook
name: Test - Unit
needs: build-configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Test STL package
run: pnpm --filter @ermnvldmr/stl test:coverage
- name: Test UI package
run: pnpm --filter @ermnvldmr/ui test:coverage
- name: Test WWW service
run: pnpm --filter @ermnvldmr/www test:coverage
- name: Upload Unit coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./services/www/coverage/lcov.info
flags: www
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-storybook:
name: Test - Storybook
needs: build-storybook
runs-on: ubuntu-latest
steps:
@@ -185,19 +220,6 @@ jobs:
path: packages
- name: Install Playwright browsers
run: pnpm --filter @ermnvldmr/www exec playwright install --with-deps chromium
- name: Test STL package
run: pnpm --filter @ermnvldmr/stl test:coverage
- name: Test UI package
run: pnpm --filter @ermnvldmr/ui test:coverage
- name: Test WWW service
run: pnpm --filter @ermnvldmr/www test:coverage
- name: Upload Unit coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./services/www/coverage/lcov.info
flags: www
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Download Storybook build
uses: actions/download-artifact@v4
with:
@@ -271,4 +293,4 @@ jobs:
file: ci/docker/www/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
@@ -12,18 +12,30 @@ jobs:
setup-stage:
name: Setup - Stage
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache-pnpm-store.outputs.cache-hit }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- name: Setup Node.js with pnpm cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Cache pnpm store
id: cache-pnpm-store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -43,14 +55,24 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build configs
run: |
pnpm --filter @ermnvldmr/jest-config build
pnpm --filter @ermnvldmr/vite-config build
pnpm --filter @ermnvldmr/storybook-config build
- name: Build Jest config
run: pnpm --filter @ermnvldmr/jest-config build
- name: Build Vite config
run: pnpm --filter @ermnvldmr/vite-config build
- name: Build Storybook config
run: pnpm --filter @ermnvldmr/storybook-config build
- name: Upload Config Artifacts
uses: actions/upload-artifact@v4
with:
name: config-artifacts
path: |
packages/jest-config/dist
packages/vite-config/dist
packages/storybook-config/dist
retention-days: 1
build-dependencies:
name: Build - Dependencies
lint-www:
name: Lint - WWW & Deps
needs: build-configs
runs-on: ubuntu-latest
steps:
@@ -65,17 +87,21 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build dependencies
run: |
pnpm --filter @ermnvldmr/jest-config build
pnpm --filter @ermnvldmr/vite-config build
pnpm --filter @ermnvldmr/storybook-config build
pnpm --filter @ermnvldmr/stl build
pnpm --filter @ermnvldmr/ui build
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Lint STL package
run: pnpm --filter @ermnvldmr/stl lint
- name: Lint UI package
run: pnpm --filter @ermnvldmr/ui lint
- name: Lint WWW service
run: pnpm --filter @ermnvldmr/www lint
test-www:
name: Test - WWW & Deps
needs: build-dependencies
typecheck-www:
name: Typecheck - WWW & Deps
needs: build-configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -89,22 +115,110 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build dependencies
run: |
pnpm --filter @ermnvldmr/jest-config build
pnpm --filter @ermnvldmr/vite-config build
pnpm --filter @ermnvldmr/storybook-config build
pnpm --filter @ermnvldmr/stl build
pnpm --filter @ermnvldmr/ui build
- name: Run tests
run: |
pnpm --filter @ermnvldmr/stl test:coverage
pnpm --filter @ermnvldmr/ui test:coverage
pnpm --filter @ermnvldmr/www test:coverage
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Typecheck STL package
run: pnpm --filter @ermnvldmr/stl typecheck
- name: Typecheck UI package
run: pnpm --filter @ermnvldmr/ui typecheck
- name: Typecheck WWW service
run: pnpm --filter @ermnvldmr/www typecheck
build-storybook:
name: Build - Storybook
needs: build-configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Build WWW Storybook
run: pnpm --filter @ermnvldmr/www build-storybook
- name: Upload Storybook build
uses: actions/upload-artifact@v4
with:
name: storybook-static
path: services/www/storybook-static/
retention-days: 1
test-www:
name: Test - Unit
needs: build-configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Test STL package
run: pnpm --filter @ermnvldmr/stl test:coverage
- name: Test UI package
run: pnpm --filter @ermnvldmr/ui test:coverage
- name: Test WWW service
run: pnpm --filter @ermnvldmr/www test:coverage
test-storybook:
name: Test - Storybook
needs: build-storybook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Install Playwright browsers
run: pnpm --filter @ermnvldmr/www exec playwright install --with-deps chromium
- name: Download Storybook build
uses: actions/download-artifact@v4
with:
name: storybook-static
path: services/www/storybook-static/
- name: Serve Storybook and run tests
run: pnpm --filter @ermnvldmr/www test:storybook:ci
build-www:
name: Build - WWW Service
needs: build-dependencies
needs: build-configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -118,14 +232,13 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download Config Artifacts
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: packages
- name: Build WWW service
run: |
pnpm --filter @ermnvldmr/jest-config build
pnpm --filter @ermnvldmr/vite-config build
pnpm --filter @ermnvldmr/storybook-config build
pnpm --filter @ermnvldmr/stl build
pnpm --filter @ermnvldmr/ui build
pnpm --filter @ermnvldmr/www build
run: pnpm --filter @ermnvldmr/www build
release-rc-docker:
name: Release - RC Docker Image
@@ -169,4 +282,4 @@ jobs:
file: ci/docker/www/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
+18
View File
@@ -421,12 +421,30 @@ importers:
'@ermnvldmr/storybook-config':
specifier: workspace:*
version: link:../../packages/storybook-config
'@storybook/addon-a11y':
specifier: ^8.6.15
version: 8.6.15(storybook@8.6.15(prettier@3.5.3))
'@storybook/addon-coverage':
specifier: ^3.0.0
version: 3.0.0(vite@7.3.1(@types/node@25.0.10)(jiti@2.6.1)(lightningcss@1.30.2))
'@storybook/addon-essentials':
specifier: ^8.6.15
version: 8.6.15(@types/react@19.2.9)(storybook@8.6.15(prettier@3.5.3))
'@storybook/addon-interactions':
specifier: ^8.6.15
version: 8.6.15(storybook@8.6.15(prettier@3.5.3))
'@storybook/addon-themes':
specifier: ^8.6.15
version: 8.6.15(storybook@8.6.15(prettier@3.5.3))
'@storybook/react':
specifier: ^8.6.15
version: 8.6.15(@storybook/test@8.6.15(storybook@8.6.15(prettier@3.5.3)))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(storybook@8.6.15(prettier@3.5.3))(typescript@5.8.3)
'@storybook/react-vite':
specifier: ^8.6.15
version: 8.6.15(@storybook/test@8.6.15(storybook@8.6.15(prettier@3.5.3)))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(rollup@4.56.0)(storybook@8.6.15(prettier@3.5.3))(typescript@5.8.3)(vite@7.3.1(@types/node@25.0.10)(jiti@2.6.1)(lightningcss@1.30.2))
'@storybook/test':
specifier: ^8.6.15
version: 8.6.15(storybook@8.6.15(prettier@3.5.3))
'@storybook/test-runner':
specifier: ^0.19.1
version: 0.19.1(@swc/helpers@0.5.18)(@types/node@25.0.10)(storybook@8.6.15(prettier@3.5.3))(ts-node@10.9.2(@swc/core@1.15.10(@swc/helpers@0.5.18))(@types/node@25.0.10)(typescript@5.8.3))
+10
View File
@@ -25,6 +25,16 @@ const config: StorybookConfig = {
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
async viteFinal(config) {
config.resolve = config.resolve || {};
config.resolve.alias = {
...config.resolve.alias,
'#': path.resolve(__dirname, '../src'),
'@ermnvldmr/stl': path.resolve(__dirname, '../../../packages/stl/src'),
'@ermnvldmr/ui': path.resolve(__dirname, '../../../packages/ui/src'),
};
return config;
},
};
export default config;
+6
View File
@@ -40,8 +40,14 @@
"@ermnvldmr/eslint-config": "workspace:*",
"@ermnvldmr/jest-config": "workspace:*",
"@ermnvldmr/storybook-config": "workspace:*",
"@storybook/addon-a11y": "^8.6.15",
"@storybook/addon-coverage": "^3.0.0",
"@storybook/addon-essentials": "^8.6.15",
"@storybook/addon-interactions": "^8.6.15",
"@storybook/addon-themes": "^8.6.15",
"@storybook/react": "^8.6.15",
"@storybook/react-vite": "^8.6.15",
"@storybook/test": "^8.6.15",
"@storybook/test-runner": "^0.19.1",
"@tailwindcss/vite": "^4.1.4",
"@testing-library/jest-dom": "^6.9.1",
@@ -0,0 +1,13 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Welcome } from './Welcome';
const meta: Meta<typeof Welcome> = {
title: 'WWW/Widgets/Welcome',
component: Welcome,
tags: ['autodocs'],
};
export default meta;
type Story = StoryObj<typeof Welcome>;
export const Default: Story = {};
+10
View File
@@ -0,0 +1,10 @@
import React from 'react';
export const Welcome: React.FC = () => {
return (
<div className="p-4 bg-gray-100 rounded-lg">
<h1 className="text-2xl font-bold">Welcome to WWW Service</h1>
<p>This is a placeholder component for Storybook.</p>
</div>
);
};