Skip to content

Commit 4363aed

Browse files
committed
增加单元测试
1 parent a970000 commit 4363aed

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PHPUnit for Hyperf
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
ci:
7+
name: Test on PHP ${{ matrix.php-version }} Swoole ${{ matrix.swoole-version }}
8+
runs-on: '${{ matrix.os }}'
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest ]
12+
php-version: [ '7.4', '8.0' ]
13+
hyperf-version: [ '^2.2', '^3.0' ]
14+
exclude:
15+
- php-version: '7.4'
16+
hyperf-version: '^3.0'
17+
max-parallel: 5
18+
env:
19+
HF_VERSION: ${{ matrix.hyperf-version }}
20+
PHP_VERSION: ${{ matrix.php-version }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-version }}
28+
tools: phpize
29+
ini-values: opcache.enable_cli=0
30+
coverage: none
31+
extensions: pdo, pdo_mysql, redis
32+
- name: Show Environment
33+
run: |
34+
php -v
35+
php -m
36+
php -i
37+
- name: Setup Packages
38+
run: |
39+
composer require "hyperf/utils: $HF_VERSION"
40+
composer update -o
41+
- name: Run Test Cases
42+
run: |
43+
vendor/bin/php-cs-fixer fix --dry-run
44+
composer analyse
45+
composer test

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require": {
2323
"php": ">=7.4",
2424
"doctrine/instantiator": "^1.0",
25-
"hyperf/utils": "^2.0|^3.0",
25+
"hyperf/utils": "^2.2|^3.0",
2626
"pimple/pimple": "^3.3"
2727
},
2828
"require-dev": {

0 commit comments

Comments
 (0)