Skip to content

chore(deps): bump react and @types/react in /website #54

chore(deps): bump react and @types/react in /website

chore(deps): bump react and @types/react in /website #54

Workflow file for this run

name: PR Quality Check
on:
pull_request:
branches: [main, dev]
jobs:
# ===========================================================================
# 路径变更检测 —— 决定哪些子项目需要执行检查
# ===========================================================================
changes:
runs-on: ubuntu-latest
# dorny/paths-filter 需要读取 PR 变更文件列表;Dependabot PR 的只读 token
# 默认不含该权限,显式声明后 Dependabot PR 的路径检测才能正常工作
permissions:
contents: read
pull-requests: read
outputs:
client: ${{ steps.filter.outputs.client }}
sync-service: ${{ steps.filter.outputs.sync-service }}
ai-gateway: ${{ steps.filter.outputs.ai-gateway }}
website: ${{ steps.filter.outputs.website }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
client:
- 'client/**'
sync-service:
- 'server/sync-service/**'
- 'server/shared/**'
ai-gateway:
- 'server/ai-gateway/**'
- 'server/shared/**'
website:
- 'website/**'
# ===========================================================================
# Client —— React + Vite + Electron 前端
# ===========================================================================
client:
needs: changes
if: needs.changes.outputs.client == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: client/package-lock.json
- run: cd client && npm ci
- name: Lint
run: cd client && npm run lint
- name: Typecheck (renderer)
# 渲染进程(React + Vite)的 TypeScript 编译检查
run: cd client && npx tsc --noEmit
# Electron 主进程使用独立的 tsconfig(CommonJS / Node 目标),
# 与渲染进程的 Vite+DOM 配置不同,需单独检查以捕获主进程类型错误
- name: Typecheck (Electron main process)
run: cd client && npx tsc -p electron/tsconfig.json --noEmit
- name: Test (with coverage)
# 启用覆盖率收集,与 vitest.config.ts 中配置的阈值配合,
# 确保新增代码的测试覆盖不低于设定门槛
run: cd client && npm run test -- --run --coverage
- name: Build
run: cd client && npm run build
# ===========================================================================
# Server / sync-service —— Go + Gin 同步服务
# ===========================================================================
sync-service:
needs: changes
if: needs.changes.outputs.sync-service == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: server/sync-service
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
# Go 1.25 尚未发布,使用当前最新稳定版 1.24(截至 2026 年 8 月)
go-version: '1.24'
cache-dependency-path: server/sync-service/go.sum
- name: Lint (go vet)
run: go vet ./...
- name: Build
run: go build ./...
- name: Test
run: go test ./... -v -count=1
# ===========================================================================
# Server / ai-gateway —— Python + FastAPI AI 网关
# ===========================================================================
ai-gateway:
needs: changes
if: needs.changes.outputs.ai-gateway == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: server/ai-gateway
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: server/ai-gateway/requirements.txt
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install ruff pytest pytest-asyncio httpx
- name: Lint (ruff)
run: ruff check .
- name: Test
run: pytest tests/ -v --tb=short
# ===========================================================================
# Website —— Next.js 官网
# ===========================================================================
website:
needs: changes
if: needs.changes.outputs.website == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: website/package-lock.json
- run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npx tsc --noEmit
- name: Build
run: npm run build