perf: 移除 CI 和 Docker 中的独立 typecheck 步骤,降低内存占用
This commit is contained in:
parent
e4e0a026a8
commit
950d6a5311
@ -2,10 +2,11 @@
|
|||||||
# Duoqi API - 双分支工作流(develop → main)
|
# Duoqi API - 双分支工作流(develop → main)
|
||||||
#
|
#
|
||||||
# 工作流:
|
# 工作流:
|
||||||
# develop push → quality → test → 构建并自动部署测试环境
|
# develop push → test → 构建并自动部署测试环境
|
||||||
# main push → quality → test → 构建并手动确认部署生产环境
|
# main push → test → 构建并手动确认部署生产环境
|
||||||
#
|
#
|
||||||
# 注意:单服务器架构,构建后直接部署,无需 artifact 传递
|
# 注意:单服务器架构,构建后直接部署,无需 artifact 传输
|
||||||
|
# Type check 由 Docker build 阶段的 tsc 编译覆盖,CI 不再单独运行
|
||||||
|
|
||||||
name: CI/CD Pipeline
|
name: CI/CD Pipeline
|
||||||
|
|
||||||
@ -17,25 +18,10 @@ env:
|
|||||||
DEPLOY_DIR: /opt/duoqi-api
|
DEPLOY_DIR: /opt/duoqi-api
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ==================== 代码质量检查 ====================
|
|
||||||
quality:
|
|
||||||
name: Code Quality
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Type check
|
|
||||||
run: node --max-old-space-size=768 ./node_modules/typescript/bin/tsc --noEmit -p tsconfig.ci.json
|
|
||||||
|
|
||||||
# ==================== 运行测试 ====================
|
# ==================== 运行测试 ====================
|
||||||
test:
|
test:
|
||||||
name: Unit Tests
|
name: Unit Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: quality
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -50,7 +36,7 @@ jobs:
|
|||||||
build-and-deploy-test:
|
build-and-deploy-test:
|
||||||
name: Build & Deploy Test
|
name: Build & Deploy Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [quality, test]
|
needs: [test]
|
||||||
if: github.ref == 'refs/heads/develop'
|
if: github.ref == 'refs/heads/develop'
|
||||||
environment:
|
environment:
|
||||||
name: test
|
name: test
|
||||||
@ -83,7 +69,7 @@ jobs:
|
|||||||
build-and-deploy-prod:
|
build-and-deploy-prod:
|
||||||
name: Build & Deploy Production
|
name: Build & Deploy Production
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [quality, test]
|
needs: [test]
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
environment:
|
environment:
|
||||||
name: production
|
name: production
|
||||||
|
|||||||
@ -16,8 +16,7 @@ FROM base AS build
|
|||||||
COPY --from=install /app/node_modules ./node_modules
|
COPY --from=install /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# 类型检查和编译
|
# 编译(tsc 本身包含类型检查)
|
||||||
RUN bun run typecheck
|
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
# 阶段 4: 生产镜像
|
# 阶段 4: 生产镜像
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"sourceMap": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user