Skip to content

[6.0]add aarch64 unit test #5722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
framework: [ 'Laravel Octane', 'Hyperf', 'Simps' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
steps:
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/iouring.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Linux io_uring Tests

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
test-linux:
unit-testing:
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[iouring]')"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.1-zts', '8.2-zts', '8.3-zts']
name: ${{ matrix.php }}
php: [ '8.1', '8.2', '8.3', '8.4', '8.1-zts', '8.2-zts', '8.3-zts', '8.4-zts' ]
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
name: ${{ matrix.php }}-${{ matrix.os }}-iouring
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
Expand All @@ -20,20 +21,13 @@ jobs:
coverage: none
- name: Show machine information
run: |
date
env
uname -a
ulimit -a
php -v
php --ini
ls -al
pwd
echo "`git log -20 --pretty --oneline`"
echo "`git log -10 --stat --pretty --oneline`"
- name: Run Swoole test
run: |
export SWOOLE_CI_TYPE=IOURING
export SWOOLE_BRANCH=${GITHUB_REF##*/}
export SWOOLE_USE_IOURING=1
export SWOOLE_BUILD_DIR=$(realpath .)
export PHP_VERSION=${{ matrix.php }}
${SWOOLE_BUILD_DIR}/scripts/route.sh
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/pecl-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pecl Package

on: [ push, pull_request ]

jobs:
pecl-package:
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[unit]')"
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4', '8.1-zts', '8.2-zts', '8.3-zts', '8.4-zts' ]
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
name: ${{ matrix.php }}-${{ matrix.os }}-pecl
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
- name: Show machine information
run: |
php -v
echo "`git log -20 --pretty --oneline`"
echo "`git log -10 --stat --pretty --oneline`"
- name: Run pecl-install.sh
run: |
sudo ${{runner.workspace}}/swoole-src/scripts/pecl-install.sh
16 changes: 5 additions & 11 deletions .github/workflows/thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ name: Thread Support Tests
on: [push, pull_request]

jobs:
test-linux:
runs-on: ubuntu-latest
unit-testing:
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[thread]')"
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
php: ['8.1-zts', '8.2-zts', '8.3-zts', '8.4-zts']
name: ${{ matrix.php }}
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
name: ${{ matrix.php }}-thread-${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
Expand All @@ -23,20 +24,13 @@ jobs:
phpts: ts
- name: Show machine information
run: |
date
env
uname -a
ulimit -a
php -v
php --ini
ls -al
pwd
echo "`git log -20 --pretty --oneline`"
echo "`git log -10 --stat --pretty --oneline`"
- name: Run tests
run: |
export SWOOLE_CI_TYPE=THREAD
export SWOOLE_BRANCH=${GITHUB_REF##*/}
export SWOOLE_THREAD=1
export SWOOLE_BUILD_DIR=$(realpath .)
export PHP_VERSION=${{ matrix.php }}
${SWOOLE_BUILD_DIR}/scripts/route.sh
19 changes: 6 additions & 13 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ name: Unit Tests
on: [push, pull_request]

jobs:
test-linux:
runs-on: ubuntu-latest
unit-testing:
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[unit]')"
timeout-minutes: 15
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
name: ${{ matrix.php }}-${{ matrix.os }}-test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
Expand All @@ -20,21 +22,12 @@ jobs:
coverage: none
- name: Show machine information
run: |
date
env
uname -a
ulimit -a
php -v
php --ini
ls -al
pwd
echo "`git log -20 --pretty --oneline`"
echo "`git log -10 --stat --pretty --oneline`"
- name: Run pecl-install.sh
run: |
sudo ${{runner.workspace}}/swoole-src/scripts/pecl-install.sh
- name: Run unit tests
run: |
export SWOOLE_CI_TYPE=NORMAL
export SWOOLE_BRANCH=${GITHUB_REF##*/}
export SWOOLE_BUILD_DIR=$(realpath .)
export PHP_VERSION=${{ matrix.php }}
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/xdebug.yml

This file was deleted.

3 changes: 2 additions & 1 deletion include/swoole_static_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class StaticHandler {

const char *get_content_type() {
if (tasks.size() > 1) {
content_type = std::string("multipart/byteranges; boundary=") + get_boundary();
content_type = "multipart/byteranges; boundary=";
content_type += get_boundary();
return content_type.c_str();
} else {
return get_mimetype();
Expand Down
45 changes: 28 additions & 17 deletions scripts/docker-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,45 @@
__CURRENT__=$(pwd)
__DIR__=$(cd "$(dirname "$0")";pwd)

sh library.sh

if [ ! -f "/.dockerenv" ]; then
echo "" && echo "❌ This script is just for Docker!"
exit
fi

cd "${__DIR__}" && cd ..
./scripts/clear.sh
sh library.sh
cd "${__DIR__}/.." && ./scripts/clear.sh
phpize
./configure \
--enable-brotli \
--enable-zstd \
--enable-openssl \
--enable-sockets \
--enable-mysqlnd \
--enable-swoole-curl \
--enable-cares \
--enable-swoole-pgsql \
--with-swoole-odbc=unixODBC,/usr \
--with-swoole-oracle=instantclient,/usr/local/instantclient \
--enable-swoole-sqlite

option="--enable-brotli \
--enable-zstd \
--enable-openssl \
--enable-sockets \
--enable-mysqlnd \
--enable-swoole-curl \
--enable-cares \
--enable-swoole-pgsql \
--with-swoole-odbc=unixODBC,/usr \
--with-swoole-oracle=instantclient,/usr/local/instantclient \
--enable-swoole-sqlite"

if [ "$SWOOLE_THREAD" = 1 ]; then
./configure $option --enable-swoole-thread
elif [ "$SWOOLE_IOURING" = 1 ]; then
if [ -n "$(php -v | grep "ZTS")" ]; then
echo "" && echo "🚀 php zts + swoole thread mode + iouring!"
./configure --enable-iouring --enable-swoole-thread
else
echo "" && echo "🚀 php nts + swoole + iouring!"
./configure --enable-iouring
fi
else
./configure $option
fi

make -j$(cat /proc/cpuinfo | grep processor | wc -l)
make install
docker-php-ext-enable swoole
php -v
php -m
php --ri curl
php --ri swoole

19 changes: 11 additions & 8 deletions scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
command: tail -f /etc/group
mysql:
container_name: "mysql"
image: "phpswoole/mysql:5.6"
image: "mysql:latest"
volumes:
- ./data/mysql:/var/lib/mysql:rw
- ./data/run/mysqld:/var/run/mysqld:rw
Expand All @@ -47,28 +47,31 @@ services:
- "1521:1521"
redis:
container_name: "redis"
image: "phpswoole/redis:latest"
image: "redis:latest"
volumes:
- ./data/redis:/var/lib/redis:rw
- ./data/run/redis:/var/run/redis:rw
sysctls:
net.core.somaxconn: 65535
httpbin:
container_name: "httpbin"
image: "kennethreitz/httpbin"
image: "arnaudlacour/httpbin"
tinyproxy:
container_name: "tinyproxy"
image: "vimagick/tinyproxy"
image: "kalaksi/tinyproxy"
golang-h2demo:
container_name: "golang-h2demo"
image: "phpswoole/golang-h2demo"
socks5:
container_name: "socks5"
image: "xkuma/socks5"
image: "serjs/go-socks5-proxy"
ports:
- "1080:1080"
ftp:
container_name: "ftp"
image: "fauria/vsftpd"
image: "crazymax/pure-ftpd"
environment:
FTP_USER: admin
FTP_PASS: admin
FTP_USER_NAME: admin
FTP_USER_PASS: admin
FTP_USER_HOME: /home/swoole

16 changes: 10 additions & 6 deletions scripts/docker-route.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
__CURRENT__=$(pwd)
__DIR__=$(cd "$(dirname "$0")";pwd)

# enter the dir
cd "${__DIR__}"

# show system info
# show system info and php info
date && echo ""
uname -a && echo ""

# show php info
php -v && echo ""

# enter the dir
cd "${__DIR__}"

if [ "$1" = "THREAD" ]; then
export SWOOLE_THREAD=1
elif [ "$1" = "IOURING" ]; then
export SWOOLE_IOURING=1
fi

# compile in docker
echo "" && echo "📦 Compile test in docker..." && echo ""
./docker-compile.sh
Expand Down
29 changes: 22 additions & 7 deletions scripts/library.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
#!/bin/sh -e
if [ "$(uname -m)" = "aarch64" ]; then
arch="-arm64"
else
arch="x64"
fi

apt update
apt install -y libaio-dev libaio1 sqlite3 libsqlite3-dev unixodbc unixodbc-dev odbc-mariadb libzstd-dev
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip
apt install -y cmake make gcc libssl-dev libmariadb-dev unixodbc-dev libaio-dev libaio1 sqlite3 libsqlite3-dev libzstd-dev
wget https://github.com/mariadb-corporation/mariadb-connector-odbc/archive/refs/tags/3.1.21.tar.gz
tar zxf 3.1.21.tar.gz
mkdir build
cd build
cmake ../mariadb-connector-odbc-3.1.21/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_SSL=OPENSSL
cmake --build . --config RelWithDebInfo
make install
echo '/usr/local/lib/mariadb/' > /etc/ld.so.conf.d/odbc-mariadb.conf
ldconfig

wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linux${arch}.zip
unzip instantclient-basiclite-linux${arch}.zip && rm instantclient-basiclite-linux${arch}.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linux${arch}.zip
unzip instantclient-sdk-linux${arch}.zip && rm instantclient-sdk-linux${arch}.zip
mv instantclient_*_* ./instantclient
rm ./instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > ./instantclient/network/admin/sqlnet.ora
echo DISABLE_INTERRUPT=on >./instantclient/network/admin/sqlnet.ora
mv ./instantclient /usr/local/
echo '/usr/local/instantclient' > /etc/ld.so.conf.d/oracle-instantclient.conf
ldconfig

wget https://github.com/axboe/liburing/archive/refs/tags/liburing-2.6.tar.gz
tar zxf liburing-2.6.tar.gz
cd liburing-liburing-2.6 && ./configure && make -j$(cat /proc/cpuinfo | grep processor | wc -l) && make install

Loading
Loading