This commit is contained in:
+4
-29
@@ -19,6 +19,9 @@ jobs:
|
|||||||
git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
git checkout ${{ github.sha }}
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: 安装依赖
|
||||||
|
run: composer install --prefer-dist --no-progress --no-interaction
|
||||||
|
|
||||||
- name: PHP 语法检查
|
- name: PHP 语法检查
|
||||||
run: |
|
run: |
|
||||||
echo "📝 PHP 语法检查..."
|
echo "📝 PHP 语法检查..."
|
||||||
@@ -38,9 +41,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 安装依赖
|
|
||||||
run: composer install --prefer-dist --no-progress --no-interaction
|
|
||||||
|
|
||||||
# 单元测试
|
# 单元测试
|
||||||
test:
|
test:
|
||||||
name: 单元测试
|
name: 单元测试
|
||||||
@@ -58,29 +58,4 @@ jobs:
|
|||||||
run: composer install --prefer-dist --no-progress --no-interaction
|
run: composer install --prefer-dist --no-progress --no-interaction
|
||||||
|
|
||||||
- name: 运行测试
|
- name: 运行测试
|
||||||
run: |
|
run: composer test
|
||||||
if composer test 2>/dev/null; then
|
|
||||||
echo "✅ 测试通过"
|
|
||||||
else
|
|
||||||
echo "⚠️ 测试未配置"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# CI 状态
|
|
||||||
ci-status:
|
|
||||||
name: CI 状态
|
|
||||||
runs-on: linux
|
|
||||||
container:
|
|
||||||
image: gitea-runner-php:latest
|
|
||||||
needs: [lint, test]
|
|
||||||
if: always()
|
|
||||||
steps:
|
|
||||||
- name: 检查结果
|
|
||||||
run: |
|
|
||||||
if [ "${{ needs.lint.result }}" == "success" ] && [ "${{ needs.test.result }}" == "success" ]; then
|
|
||||||
echo "✅ CI 通过,可以合并"
|
|
||||||
else
|
|
||||||
echo "❌ CI 失败"
|
|
||||||
echo "Lint: ${{ needs.lint.result }}"
|
|
||||||
echo "Test: ${{ needs.test.result }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -15,9 +15,6 @@
|
|||||||
<source>
|
<source>
|
||||||
<include>
|
<include>
|
||||||
<directory suffix=".php">src</directory>
|
<directory suffix=".php">src</directory>
|
||||||
<directory suffix=".php">.</directory>
|
|
||||||
<exclude>vendor</exclude>
|
|
||||||
<exclude>tests</exclude>
|
|
||||||
</include>
|
</include>
|
||||||
</source>
|
</source>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
Reference in New Issue
Block a user