Skip to content

Commit

Permalink
Merge branch 'master' into coverity_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Jan 24, 2024
2 parents 1779935 + 2dcfef9 commit 1df8fcf
Show file tree
Hide file tree
Showing 406 changed files with 31,338 additions and 6,907 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN set -ex \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl \
&& make -s -j$(nproc) && make install \
&& echo "extension=swoole.so" > /etc/php${PHP_VERSION%\.*}/conf.d/50_swoole.ini \
&& echo "extension=swoole.so" > /etc/php$(echo $PHP_VERSION | sed 's/\.//g')/conf.d/50_swoole.ini \
# check
&& php -v \
&& php -m \
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/conflict-exts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: conflict-exts

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2', '8.3']

name: PHP ${{ matrix.php }} - Swoole

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpize
ini-values: extension=swoole
coverage: xdebug
- name: Build Swoole
run: |
phpize
./configure
make -j$(nproc)
sudo make install
- name: Check extension conflict
run: |
php -v
php -m
php --ri swoole
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.repository_owner == 'swoole'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[test]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install-deps
run: sudo apt update -y && sudo apt install -y libcurl4-openssl-dev php-curl libc-ares-dev
- name: phpize
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- name: install dependencies
run: brew install openssl && brew link openssl && brew install curl && brew link curl && brew install c-ares && brew link c-ares
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: phpize
run: phpize
- name: build1
Expand Down Expand Up @@ -72,15 +72,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.0', '8.1' ]
alpine-version: [ '3.14', '3.15' ]
php-version: [ '8.1', '8.2', '8.3' ]
alpine-version: [ '3.16', '3.17', '3.18', '3.19', 'edge' ]
exclude:
- php-version: '8.1'
alpine-version: '3.15'
- php-version: '8.3'
alpine-version: '3.16'
- php-version: '8.3'
alpine-version: '3.17'
- php-version: '8.3'
alpine-version: '3.18'
- php-version: '8.2'
alpine-version: '3.16'
- php-version: '8.2'
alpine-version: '3.17'
max-parallel: 8
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build
run: |
cp .github/workflows/alpine.Dockerfile alpine.Dockerfile
Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1' ]
php-version: [ '8.0', '8.1', '8.2', '8.3' ]
framework: [ 'Laravel Octane', 'Hyperf', 'Simps', 'imi' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -40,16 +40,15 @@ jobs:
php --ri swoole
- name: Laravel Octane Tests
if: matrix.framework == 'Laravel Octane'
if: matrix.framework == 'Laravel Octane' && matrix.php-version != '8.0'
run: |
git clone https://github.com/laravel/octane.git --depth=1
cd octane/
composer require laravel/framework:"^8.35" --no-update
composer update --prefer-dist --no-interaction --no-progress
vendor/bin/phpunit --verbose
vendor/bin/phpunit
- name: Hyperf Tests
if: matrix.framework == 'Hyperf'
if: matrix.framework == 'Hyperf' && matrix.php-version != '8.0'
env:
SW_VERSION: 'master'
MYSQL_VERSION: '5.7'
Expand All @@ -63,9 +62,14 @@ jobs:
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
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
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'
Expand All @@ -78,16 +82,16 @@ jobs:
- name: imi Tests
if: matrix.framework == 'imi'
env:
SW_VERSION: 'master'
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
docker run --name mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mysql:${MYSQL_VERSION} --bind-address=0.0.0.0 --default-authentication-plugin=mysql_native_password
docker run --name redis -p 6379:6379 -d redis
docker run -d --restart=always --name rabbitmq -p 4369:4369 -p 5672:5672 -p 15672:15672 -p 25672:25672 rabbitmq:management-alpine
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
Expand All @@ -98,12 +102,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1' ]
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@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
PROXY_SERVER: 0.0.0.0:1080

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: install dependencies
run: sudo apt update -y && sudo apt install -y googletest libgtest-dev redis-server libboost-stacktrace-dev libbrotli-dev
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
- name: Show machine information
run: |
date
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT(libswoole)

ENABLE_LANGUAGE(ASM)
set(SWOOLE_VERSION 5.0.2-dev)
set(SWOOLE_VERSION 5.1.2)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -g")
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,21 @@ Co\run(function() {

### Supported extension/functions

* `ext-curl` (Support `symfony` and `guzzle`)
* `ext-redis`
* `ext-mysqli`
* `ext-pdo_mysql`
* `ext-curl` (Support `symfony` or `guzzle`)
* `ext-pdo_pgsql`
* `ext-pdo_sqlite`
* `ext-pdo_oracle`
* `ext-pdo_odbc`
* `stream functions` (e.g. `stream_socket_client`/`stream_socket_server`), Supports `TCP`/`UDP`/`UDG`/`Unix`/`SSL/TLS`/`FileSystem API`/`Pipe`
* `ext-socket`
* `ext-sockets`
* `ext-soap`
* `sleep`/`usleep`/`time_sleep_until`
* `proc_open`
* `gethostbyname`/`shell_exec`/`exec`
* `fread`/`fopen`/`fsockopen`/`fwrite`
* `fread`/`fopen`/`fsockopen`/`fwrite`/`flock`


## 🛠 Develop & Discussion
Expand Down
Loading

0 comments on commit 1df8fcf

Please sign in to comment.