Refactoring laravel worker architecture #123
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
name: test-Laravel | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-unix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
php: [ '8.1', '8.2', '8.3' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 安装环境 (Setup PHP) | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: posix, sockets, pcntl, openssl, curl, ev, fileinfo, sqlite3 | |
- name: 安装框架 (Install Laravel) | |
run: | | |
composer install | |
composer create-project --prefer-dist laravel/laravel laravel-app | |
- name: 安装引擎 (Initialize ripple) | |
working-directory: laravel-app | |
run: | | |
composer require cloudtay/ripple-driver | |
cp -r ../src vendor/cloudtay/ripple-driver/ | |
- name: 初始化测试路由 (Initialize Test Route) | |
working-directory: laravel-app | |
run: | | |
echo "RIP_HTTP_WORKERS=1" >> .env | |
cp ./vendor/cloudtay/ripple-driver/src/Laravel/Tests/routes-test.php routes/test.php | |
php artisan vendor:publish --tag=ripple-config | |
php artisan optimize | |
- name: 启动引擎服务 (Start Server) | |
working-directory: laravel-app | |
run: | | |
php artisan ripple:server start & | |
sleep 1 | |
- name: 压力测试 (Run Stress testing) | |
working-directory: laravel-app | |
run: | | |
ab -n 1000 -c 20 -k http://127.0.0.1:8008/ | |
- name: 内存泄漏测试 (Run Memory leak testing) | |
run: ./vendor/bin/phpunit | |
- name: 关闭服务 (Stop Server) | |
working-directory: laravel-app | |
run: php artisan ripple:server stop |