From 950d6a5311f7561e6cb860423e89caa827642bac Mon Sep 17 00:00:00 2001 From: Wang Zhuoxuan Date: Wed, 3 Jun 2026 11:17:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=A7=BB=E9=99=A4=20CI=20=E5=92=8C=20D?= =?UTF-8?q?ocker=20=E4=B8=AD=E7=9A=84=E7=8B=AC=E7=AB=8B=20typecheck=20?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=EF=BC=8C=E9=99=8D=E4=BD=8E=E5=86=85=E5=AD=98?= =?UTF-8?q?=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 26 ++++++-------------------- Dockerfile | 3 +-- tsconfig.ci.json | 6 ------ 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 tsconfig.ci.json diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7531927..99c2487 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,10 +2,11 @@ # Duoqi API - 双分支工作流(develop → main) # # 工作流: -# develop push → quality → test → 构建并自动部署测试环境 -# main push → quality → test → 构建并手动确认部署生产环境 +# develop push → test → 构建并自动部署测试环境 +# main push → test → 构建并手动确认部署生产环境 # -# 注意:单服务器架构,构建后直接部署,无需 artifact 传递 +# 注意:单服务器架构,构建后直接部署,无需 artifact 传输 +# Type check 由 Docker build 阶段的 tsc 编译覆盖,CI 不再单独运行 name: CI/CD Pipeline @@ -17,25 +18,10 @@ env: DEPLOY_DIR: /opt/duoqi-api 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: name: Unit Tests runs-on: ubuntu-latest - needs: quality steps: - name: Checkout code uses: actions/checkout@v4 @@ -50,7 +36,7 @@ jobs: build-and-deploy-test: name: Build & Deploy Test runs-on: ubuntu-latest - needs: [quality, test] + needs: [test] if: github.ref == 'refs/heads/develop' environment: name: test @@ -83,7 +69,7 @@ jobs: build-and-deploy-prod: name: Build & Deploy Production runs-on: ubuntu-latest - needs: [quality, test] + needs: [test] if: github.ref == 'refs/heads/main' environment: name: production diff --git a/Dockerfile b/Dockerfile index 1aeebdd..0cc8be2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,7 @@ FROM base AS build COPY --from=install /app/node_modules ./node_modules COPY . . -# 类型检查和编译 -RUN bun run typecheck +# 编译(tsc 本身包含类型检查) RUN bun run build # 阶段 4: 生产镜像 diff --git a/tsconfig.ci.json b/tsconfig.ci.json deleted file mode 100644 index 55590b1..0000000 --- a/tsconfig.ci.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "sourceMap": false - } -}