AgentEvalTool/scripts/ci-check.sh
sinohqb 92f98c3af7
Some checks failed
CI / test (push) Failing after 2m59s
docs(release): add v0.3 release notes and minimal CI baseline
- 补齐 release-notes-v0.3.md,更新 AGENT.md 里程碑表与 README 至 v0.3 现状
- 新增 scripts/ci-check.sh(版本一致性 + ruff + pytest + tsc)
- 新增 .gitea/workflows/ci.yml 与本地 pre-push hook 约定
2026-07-27 16:51:45 +08:00

40 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Minimal CI check: run locally (pre-push hook) or in Gitea Actions.
# Usage: scripts/ci-check.sh [--fast] (--fast skips frontend type check)
set -euo pipefail
cd "$(dirname "$0")/.."
FAST=0
[[ "${1:-}" == "--fast" ]] && FAST=1
if [[ -f .venv/bin/activate ]]; then
# shellcheck disable=SC1091
source .venv/bin/activate
fi
echo "==> 1/4 版本号一致性 (pyproject ↔ package.json)"
python scripts/sync_version.py --check
echo "==> 2/4 ruff lint"
if command -v ruff >/dev/null 2>&1; then
ruff check backend/
else
echo " ruff 未安装跳过pip install -e '.[dev]'"
fi
echo "==> 3/4 pytest"
python -m pytest -q
if [[ $FAST -eq 1 ]]; then
echo "==> 4/4 前端类型检查(--fast 跳过)"
else
echo "==> 4/4 前端类型检查 (tsc --noEmit)"
if [[ -d frontend/web/node_modules ]]; then
(cd frontend/web && npx tsc --noEmit)
else
echo " node_modules 不存在跳过cd frontend/web && npm install"
fi
fi
echo "✅ CI 检查全部通过"