178 lines
4.9 KiB
YAML
178 lines
4.9 KiB
YAML
name: services/static - pr/required
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [next]
|
|
paths:
|
|
- 'services/static/**'
|
|
- 'packages/ui/**'
|
|
- 'packages/stl/**'
|
|
- 'packages/i18n/**'
|
|
- '.github/workflows/services-static-pr-required.yml'
|
|
- 'pnpm-lock.yaml'
|
|
|
|
concurrency:
|
|
group: ci-pr-static-${{ github.head_ref }}
|
|
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 i18n
|
|
run: pnpm --filter @ermnvldmr/i18n 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
|
|
- name: Upload i18n dist
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: i18n-dist-${{ github.run_id }}
|
|
path: packages/i18n/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: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist-${{ github.run_id }}
|
|
path: packages/i18n/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: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist-${{ github.run_id }}
|
|
path: packages/i18n/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: Download i18n dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i18n-dist-${{ github.run_id }}
|
|
path: packages/i18n/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
|