-
Notifications
You must be signed in to change notification settings - Fork 42
92 lines (84 loc) · 2.9 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: PHPUnit
on: [ push, pull_request ]
env:
SWOOLE_VERSION: '4.8.6'
SWOW_VERSION: 'develop'
jobs:
ci:
name: Test PHP ${{ matrix.php-version }} on ${{ matrix.engine }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.0', '8.1' ]
engine: [ 'none', 'swoole', 'swow' ]
max-parallel: 6
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpize
ini-values: |
opcache.enable_cli=1
coverage: none
- name: Setup Swoole
if: ${{ matrix.engine == 'swoole' }}
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -f
sudo apt-get install libcurl4-openssl-dev
wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
mkdir -p swoole
tar -xf swoole.tar.gz -C swoole --strip-components=1
rm swoole.tar.gz
cd swoole
phpize
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
make -j$(nproc)
sudo make install
sudo sh -c "echo extension=swoole > /etc/php/${{ matrix.php-version }}/cli/conf.d/swoole.ini"
php --ri swoole
- name: Setup Swow
if: ${{ matrix.engine == 'swow' }}
run: |
wget https://github.com/swow/swow/archive/"${SWOW_VERSION}".tar.gz -O swow.tar.gz
mkdir -p swow
tar -xf swow.tar.gz -C swow --strip-components=1
rm swow.tar.gz
cd swow/ext || exit
phpize
./configure --enable-debug
make -j "$(nproc)"
sudo make install
sudo sh -c "echo extension=swow > /etc/php/${{ matrix.php-version }}/cli/conf.d/swow.ini"
php --ri swow
- name: Setup Packages
run: |
composer update -o --no-scripts
composer update doctrine/instantiator:^1.0
composer require symfony/finder:^5.0
composer require hyperf/di
composer require hyperf/grpc-client
composer require hyperf/framework
composer require psr/log:^1.0
composer require symfony/console:^5.0
composer require hyperf/server
composer require hyperf/http-server
composer require hyperf/db
composer require hyperf/db-connection
composer require hyperf/json-rpc
composer require hyperf/rpc-client
composer require symfony/serializer:^5.0
- name: Setup Swow Packages
if: ${{ matrix.engine == 'swow' }}
run: |
composer require hyperf/engine-swow
- name: Run Test Cases
run: |
composer analyse
composer test