Skip to content

[4.8]Fix bug #5104 (#5113) #1258

[4.8]Fix bug #5104 (#5113)

[4.8]Fix bug #5104 (#5113) #1258

Workflow file for this run

name: Frameworks Tests
on:
push:
pull_request:
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1' ]
framework: [ 'Laravel Octane', 'Hyperf', 'Simps', 'imi' ]
include:
- os: ubuntu-latest
php-version: '7.4'
framework: 'Hyperf'
- os: ubuntu-latest
php-version: '7.4'
framework: 'imi'
exclude:
- php-version: '8.1'
framework: 'Hyperf'
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, curl, libxml, mbstring, zip, redis, pdo, pdo_mysql, bcmath
tools: phpize, composer:v2
ini-values: extension=swoole
coverage: none
- name: Build Swoole
run: |
sudo apt update -y && sudo apt install -y libcurl4-openssl-dev php-curl libc-ares-dev
phpize
./configure --enable-openssl --enable-mysqlnd --enable-http2 --enable-swoole-curl --enable-cares
make -j$(nproc)
sudo make install
php --ri swoole
- name: Laravel Octane Tests
if: matrix.framework == 'Laravel Octane'
run: |
git clone https://github.com/laravel/octane.git --depth=1
cd octane/
composer require laravel/framework:"^8.35" --no-update
composer update --prefer-dist --no-interaction --no-progress
vendor/bin/phpunit --verbose
- name: Hyperf Tests
if: matrix.framework == 'Hyperf'
env:
SW_VERSION: 'master'
MYSQL_VERSION: '5.7'
run: |
git clone -b 2.2 https://github.com/hyperf/hyperf.git --depth=1
cd hyperf/
composer update -o
docker run --name mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mysql:${MYSQL_VERSION} --bind-address=0.0.0.0 --default-authentication-plugin=mysql_native_password
docker run --name redis -p 6379:6379 -d redis
docker run -d --name dev-consul -e CONSUL_BIND_INTERFACE=eth0 -p 8500:8500 consul
docker run --name nsq -p 4150:4150 -p 4151:4151 -p 4160:4160 -p 4161:4161 -p 4170:4170 -p 4171:4171 --entrypoint /bin/nsqd -d nsqio/nsq:latest
docker run -d --restart=always --name rabbitmq -p 4369:4369 -p 5672:5672 -p 15672:15672 -p 25672:25672 rabbitmq:management-alpine
docker build --tag grpc-server:latest src/grpc-client/tests/Mock
docker run -d --name grpc-server -p 50051:50051 grpc-server:latest
docker build -t tcp-server:latest .travis/tcp_server
docker run -d --name tcp-server -p 10001:10001 tcp-server:latest
export TRAVIS_BUILD_DIR=$(pwd) && bash ./.travis/setup.mysql.sh
cp .travis/.env.example .env
composer analyse src
composer test -- --exclude-group NonCoroutine
vendor/bin/phpunit --group NonCoroutine
vendor/bin/phpunit src/filesystem --group NonCoroutine
- name: Simps Tests
if: matrix.framework == 'Simps'
run: |
git clone https://github.com/simps/mqtt.git --depth=1
cd mqtt/
composer install -o
composer test
- name: imi Tests
if: matrix.framework == 'imi'
env:
SW_VERSION: 'master'
MYSQL_VERSION: '5.7'
MYSQL_SERVER_PASSWORD:
run: |
git clone -b 2.1 https://github.com/imiphp/imi.git --depth=1
cd imi/
composer update -o
docker run --name mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mysql:${MYSQL_VERSION} --bind-address=0.0.0.0 --default-authentication-plugin=mysql_native_password
docker run --name redis -p 6379:6379 -d redis
docker run -d --restart=always --name rabbitmq -p 4369:4369 -p 5672:5672 -p 15672:15672 -p 25672:25672 rabbitmq:management-alpine
mysql -h 127.0.0.1 -u root -e "CREATE DATABASE IF NOT EXISTS db_imi_test charset=utf8mb4 collate=utf8mb4_unicode_ci;"
./tests/db/install-db.sh
composer test-swoole
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1' ]
framework: [ 'Simps' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }} - macOS
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, curl, libxml, mbstring, zip, redis, pdo, pdo_mysql, bcmath
tools: phpize, composer:v2
ini-values: extension=swoole
coverage: none
- name: Build Swoole
run: |
brew install openssl && brew link openssl
brew install c-ares && brew link c-ares
phpize
./configure --enable-openssl --with-openssl-dir=/usr/local/opt/[email protected] --enable-mysqlnd --enable-http2 --enable-swoole-curl --enable-cares
make -j$(sysctl -n hw.logicalcpu)
sudo make install
php --ri swoole
- name: Simps Tests
if: matrix.framework == 'Simps'
run: |
git clone https://github.com/simps/mqtt.git --depth=1
cd mqtt/
composer install -o
composer test