-
Notifications
You must be signed in to change notification settings - Fork 3.2k
139 lines (125 loc) Β· 5.12 KB
/
framework.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Framework Tests
on:
push:
pull_request:
env:
CPPFLAGS: "-I/opt/homebrew/opt/pcre2/include/"
jobs:
linux:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[framework]')"
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
framework: [ 'Laravel Octane', 'Hyperf', 'Simps', 'imi' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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 libpq-dev valgrind
phpize
./configure --enable-openssl --enable-mysqlnd --enable-swoole-curl --enable-cares --enable-swoole-pgsql
make -j$(nproc)
sudo make install
php -v
php -m
php --ini
php --ri swoole
- name: Laravel Octane Tests
if: matrix.framework == 'Laravel Octane' && matrix.php-version != '8.0'
run: |
git clone https://github.com/laravel/octane.git --depth=1
cd octane/
composer update --prefer-dist --no-interaction --no-progress
vendor/bin/phpunit
- name: Hyperf Tests
if: matrix.framework == 'Hyperf' && matrix.php-version != '8.0'
env:
SW_VERSION: 'master'
MYSQL_VERSION: '5.7'
PGSQL_VERSION: '14'
run: |
git clone https://github.com/hyperf/hyperf.git --depth=1
cd hyperf/
composer update -o
./.travis/requirement.install.sh
./.travis/setup.services.sh
export TRAVIS_BUILD_DIR=$(pwd) && bash ./.travis/setup.mysql.sh
export TRAVIS_BUILD_DIR=$(pwd) && bash ./.travis/setup.pgsql.sh
cp .travis/.env.example .env
export SWOOLE_BRANCH=${GITHUB_REF##*/}
if [ "${SWOOLE_BRANCH}" = "valgrind" ]; then
USE_ZEND_ALLOC=0 valgrind php -dswoole.use_shortname='Off' bin/co-phpunit --exclude-group NonCoroutine
USE_ZEND_ALLOC=0 valgrind php -dswoole.use_shortname='Off' vendor/bin/phpunit --group NonCoroutine
USE_ZEND_ALLOC=0 valgrind php -dswoole.use_shortname='Off' vendor/bin/phpunit src/filesystem --group NonCoroutine
else
.travis/run.test.sh
fi
- 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:
MYSQL_VERSION: '5.7'
MYSQL_SERVER_PASSWORD:
run: |
docker run --name mysql -d -p 3306:3306 --health-cmd="mysqladmin ping --silent" --health-interval=1s --health-retries=60 --health-timeout=3s -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:${MYSQL_VERSION} --bind-address=0.0.0.0 --default-authentication-plugin=mysql_native_password
docker run --name redis -d -p 6379:6379 redis
docker run --name rabbitmq -d -p 4369:4369 -p 5672:5672 -p 15672:15672 -p 25672:25672 rabbitmq:management-alpine
git clone -b 2.1 https://github.com/imiphp/imi.git --depth=1
cd imi/
composer update -o
timeout 60s sh -c 'until docker ps | grep mysql | grep -q healthy; do echo "Waiting for container to be healthy..."; sleep 1; done'
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:
if: "!contains(github.event.head_commit.message, '[test]')"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1', '8.2', '8.3' ]
framework: [ 'Simps' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }} - macOS
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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: |
phpize
./configure CPPFLAGS="${CPPFLAGS}" --enable-openssl --enable-mysqlnd --enable-swoole-curl --enable-cares
make -j$(sysctl -n hw.ncpu)
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