From 7b574a1a66ee110e38930d379d7e8da2707efdad Mon Sep 17 00:00:00 2001 From: Vladimir Eremin Date: Fri, 6 Mar 2026 23:14:13 +0300 Subject: [PATCH] ci: Add workflows for prs --- .../workflows/packages-stl-pr-required.yml | 172 +++++++++++ .github/workflows/packages-ui-pr-required.yml | 279 +++++++++++++++++ .../workflows/services-docs-pr-required.yml | 50 ++++ .../workflows/services-static-pr-required.yml | 149 ++++++++++ .../workflows/services-www-pr-required.yml | 280 ++++++++++++++++++ 5 files changed, 930 insertions(+) create mode 100644 .github/workflows/packages-stl-pr-required.yml create mode 100644 .github/workflows/packages-ui-pr-required.yml create mode 100644 .github/workflows/services-docs-pr-required.yml create mode 100644 .github/workflows/services-static-pr-required.yml create mode 100644 .github/workflows/services-www-pr-required.yml diff --git a/.github/workflows/packages-stl-pr-required.yml b/.github/workflows/packages-stl-pr-required.yml new file mode 100644 index 0000000..4195092 --- /dev/null +++ b/.github/workflows/packages-stl-pr-required.yml @@ -0,0 +1,172 @@ +name: packages/stl - pr/required + +on: + pull_request: + branches: [next] + paths: + - 'packages/stl/**' + - '.github/workflows/packages-stl-pr-required.yml' + - 'pnpm-lock.yaml' + +concurrency: + group: ci-pr-stl-${{ github.head_ref }} + cancel-in-progress: true + +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 + + build-configs: + name: Build - Configs + needs: setup-stage + 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: Build Rsbuild config + run: pnpm --filter @ermnvldmr/rsbuild-config build + - name: Upload Config Artifacts + uses: actions/upload-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + retention-days: 1 + + lint-stl: + name: Lint - STL + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Lint STL package + run: pnpm --filter @ermnvldmr/stl lint + + typecheck-stl: + name: Typecheck - STL + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Typecheck STL package + run: pnpm --filter @ermnvldmr/stl typecheck + + test-stl: + name: Test - STL + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Test STL package + run: pnpm --filter @ermnvldmr/stl test:coverage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./packages/stl/coverage/lcov.info + flags: stl + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + build-stl: + name: Build - STL + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Build STL package + run: pnpm --filter @ermnvldmr/stl build diff --git a/.github/workflows/packages-ui-pr-required.yml b/.github/workflows/packages-ui-pr-required.yml new file mode 100644 index 0000000..426b996 --- /dev/null +++ b/.github/workflows/packages-ui-pr-required.yml @@ -0,0 +1,279 @@ +name: packages/ui - pr/required + +on: + pull_request: + branches: [next] + paths: + - 'packages/ui/**' + - 'packages/stl/**' + - '.github/workflows/packages-ui-pr-required.yml' + - 'pnpm-lock.yaml' + +concurrency: + group: ci-pr-ui-${{ github.head_ref }} + cancel-in-progress: true + +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 + + build-configs: + name: Build - Configs + needs: setup-stage + 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: Build Rsbuild config + run: pnpm --filter @ermnvldmr/rsbuild-config build + - name: Build Storybook config + run: pnpm --filter @ermnvldmr/storybook-config build + - name: Upload Rsbuild Config + uses: actions/upload-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + retention-days: 1 + - name: Upload Storybook Config + uses: actions/upload-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + retention-days: 1 + + lint-ui: + name: Lint - UI + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Lint UI package + run: pnpm --filter @ermnvldmr/ui lint + + typecheck-ui: + name: Typecheck - UI + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Typecheck UI package + run: pnpm --filter @ermnvldmr/ui typecheck + + test-ui: + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Test UI package + run: pnpm --filter @ermnvldmr/ui test:coverage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./packages/ui/coverage/lcov.info + flags: ui + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Build UI Storybook + run: pnpm --filter @ermnvldmr/ui build-storybook + - name: Upload Storybook build + uses: actions/upload-artifact@v4 + with: + name: ui-storybook-static-${{ github.run_id }} + path: packages/ui/storybook-static/ + retention-days: 1 + + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Install Playwright browsers + run: pnpm --filter @ermnvldmr/ui exec playwright install --with-deps chromium + - name: Download Storybook build + uses: actions/download-artifact@v4 + with: + name: ui-storybook-static-${{ github.run_id }} + path: packages/ui/storybook-static/ + - name: Test Storybook + run: pnpm --filter @ermnvldmr/ui test:storybook:ci + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./packages/ui/coverage/storybook/lcov.info + flags: ui-storybook + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + build-ui: + name: Build - UI + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Build UI package + run: pnpm --filter @ermnvldmr/ui build diff --git a/.github/workflows/services-docs-pr-required.yml b/.github/workflows/services-docs-pr-required.yml new file mode 100644 index 0000000..01db6c2 --- /dev/null +++ b/.github/workflows/services-docs-pr-required.yml @@ -0,0 +1,50 @@ +name: services/docs - pr/required + +on: + pull_request: + branches: [next] + paths: + - 'services/docs/**' + - '.github/workflows/services-docs-pr-required.yml' + +concurrency: + group: ci-pr-docs-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + setup-hugo: + name: Setup - Hugo + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + build-hugo: + name: Build - Hugo Site + needs: setup-hugo + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + - name: Build Hugo site + working-directory: services/docs + run: hugo --gc --minify diff --git a/.github/workflows/services-static-pr-required.yml b/.github/workflows/services-static-pr-required.yml new file mode 100644 index 0000000..5d9e18f --- /dev/null +++ b/.github/workflows/services-static-pr-required.yml @@ -0,0 +1,149 @@ +name: services/static - pr/required + +on: + pull_request: + branches: [next] + paths: + - 'services/static/**' + - 'packages/ui/**' + - 'packages/stl/**' + - '.github/workflows/services-static-pr-required.yml' + - 'pnpm-lock.yaml' + +concurrency: + group: ci-pr-static-${{ github.head_ref }} + cancel-in-progress: true + +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 + + build-configs: + name: Build - Configs + needs: setup-stage + 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: Build Rsbuild config + run: pnpm --filter @ermnvldmr/rsbuild-config build + - name: Upload Config Artifacts + uses: actions/upload-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + retention-days: 1 + + lint-static: + name: Lint - Static + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Lint static service + run: pnpm --filter @ermnvldmr/static lint + + typecheck-static: + name: Typecheck - Static + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Typecheck static service + run: pnpm --filter @ermnvldmr/static typecheck + + build-static: + name: Build - Static Site + 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: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Build static service + run: pnpm --filter @ermnvldmr/static build + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: static-dist-${{ github.run_id }} + path: services/static/dist/ + retention-days: 1 diff --git a/.github/workflows/services-www-pr-required.yml b/.github/workflows/services-www-pr-required.yml new file mode 100644 index 0000000..3d6a6aa --- /dev/null +++ b/.github/workflows/services-www-pr-required.yml @@ -0,0 +1,280 @@ +name: services/www - pr/required + +on: + pull_request: + branches: [next] + paths: + - 'services/www/**' + - 'packages/ui/**' + - 'packages/stl/**' + - '.github/workflows/services-www-pr-required.yml' + - 'pnpm-lock.yaml' + +concurrency: + group: ci-pr-www-${{ github.head_ref }} + cancel-in-progress: true + +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 + + build-configs: + name: Build - Configs + needs: setup-stage + 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: Build Rsbuild config + run: pnpm --filter @ermnvldmr/rsbuild-config build + - name: Build Storybook config + run: pnpm --filter @ermnvldmr/storybook-config build + - name: Upload Rsbuild Config + uses: actions/upload-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + retention-days: 1 + - name: Upload Storybook Config + uses: actions/upload-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + retention-days: 1 + + lint-www: + name: Lint - WWW + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Lint WWW service + run: pnpm --filter @ermnvldmr/www lint + + typecheck-www: + name: Typecheck - WWW + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Build WWW Storybook + run: pnpm --filter @ermnvldmr/www build-storybook + - name: Upload Storybook build + uses: actions/upload-artifact@v4 + with: + name: www-storybook-static-${{ github.run_id }} + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - 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: + - 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - 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: www-storybook-static-${{ github.run_id }} + path: services/www/storybook-static/ + - name: Serve Storybook and run tests with coverage + run: pnpm --filter @ermnvldmr/www test:storybook:ci + - name: Upload Storybook coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./services/www/coverage/storybook/lcov.info + flags: www-storybook + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + build-www: + name: Build - WWW Service + 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 Rsbuild Config + uses: actions/download-artifact@v4 + with: + name: rsbuild-config-dist-${{ github.run_id }} + path: packages/rsbuild-config/dist + - name: Download Storybook Config + uses: actions/download-artifact@v4 + with: + name: storybook-config-dist-${{ github.run_id }} + path: packages/storybook-config/dist + - name: Build WWW service + run: pnpm --filter @ermnvldmr/www build