Add stdext module for swoole-cli and enhance PHP standard library #1391
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: Unit Tests | |
on: [push, pull_request] | |
jobs: | |
linux: | |
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'] | |
os: [ ubuntu-24.04, ubuntu-24.04-arm ] | |
name: ${{ matrix.php }}-${{ matrix.os }} | |
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: | | |
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 unit tests | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
run: | | |
export SWOOLE_CI_TYPE=NORMAL | |
export SWOOLE_BRANCH=${GITHUB_REF##*/} | |
export SWOOLE_BUILD_DIR=$(realpath .) | |
export PHP_VERSION=${{ matrix.php }} | |
${{runner.workspace}}/swoole-src/scripts/route.sh | |
macos: | |
runs-on: macos-latest | |
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[macos-unit]')" | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
# php-version: [ '8.1', '8.2', '8.3', '8.4' ] | |
php-version: [ '8.1' ] | |
name: ${{ 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, sockets | |
tools: phpize, composer:v2 | |
ini-values: extension=swoole | |
coverage: none | |
- name: Install dependencies | |
run: | | |
brew install redis tinyproxy nginx md5sha1sum | |
brew services start redis | |
brew services start nginx | |
brew services start tinyproxy | |
- name: Build Swoole | |
run: | | |
phpize | |
export PCRE2_INCLUDE_DIR="/opt/homebrew/opt/pcre2/include" | |
export CPPFLAGS="${CPPFLAGS} -I${PCRE2_INCLUDE_DIR}" | |
export CFLAGS="${CFLAGS} -I${PCRE2_INCLUDE_DIR}" | |
./configure CPPFLAGS="${CPPFLAGS}" --enable-openssl --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares --enable-zstd | |
make -j$(sysctl -n hw.ncpu) | |
sudo make install | |
php --ri swoole | |
uname -a | |
- 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-version }} | |
export SWOOLE_CI_IN_MACOS=1 | |
cd ${{runner.workspace}}/swoole-src | |
ulimit -n 100000 | |
./scripts/run-tests.sh |