Added test cases for hyperf-engine. #3765
Workflow file for this run
This file contains hidden or 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: | |
| 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.1', '8.2', '8.3', '8.4' ] | |
| framework: [ 'Laravel Octane', 'Hyperf', 'Hyperf Engine', 'Simps' ] | |
| name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - 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.1' | |
| run: | | |
| git clone https://github.com/laravel/octane.git --depth=1 | |
| cd octane/ | |
| composer update --prefer-dist --no-interaction --no-progress | |
| vendor/bin/testbench package:sync-skeleton | |
| vendor/bin/phpunit --display-deprecations --fail-on-deprecation | |
| - name: Hyperf Tests | |
| if: matrix.framework == 'Hyperf' && matrix.php-version != '8.4' | |
| 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: Hyperf Engine Tests | |
| if: matrix.framework == 'Hyperf Engine' | |
| run: | | |
| git clone https://github.com/hyperf/engine.git --depth=1 | |
| cd engine/ | |
| composer update -o | |
| php examples/http_server.php | |
| php examples/tcp_packet_server.php | |
| php examples/websocket_server.php | |
| php examples/http_server_v2.php | |
| vendor/bin/php-cs-fixer fix --dry-run | |
| composer analyse | |
| composer test | |
| - 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 | |
| macos: | |
| if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[framework]')" | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: [ '8.1', '8.2', '8.3' ] | |
| framework: [ 'Simps' ] | |
| name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }} - macOS | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - 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 | |
| export CPPFLAGS="${CPPFLAGS} -I/opt/homebrew/opt/pcre2/include/" | |
| export CFLAGS="${CFLAGS} -I/opt/homebrew/opt/pcre2/include/" | |
| ./configure --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 | |