fix: 使用 container 指定 PHP 镜像
Test CI / 快速测试 (push) Has been cancelled

- test.yml / ci.yml: 使用 composer:latest 镜像 (含 PHP)
- deploy.yml: 使用 alpine:latest 镜像 + SSH 密钥配置
- 解决 runner 默认环境缺少 PHP 的问题
This commit is contained in:
2026-03-01 01:01:06 +08:00
parent 21ddf36151
commit 9427294682
3 changed files with 39 additions and 9 deletions
+6 -1
View File
@@ -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 }}