-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (51 loc) · 1.72 KB
/
thinkphp.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
name: test-ThinkPHP
on:
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 ThinkPHP)
run: |
composer install
composer create-project topthink/think thinkphp-app
- name: 安装引擎 (Initialize ripple)
working-directory: thinkphp-app
run: |
composer config repositories.local '{"type": "path", "url": "../"}'
composer require cloudtay/ripple-driver
cp -r ../src vendor/cloudtay/ripple-driver/
- name: 初始化测试路由 (Initialize Test Route)
working-directory: thinkphp-app
run: |
echo "PRP_HTTP_WORKERS=1" >> .env
cp ./vendor/cloudtay/ripple-driver/src/ThinkPHP/Tests/routes-test.php route/test.php
- name: 启动引擎服务 (Start Server)
working-directory: thinkphp-app
run: |
php think ripple:server start &
sleep 1
- name: 压力测试 (Run Stress testing)
working-directory: thinkphp-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: thinkphp-app
run: php think ripple:server stop