[5.1]v5.1.5 release #2169
Workflow file for this run
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
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' ] | |
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 | |