Files
eskin-player/scripts/gates/all.sh
yanjie 2f16c4762f feat: 初始化 SCALE OS 工程框架
- 添加 SCALE Engine 配置 (.scale/)
- 添加 OpenClaw Agent 配置 (.openclaw/)
- 添加知识文档 (AGENTS.md, TOOLS.md)
- 添加质量契约和工作流配置
- 添加 22 个工作流模板
- 添加验证脚本和门控脚本
- 添加 skills-registry 技能注册表
2026-05-20 15:06:38 +08:00

55 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# scripts/gates/all.sh — 运行所有门控检查
set -e
source ~/.cargo/env 2>/dev/null || true
cd "$(dirname "$0")/../.."
DRY_RUN=false
if [ "$1" = "--dry-run" ]; then
DRY_RUN=true
echo "🔒 门控检查 (dry-run 模式)"
else
echo "🔒 运行门控检查..."
fi
echo ""
run_gate() {
local name="$1"
local cmd="$2"
if [ "$DRY_RUN" = "true" ]; then
echo " ⏭️ $name (跳过, dry-run)"
return 0
fi
echo " 🔍 $name..."
if eval "$cmd" > /dev/null 2>&1; then
echo "$name 通过"
return 0
else
echo "$name 失败"
return 1
fi
}
FAILED=0
run_gate "类型检查 (cargo check)" "cargo check" || FAILED=$((FAILED + 1))
run_gate "Lint (cargo clippy)" "cargo clippy -- -D warnings" || FAILED=$((FAILED + 1))
run_gate "测试 (cargo test)" "cargo test" || FAILED=$((FAILED + 1))
if [ "$DRY_RUN" = "false" ]; then
run_gate "Release 构建" "cargo build --release" || FAILED=$((FAILED + 1))
fi
echo ""
echo "────────────────────────────────────"
if [ $FAILED -gt 0 ]; then
echo "$FAILED 个门控失败"
exit 1
else
echo "✅ 所有门控通过"
exit 0
fi