-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from forkgroup/2.2-unit
Added v2.1 support for Hyperf
- Loading branch information
Showing
3 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: PHPUnit | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
SWOOLE_VERSION: '4.7.0' | ||
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: ['7.3', '7.4', '8.0'] | ||
engine: ['none', 'swoole', 'swow'] | ||
max-parallel: 5 | ||
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=1 | ||
coverage: none | ||
- name: Setup Swoole | ||
if: ${{ matrix.engine == 'swoole' }} | ||
run: | | ||
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 | ||
- name: Run Test Cases | ||
run: | | ||
composer analyse | ||
composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/usr/bin/env bash | ||
wget https://github.com/swoole/swoole-src/archive/v"${SW_VERSION}".tar.gz -O swoole.tar.gz | ||
sudo apt-get update | ||
sudo apt-get install libcurl4-openssl-dev | ||
wget https://github.com/swoole/swoole-src/archive/${SW_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 || exit | ||
cd swoole | ||
phpize | ||
./configure --enable-openssl --enable-mysqlnd --enable-http2 | ||
make -j "$(nproc)" | ||
make install | ||
./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/${PHP_VERSION}/cli/conf.d/swoole.ini" | ||
sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini" | ||
php --ri swoole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters