feature/article-word-count #2
+3
-14
@@ -22,21 +22,10 @@ jobs:
|
|||||||
|
|
||||||
- name: PHP 语法检查
|
- name: PHP 语法检查
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
echo "📝 PHP 语法检查..."
|
echo "📝 PHP 语法检查..."
|
||||||
|
find . -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l
|
||||||
# 检查所有 PHP 文件(排除 vendor),保存完整输出
|
echo "✅ 所有 PHP 文件语法正确"
|
||||||
{
|
|
||||||
find . -name "*.php" -not -path "./vendor/*" -exec sh -c 'php -l "$1" 2>&1 || true' _ {} \;
|
|
||||||
} > /tmp/lint_output.txt
|
|
||||||
|
|
||||||
# 检查是否有错误
|
|
||||||
if grep -q "^Parse error\|^Fatal error\|^Syntax error" /tmp/lint_output.txt; then
|
|
||||||
echo "❌ PHP 语法错误:"
|
|
||||||
cat /tmp/lint_output.txt
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "✅ 所有 PHP 文件语法正确"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 单元测试
|
# 单元测试
|
||||||
test:
|
test:
|
||||||
|
|||||||
Reference in New Issue
Block a user