Files
knowai/.drone.yml
tobegold574 109b43ba96
Some checks reported errors
continuous-integration/drone/push Build was killed
debug
2025-11-10 22:19:32 +08:00

74 lines
1.7 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: pnpm-store-cache
emptyDir: {}
- 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)"
volumeMounts:
- name: repo-volume
mountPath: /drone/src
# 1⃣ 验证 + 安装依赖 + 类型检查 + lint + 测试 + 构建
- name: verify-and-build
image: gitea.local.knowai/tobegold574/knowai-base:latest
environment:
NODE_ENV: development
commands:
- cd /drone/src/frontend/knowai-core
# 验证 Node.js 和 pnpm
- node --version
- pnpm --version
- echo "📦 安装依赖(利用缓存)..."
- pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com
# 执行核心验证
- 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: pnpm-store-cache
mountPath: /pnpm-global/store
- name: repo-volume
mountPath: /drone/src