feature/article-word-count #2

Merged
starmen1265 merged 24 commits from feature/article-word-count into main 2026-03-02 00:33:23 +08:00
Showing only changes of commit 377061a780 - Show all commits
+17 -5
View File
@@ -22,14 +22,26 @@ jobs:
- name: PHP 语法检查
run: |
echo "📝 开始 PHP 语法检查..."
echo "=== 开始 PHP 语法检查 ==="
echo "🔍 正在检查所有 PHP 文件..."
# 保存所有 php -l 输出到文件
> /tmp/lint_output.txt
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
echo "检查: $file"
php -l "$file" || true
echo ">>> 检查文件: $file" >> /tmp/lint_output.txt
php -l "$file" >> /tmp/lint_output.txt 2>&1
echo "" >> /tmp/lint_output.txt
done
echo "✅ 文件检查完成"
# 显示输出
cat /tmp/lint_output.txt
# 检查是否有错误
if grep -q "Parse error\|Fatal error\|Syntax error" /tmp/lint_output.txt; then
echo "=== 发现语法错误,CI 失败 ==="
exit 1
else
echo "=== 所有 PHP 文件语法正确 ==="
fi
# 单元测试
test: