-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.65 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: PHPUnit for Hyperf
on: [ push, pull_request ]
jobs:
ci:
name: Test on PHP ${{ matrix.php-version }} Swoole ${{ matrix.swoole-version }}
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.1', '8.2', '8.3' ]
swoole-version: [ 'v5.0.3', 'v5.1.1', 'master' ]
exclude:
- php-version: '8.3'
swoole-version: 'v5.0.3'
max-parallel: 9
env:
SW_VERSION: ${{ matrix.swoole-version }}
PHP_VERSION: ${{ matrix.php-version }}
PHP_CS_FIXER_IGNORE_ENV: 1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpize
ini-values: opcache.enable_cli=0
coverage: none
extensions: pdo, pdo_mysql, redis
- name: Setup Swoole
run: ./.github/swoole.install.sh
- name: Setup MySQL ...
run: |
docker run -e TZ=Asia/Shanghai -e MYSQL_ALLOW_EMPTY_PASSWORD=true -e MYSQL_ROOT_HOST=% -e MYSQL_DATABASE=hyperf -v $PWD/.github/init.sql:/docker-entrypoint-initdb.d/init.sql -d -p 3306:3306 --name mysql mysql/mysql-server:5.7
docker run -p 6379:6379 -d --name redis redis:latest
- name: Show Environment
run: |
php -v
php -m
php -i
- name: Setup Packages
run: composer update -o
- name: Run Test Cases
run: |
cp .env.example .env
vendor/bin/php-cs-fixer fix --dry-run
composer analyse
composer test -- --exclude-group OpenSSL