314 lines
9.0 KiB
YAML
314 lines
9.0 KiB
YAML
name: packages/ui - next/required
|
|
|
|
on:
|
|
push:
|
|
branches: [next]
|
|
paths:
|
|
- 'packages/ui/**'
|
|
- 'packages/stl/**'
|
|
- 'packages/i18n/**'
|
|
- '.github/workflows/packages-ui-next-required.yml'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
concurrency:
|
|
group: ci-ui-${{ github.ref_name }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
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: Build i18n
|
|
run: pnpm --filter @ermnvldmr/i18n build
|
|
- name: Upload Rsbuild Config
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: rsbuild-config-dist
|
|
path: packages/rsbuild-config/dist
|
|
retention-days: 1
|
|
- name: Upload Storybook Config
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
retention-days: 1
|
|
- name: Upload i18n dist
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/dist
|
|
- name: Build UI Storybook
|
|
run: pnpm --filter @ermnvldmr/ui build-storybook
|
|
|
|
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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/dist
|
|
- name: Install Playwright browsers
|
|
run: pnpm --filter @ermnvldmr/ui exec playwright install --with-deps chromium
|
|
- name: Build UI Storybook
|
|
run: pnpm --filter @ermnvldmr/ui build-storybook
|
|
- 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
|
|
path: packages/rsbuild-config/dist
|
|
- name: Download Storybook Config
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: storybook-config-dist
|
|
path: packages/storybook-config/dist
|
|
- name: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist
|
|
path: packages/i18n/dist
|
|
- name: Build UI package
|
|
run: pnpm --filter @ermnvldmr/ui build
|