Files
knowai/.drone.yml
tobegold574 437c264d4a
Some checks reported errors
continuous-integration/drone/push Build was killed
debug
2025-11-11 00:43:23 +08:00

71 lines
1.5 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: kubernetes
name: verify-knowai-core
trigger:
branch:
- knowai-core
event:
- push
volumes:
# 只需要代码挂载卷
- name: repo-volume
emptyDir: {}
clone:
disable: true
steps:
# 0⃣ 克隆代码
- name: clone
image: alpine/git:latest
environment:
CA_CRT:
from_secret: ca-crt
commands:
- apk add --no-cache ca-certificates
- echo "$CA_CRT" > /etc/ssl/certs/ca.crt
- update-ca-certificates
- git clone https://gitea.local.knowai/tobegold574/knowai.git /drone/src
- cd /drone/src
- git checkout ${DRONE_BRANCH}
- echo "✅ 当前分支:$(git rev-parse --abbrev-ref HEAD)"
- ls
volumeMounts:
- name: repo-volume
mountPath: /drone/src
# 1⃣ 验证 + 安装依赖 + 类型检查 + lint + 测试 + 构建
- name: verify-and-build
image: gitea.local.knowai/tobegold574/knowai-dev:1.0.0
environment:
NODE_ENV: development
commands:
- cd /drone/src
- node --version
- pnpm --version
- echo "📦 安装依赖..."
- pnpm install --frozen-lockfile --store /pnpm-global/store
- echo "🔍 TypeScript 类型检查..."
- pnpm run type-check
- echo "🔍 ESLint 代码检查..."
- pnpm run lint
- echo "🧪 运行单元测试..."
- pnpm run test
- echo "🔨 构建产物..."
- pnpm run build
- ls -la dist/
- echo "✅ 核心验证通过"
volumeMounts:
- name: repo-volume
mountPath: /drone/src