From 3850bc33dc3a24661af3f047604a912892e90b58 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Mon, 9 Mar 2026 00:17:12 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20PR=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PR 时检查 Python 语法 - 检查技能目录是否有 SKILL.md --- .gitea/workflows/test.yml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..61e74a9 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,40 @@ +name: PR Test + +on: + pull_request: + branches: + - main + +jobs: + lint: + runs-on: self-hosted + steps: + - name: Checkout code + run: | + cd /tmp && rm -rf kb-skills-test 2>/dev/null + git clone ssh://gitea-nas/starmen1265/kb-skills.git kb-skills-test + cd kb-skills-test + git checkout ${{ github.sha }} + + - name: Check Python syntax + run: | + cd /tmp/kb-skills-test + echo "🔍 检查 Python 语法..." + python3 -m py_compile $(find . -name "*.py" -not -path "./.git/*") 2>&1 || true + echo "✅ 语法检查完成" + + - name: Check SKILL.md exists + run: | + cd /tmp/kb-skills-test + echo "🔍 检查技能目录是否有 SKILL.md..." + for dir in kb-*/; do + if [ -f "$dir/SKILL.md" ]; then + echo " ✓ $dir/SKILL.md" + else + echo " ⚠ $dir 缺少 SKILL.md" + fi + done + echo "✅ 检查完成" + + - name: Cleanup + run: rm -rf /tmp/kb-skills-test