Files
ermnvldmr.com/.github/workflows/packages-ui-next-required.yml
T

227 lines
6.5 KiB
YAML

name: packages/ui - next/required
on:
push:
branches: [next]
paths:
- 'packages/ui/**'
- 'packages/stl/**'
- 'pnpm-lock.yaml'
concurrency:
group: ci-ui-${{ github.ref_name }}
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 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
build-dependencies:
name: Build - Dependencies
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: 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: Build STL package
run: pnpm --filter @ermnvldmr/stl build
lint-ui:
name: Lint - UI
needs: build-dependencies
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: Lint STL package
run: pnpm --filter @ermnvldmr/stl lint
- name: Lint UI package
run: pnpm --filter @ermnvldmr/ui lint
typecheck-ui:
name: Typecheck - UI
needs: build-dependencies
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: Typecheck STL package
run: pnpm --filter @ermnvldmr/stl typecheck
- name: Typecheck UI package
run: pnpm --filter @ermnvldmr/ui typecheck
test-ui:
name: Test - UI & Storybook
needs: build-dependencies
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 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: Build STL package
run: pnpm --filter @ermnvldmr/stl build
- name: Test STL package
run: pnpm --filter @ermnvldmr/stl test:coverage
- name: Test UI package
run: pnpm --filter @ermnvldmr/ui test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./packages/stl/coverage/lcov.info,./packages/ui/coverage/lcov.info
flags: stl,ui
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-storybook:
name: Build - Storybook
needs: build-dependencies
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 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: Build STL package
run: pnpm --filter @ermnvldmr/stl build
- name: Build UI package
run: pnpm --filter @ermnvldmr/ui build
- name: Build UI Storybook
run: pnpm --filter @ermnvldmr/ui build-storybook
build-ui:
name: Build - UI
needs: build-dependencies
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 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: Build STL package
run: pnpm --filter @ermnvldmr/stl build
- name: Build UI package
run: pnpm --filter @ermnvldmr/ui build