Files
playbook/.gitea/workflows/standards-check.yml
T
cshandClaude Opus 4.6 8b93311cae 📝 docs(tsl): clarify syntax constraints and enhance test infrastructure
- Add TSF file naming constraint to syntax/02_core_model.md
- Clarify semicolon rules: syntax facts vs style preferences
- Separate control flow end semicolon rules (syntax allows both)
- Add function body semicolon requirements to syntax/05_functions_and_calls.md
- Move style preferences to code_style.md (control flow end semicolons)
- Remove cross-references from syntax docs to maintain independence
- Enhance Gitea workflow emoji for better CI output readability
- Fix CI test path from tests/ to test/
- Organize agent test results under test/agent/result/ directory
- Add complete Chinese translation of test cases (test_cases_zh.md)
- Clean up .gitignore to use unified test/agent/result/ directory
- Remove obsolete agent test artifacts (REPORTS_LOCATION.md, old results)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-21 17:04:50 +08:00

76 lines
2.3 KiB
YAML

name: ✅ Standards Check
on:
push:
pull_request:
workflow_dispatch: # 允许手动触发
concurrency:
group: standards-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: true
# ==========================================
# 🔧 配置区域 - 标准校验参数
# ==========================================
env:
COMMIT_LINT_REQUIRE_EMOJI: "1"
WORKSPACE_DIR: "/home/workspace"
jobs:
commit-message:
name: 🔍 Commit message lint
runs-on: ubuntu-22.04
steps:
- name: 📥 准备仓库
run: |
set -euo pipefail
echo "========================================"
echo "📦 准备仓库到 WORKSPACE_DIR"
echo "========================================"
REPO_NAME="${{ github.event.repository.name }}"
TOKEN="${{ secrets.WORKFLOW }}"
TARGET_SHA="${{ github.sha }}"
TARGET_REF="${{ github.ref }}"
TARGET_REF_NAME="${{ github.ref_name }}"
mkdir -p "$WORKSPACE_DIR"
REPO_DIR="$(mktemp -d "$WORKSPACE_DIR/${REPO_NAME}.XXXXXX")"
if [ -n "$TOKEN" ]; then
REPO_URL="https://oauth2:${TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git"
else
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
fi
git clone "$REPO_URL" "$REPO_DIR"
if git -C "$REPO_DIR" cat-file -e "${TARGET_SHA}^{commit}" 2>/dev/null; then
git -C "$REPO_DIR" checkout -f "$TARGET_SHA"
else
if [ -n "$TARGET_REF" ]; then
git -C "$REPO_DIR" fetch origin "$TARGET_REF"
git -C "$REPO_DIR" checkout -f FETCH_HEAD
else
git -C "$REPO_DIR" checkout -f "$TARGET_REF_NAME"
fi
fi
git config --global --add safe.directory "$REPO_DIR"
echo "REPO_DIR=$REPO_DIR" >> "$GITHUB_ENV"
echo "✅ 仓库准备完成"
- name: 🔍 Lint commit message / PR title
run: |
cd "$REPO_DIR"
echo "🔍 检查 commit message 和 PR title 规范..."
python3 .gitea/ci/commit_message_lint.py
echo "✅ Lint 检查通过"
- name: 🧹 清理临时仓库
if: always()
run: |
rm -rf "$REPO_DIR"