Skip to content

Commit bc9515d

Browse files
committed
更新 php-test.yml
1 parent c864d89 commit bc9515d

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

.github/workflows/php-test.yml

+15-27
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
1-
2-
name: PHP Unit Tests across Multiple Versions
1+
name: PHP 兼容性测试
32

43
on:
54
push:
6-
branches:
7-
- main
5+
branches: [ main ]
86
pull_request:
9-
branches:
10-
- main
7+
branches: [ main ]
118

129
jobs:
13-
test:
10+
php-compatibility:
11+
name: PHP 兼容性测试
12+
runs-on: ubuntu-latest
13+
1414
strategy:
1515
matrix:
16-
php-version: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] # 指定要测试的PHP版本
17-
runs-on: ubuntu-latest
16+
php-version: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
1817

1918
steps:
20-
- name: Checkout Code
21-
uses: actions/checkout@v3
19+
- name: 检出代码
20+
uses: actions/checkout@v2
2221

23-
- name: Setup PHP
22+
- name: 设置 PHP
2423
uses: shivammathur/setup-php@v2
2524
with:
2625
php-version: ${{ matrix.php-version }}
27-
tools: composer:v2
28-
coverage: none # 如果不需要覆盖率报告可以设置为none
29-
30-
- name: Install Dependencies
31-
run: composer install --prefer-dist --no-interaction --no-progress --no-suggest
3226

33-
- name: Run PHPUnit Tests
34-
run: vendor/bin/phpunit
35-
env:
36-
CI: true
27+
- name: 安装依赖
28+
run: composer install
3729

38-
- name: Upload Test Results (if failure)
39-
if: failure()
40-
uses: actions/upload-artifact@v3
41-
with:
42-
name: test-results-${{ matrix.php-version }}
43-
path: build/logs # 假设你的测试结果存储在build/logs目录下
30+
- name: 运行测试
31+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)