-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
9 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,84 @@ | ||
name: test-Unix | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-unix: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: [ '8.2','8.3','8.4' ] | ||
|
||
steps: | ||
# 检出代码 | ||
- uses: actions/checkout@v3 | ||
|
||
# 安装 PHP 和扩展 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: posix, sockets, pcntl, openssl, curl, ev, fileinfo, sqlite3 | ||
|
||
# 安装Apache Benchmark | ||
- name: Install Apache Benchmark | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install apache2-utils -y | ||
# 安装 Composer 依赖 | ||
- name: Install Laravel | ||
run: | | ||
composer install | ||
composer create-project --prefer-dist laravel/laravel app "^11.0" | ||
# 配置 Laravel 引擎插件 | ||
- name: Initialize ripple | ||
working-directory: app | ||
run: | | ||
composer config repositories.local-plugin path ../ | ||
composer require cloudtay/laravel-ripple:dev-main | ||
# 初始化测试路由 | ||
- name: Initialize Test Route | ||
working-directory: app | ||
run: | | ||
echo "RIP_HTTP_LISTEN=http://127.0.0.1:8008" >> .env | ||
echo "RIP_HTTP_WORKERS=1" >> .env | ||
php artisan vendor:publish --tag=ripple-config | ||
php artisan optimize | ||
# 启动引擎服务 | ||
- name: Start Server | ||
working-directory: app | ||
run: | | ||
php artisan ripple:server start > server.log 2>&1 & | ||
echo $! > server.pid | ||
sleep 10 | ||
# 访问测试 | ||
- name: Run Test | ||
working-directory: app | ||
run: | | ||
curl http://127.0.0.1:8008/ > curl.log | ||
# 压力测试 | ||
- name: Run Stress testing | ||
working-directory: app | ||
run: | | ||
ab -n 1000 -c 20 -k http://127.0.0.1:8008/ | ||
# 关闭服务 | ||
- name: Stop Server | ||
working-directory: app | ||
run: | | ||
php artisan ripple:server stop |
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
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,3 +1,3 @@ | ||
RIP_HTTP_LISTEN=http://127.0.0.1:8008 | ||
RIP_HTTP_WORKERS=4 | ||
RIP_HTTP_RELOAD=0 | ||
RIP_HTTP_RELOAD=1 |
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
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