Commit 6c6d54ed by Jaxon

style: 格式化代码并更新CI配置

1 parent 8cb6f6d4
Pipeline #58 for 6c6d54ed failed in 0 seconds
...@@ -5,19 +5,54 @@ image: node:24 ...@@ -5,19 +5,54 @@ image: node:24
# - test # - test
# - build # - build
# GitLab CI 配置:用于 AI 生成单元测试
# 此模板设计用于被包含在主 .gitlab-ci.yml 文件中,或作为独立配置使用。
stages:
- test
ai-unit-test-generation:
# 定义所属阶段为测试阶段
stage: test
# 使用 Node.js 24 镜像环境运行脚本
image: node:24
script:
- echo "开始执行 AI 单元测试生成..."
# 运行 AI 生成测试脚本
- node scripts/ci/ai-test-gen.mjs
rules:
# 规则:在除 main 和 dev 分支以外的所有分支上运行
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == 'dev'"
when: never
# 规则:如果是合并请求(Merge Request)触发的流水线,则不运行
- if: "$CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH"
when: always
# 允许此任务失败,不会导致整个流水线失败(仅作为辅助工具)
allow_failure: true
variables:
# 以下变量需要在 GitLab CI/CD 设置中配置(建议设置为 Masked 和 Protected):
# QWEN_API_KEY: 您的通义千问 (DashScope) API 密钥
# GITLAB_TOKEN: 具有 'api' 权限的 GitLab 个人访问令牌 (PAT) 或项目访问令牌。
# (CI_JOB_TOKEN 可能适用于某些操作,但通常发布评论的权限受限)
# 可选变量:
# QWEN_MODEL: "qwen-coder-plus" (推荐代码模型) 或 "qwen-plus" (默认)
# QWEN_API_URL: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions" (默认)
# 缓存配置:缓存 node_modules 和 pnpm store 以加速构建 # 缓存配置:缓存 node_modules 和 pnpm store 以加速构建
cache: # cache:
key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
paths: # paths:
- node_modules/ # - node_modules/
- .pnpm-store/ # - .pnpm-store/
# 设置 pnpm 环境 # # 设置 pnpm 环境
before_script: # before_script:
- corepack enable # - corepack enable
- corepack prepare pnpm@latest --activate # - corepack prepare pnpm@latest --activate
- pnpm config set store-dir .pnpm-store # - pnpm config set store-dir .pnpm-store
- pnpm install --frozen-lockfile # - pnpm install --frozen-lockfile
# 代码风格检查 # 代码风格检查
# lint: # lint:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!