- test.yml / ci.yml: 使用 composer:latest 镜像 (含 PHP) - deploy.yml: 使用 alpine:latest 镜像 + SSH 密钥配置 - 解决 runner 默认环境缺少 PHP 的问题
This commit is contained in:
@@ -11,16 +11,18 @@ jobs:
|
||||
lint:
|
||||
name: 代码检查
|
||||
runs-on: linux
|
||||
container:
|
||||
image: composer:latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
run: |
|
||||
apk add --no-cache git
|
||||
git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
- name: PHP 语法检查
|
||||
run: |
|
||||
echo "📝 PHP 语法检查..."
|
||||
echo "PHP 版本: $(php -v | head -1)"
|
||||
errors=0
|
||||
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
|
||||
output=$(php -l "$file" 2>&1)
|
||||
@@ -44,10 +46,13 @@ jobs:
|
||||
test:
|
||||
name: 单元测试
|
||||
runs-on: linux
|
||||
container:
|
||||
image: composer:latest
|
||||
needs: lint
|
||||
steps:
|
||||
- name: 检出代码
|
||||
run: |
|
||||
apk add --no-cache git
|
||||
git clone -b ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user