Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cddc1b5
#9: Basic tests for Deadlock and Zombie coroutine cases.
EdmondDantes Jul 5, 2025
68dd020
#9: + protect tests
EdmondDantes Jul 5, 2025
e0f6fcc
Merge branch 'main' into 9-coroutine-edge-case-tests
EdmondDantes Jul 5, 2025
2ad3504
#9: * fix tests for protect function
EdmondDantes Jul 5, 2025
5a7253e
#9: * Fix for the await code handling the iterator.
EdmondDantes Jul 5, 2025
c3d9542
#9: * Fix for the await code handling the iterator.
EdmondDantes Jul 5, 2025
5f35913
#9: * Fixes in the zend_iterator logic in the context of concurrent i…
EdmondDantes Jul 5, 2025
019694e
#9: * Refactoring of the await iterator. Changes to the iterator owne…
EdmondDantes Jul 5, 2025
4485089
#9: * Refactoring of the await iterator.
EdmondDantes Jul 6, 2025
fdd3d89
#9: * Refactoring of the await iterator.
EdmondDantes Jul 6, 2025
c62be8c
#9: * Fixed the logic of the Await iterator.
EdmondDantes Jul 6, 2025
5f3ad9b
#9: * Standardize async await tests to use interruption pattern
EdmondDantes Jul 6, 2025
3997469
#9: * fix memory issues with await iterator
EdmondDantes Jul 6, 2025
d321432
#9: % The logic for overlapping coroutine exceptions has been changed…
EdmondDantes Jul 6, 2025
b062bb1
#9: * fix EXPECT expression for await tests
EdmondDantes Jul 6, 2025
1925e98
#9: * fix coroutine\003-coroutine_getException_basic.php
EdmondDantes Jul 6, 2025
c4361dd
#9: + Enhance async await test coverage with concurrent iterators and…
EdmondDantes Jul 6, 2025
cfe1f0e
#9: * Fix event callback disposal and improve error handling in TrueA…
EdmondDantes Jul 6, 2025
5e50809
#9: * Correct implementation of the iterator, taking internal changes…
EdmondDantes Jul 6, 2025
2e18182
#9: * Correct implementation of the iterator, taking internal changes…
EdmondDantes Jul 6, 2025
fa6d03d
#9: + Added functionality for proper handling of exceptions from `Zen…
EdmondDantes Jul 7, 2025
f3f6ce9
#9: % refactoring await_iterator_dispose(await_iterator, NULL);
EdmondDantes Jul 7, 2025
d05cde4
#9: % An attempt to cancel a coroutine that is currently running.
EdmondDantes Jul 7, 2025
986bff9
#9: * Fixed the behavior of the concurrent iterator for the generator…
EdmondDantes Jul 7, 2025
0628af8
#9: * Fix edge_cases tests
EdmondDantes Jul 7, 2025
de49ae3
#9: + spawnWith tests
EdmondDantes Jul 7, 2025
1d45b98
#9: + spawnWith tests
EdmondDantes Jul 7, 2025
3ea811f
#9: update build-cross-platform
EdmondDantes Jul 8, 2025
7eae51e
#9: tests: Add comprehensive test coverage for async_API.c error paths
EdmondDantes Jul 8, 2025
bf33b97
#9: * fix await_iterator_handler
EdmondDantes Jul 8, 2025
b8eef9c
#9: * fix await tests with wrong keys
EdmondDantes Jul 8, 2025
780c32b
#9: Add comprehensive scope.c test coverage for critical missing func…
EdmondDantes Jul 8, 2025
fb8f615
#9: * A critical bug in the active coroutines counter has been fixed …
EdmondDantes Jul 8, 2025
de6c4c8
#9: * A critical bug in the active coroutines counter has been fixed …
EdmondDantes Jul 8, 2025
7f5e8c3
#9: + 059-awaitAll-with-duplicates.phpt
EdmondDantes Jul 8, 2025
420f914
#9: + gracefully shutdown tests
EdmondDantes Jul 8, 2025
ecf2fdf
#9: Add comprehensive state transition tests for await operations
EdmondDantes Jul 8, 2025
68fcbec
#9: + Additional tests for coroutines
EdmondDantes Jul 8, 2025
08a16a0
#9: Add comprehensive scope cancellation and hierarchy tests
EdmondDantes Jul 8, 2025
c960643
#9: + 002-context_inheritance.phpt
EdmondDantes Jul 8, 2025
a99cfaa
#9: + fix await tests
EdmondDantes Jul 8, 2025
6645576
#9: * fix test issues
EdmondDantes Jul 8, 2025
fe83017
#9: * fix test issues2
EdmondDantes Jul 8, 2025
089f34b
#9: * fix test issues3
EdmondDantes Jul 8, 2025
d50b73e
#9: + fix context tests and refcount
EdmondDantes Jul 9, 2025
102c398
#9: + fix coroutine tests
EdmondDantes Jul 9, 2025
41bf8fc
#9: + Coroutine: Circular references between coroutines and finally h…
EdmondDantes Jul 9, 2025
0e62cd6
#9: * fixes for Scope tests
EdmondDantes Jul 9, 2025
ceeacf3
#9: * fix scope_try_to_dispose Fixed cyclic Scope release from childr…
EdmondDantes Jul 9, 2025
6fae1be
#9: * clean fprintf
EdmondDantes Jul 9, 2025
f521165
#9: * Fixed a memory leak issue in Scope + onFinally.
EdmondDantes Jul 10, 2025
f5dc529
#9: * fix 034-scope_cancellation_double_error
EdmondDantes Jul 10, 2025
fc258cb
#9: * fix coroutines tests
EdmondDantes Jul 10, 2025
a0958c1
#9: * fix spawn tests
EdmondDantes Jul 10, 2025
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
283 changes: 171 additions & 112 deletions .github/workflows/build-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@ on:
branches: [build]

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: windows
- os: macos-latest
platform: macos

runs-on: ${{ matrix.os }}
# Ubuntu build with database services (matches build.yml)
ubuntu-database-build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.3
env:
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports: ['3306:3306']
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5

postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
ports: ['5432:5432']
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout php-async repo
Expand All @@ -38,83 +52,52 @@ jobs:
mkdir -p php-src/ext/async
cp -r async/* php-src/ext/async/

# ==================== UBUNTU DEPENDENCIES ====================
- name: Install build dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc g++ autoconf bison re2c \
libgmp-dev libicu-dev libtidy-dev libenchant-2-dev \
libzip-dev libbz2-dev libsqlite3-dev libwebp-dev libonig-dev libcurl4-openssl-dev \
libxml2-dev libxslt1-dev libreadline-dev libsodium-dev \
libargon2-dev libjpeg-dev libpng-dev libfreetype6-dev libuv1-dev
g++ --version
sudo mkdir -p /var/lib/snmp && sudo chown $(id -u):$(id -g) /var/lib/snmp

# ==================== WINDOWS DEPENDENCIES ====================
- name: Install build dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
# Install php-sdk
git clone https://github.com/Microsoft/php-sdk-binary-tools.git C:\php-sdk

# Install vcpkg and LibUV
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg.exe install libuv:x64-windows

# Create deps structure for php-sdk
mkdir C:\php-sdk\deps\include\libuv
mkdir C:\php-sdk\deps\lib

# Copy LibUV files
xcopy /E /I C:\vcpkg\installed\x64-windows\include C:\php-sdk\deps\include\libuv\
copy C:\vcpkg\installed\x64-windows\lib\uv.lib C:\php-sdk\deps\lib\libuv.lib
shell: cmd
libgmp-dev libicu-dev libtidy-dev libsasl2-dev \
libzip-dev libbz2-dev libsqlite3-dev libonig-dev libcurl4-openssl-dev \
libxml2-dev libxslt1-dev libpq-dev libreadline-dev libldap2-dev libsodium-dev \
libargon2-dev \
firebird-dev \
valgrind cmake

# ==================== MACOS DEPENDENCIES ====================
- name: Install build dependencies (macOS)
if: matrix.os == 'macos-latest'
- name: Install LibUV >= 1.44.0
run: |
# Core build tools
brew install autoconf automake libtool pkg-config bison

# LibUV - main dependency
brew install libuv

# Fixed package names
brew install tidy-html5 icu4c openssl@3

# Additional dependencies
brew install gmp libzip bzip2 sqlite oniguruma curl
brew install libxml2 libxslt readline libsodium argon2

# Setup environment variables for keg-only packages
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "PATH=$(brew --prefix bison)/bin:$PATH" >> $GITHUB_ENV
# Check if system libuv meets requirements
if pkg-config --exists libuv && pkg-config --atleast-version=1.44.0 libuv; then
echo "System libuv version: $(pkg-config --modversion libuv)"
sudo apt-get install -y libuv1-dev
else
echo "Installing LibUV 1.44.0 from source"
wget https://github.com/libuv/libuv/archive/v1.44.0.tar.gz
tar -xzf v1.44.0.tar.gz
cd libuv-1.44.0
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
sudo ldconfig
cd ../..
fi

# ==================== UBUNTU CONFIGURE & BUILD ====================
- name: Configure PHP (Ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: Configure PHP
working-directory: php-src
run: |
./buildconf -f
./configure \
--enable-zts \
--enable-option-checking=fatal \
--prefix=/usr \
--disable-phpdbg \
--enable-fpm \
--enable-opcache \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pgsql \
--with-pdo-pgsql \
--with-pdo-sqlite \
--enable-intl \
--without-pear \
--enable-gd \
--with-jpeg \
--with-webp \
--with-freetype \
--enable-exif \
--with-zip \
--with-zlib \
--enable-soap \
Expand All @@ -136,11 +119,12 @@ jobs:
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--with-enchant=/usr \
--enable-sysvmsg \
--with-ffi \
--enable-zend-test \
--enable-dl-test=shared \
--with-ldap \
--with-ldap-sasl \
--with-password-argon2 \
--with-mhash \
--with-sodium \
Expand All @@ -150,10 +134,10 @@ jobs:
--enable-inifile \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
--enable-async

- name: Build PHP (Ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: Build PHP
working-directory: php-src
run: |
make -j"$(nproc)"
Expand All @@ -165,6 +149,106 @@ jobs:
echo "opcache.protect_memory=1"
} > /etc/php.d/opcache.ini

- name: Run tests
working-directory: php-src/ext/async
run: |
/usr/local/bin/php -v
/usr/local/bin/php ../../run-tests.php \
-d zend_extension=opcache.so \
-d opcache.enable_cli=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit=tracing \
-d zend_test.observer.enabled=1 \
-d zend_test.observer.show_output=0 \
-P -q -x -j4 \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 2000 \
--set-timeout 120 \
--repeat 2

# Cross-platform build without database services
cross-platform-build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
include:
- os: windows-latest
platform: windows
- os: macos-latest
platform: macos

runs-on: ${{ matrix.os }}


steps:
- name: Checkout php-async repo
uses: actions/checkout@v4
with:
path: async

- name: Clone php-src (true-async-stable)
run: |
git clone --depth=1 --branch=true-async-stable https://github.com/true-async/php-src php-src

- name: Copy php-async extension into php-src
run: |
mkdir -p php-src/ext/async
cp -r async/* php-src/ext/async/

# ==================== WINDOWS DEPENDENCIES ====================
- name: Install build dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
# Install php-sdk
git clone https://github.com/Microsoft/php-sdk-binary-tools.git C:\php-sdk

# Install vcpkg and LibUV >= 1.44.0
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg.exe install libuv:x64-windows

# Verify LibUV version
C:\vcpkg\vcpkg.exe list libuv

# Create deps structure for php-sdk
mkdir C:\php-sdk\deps\include\libuv
mkdir C:\php-sdk\deps\lib

# Copy LibUV files
xcopy /E /I C:\vcpkg\installed\x64-windows\include C:\php-sdk\deps\include\libuv\
copy C:\vcpkg\installed\x64-windows\lib\uv.lib C:\php-sdk\deps\lib\libuv.lib
shell: cmd

# ==================== MACOS DEPENDENCIES ====================
- name: Install build dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
# Core build tools
brew install autoconf automake libtool pkg-config bison

# LibUV >= 1.44.0 - main dependency
brew install libuv

# Verify LibUV version
pkg-config --modversion libuv || true
libuv_version=$(pkg-config --modversion libuv 2>/dev/null || echo "unknown")
echo "Installed LibUV version: $libuv_version"

# Fixed package names
brew install tidy-html5 icu4c openssl@3

# Additional dependencies
brew install gmp libzip bzip2 sqlite oniguruma curl
brew install libxml2 libxslt readline libsodium argon2

# Setup environment variables for keg-only packages
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "PATH=$(brew --prefix bison)/bin:$PATH" >> $GITHUB_ENV

# ==================== WINDOWS CONFIGURE & BUILD ====================
- name: Configure and Build PHP (Windows)
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -241,70 +325,45 @@ jobs:
} > /usr/local/etc/php.d/opcache.ini

# ==================== TESTING FOR ALL PLATFORMS ====================
- name: Run tests (Ubuntu)
if: matrix.os == 'ubuntu-latest'
working-directory: php-src
env:
MIBS: +ALL
run: |
sapi/cli/php run-tests.php \
-d zend_extension=opcache.so \
-d opcache.enable_cli=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit=tracing \
-d zend_test.observer.enabled=1 \
-d zend_test.observer.show_output=0 \
-P -q -x -j2 \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \
--set-timeout 120 \
--repeat 2 \
ext/async

- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
working-directory: php-src
working-directory: php-src/ext/async
run: |
php.exe -v
php.exe run-tests.php ^
php.exe ../../run-tests.php ^
-d zend_extension=opcache.dll ^
-d opcache.enable_cli=1 ^
-d opcache.jit_buffer_size=64M ^
-d opcache.jit=tracing ^
-d zend_test.observer.enabled=1 ^
-d zend_test.observer.show_output=0 ^
-P -q -x -j2 ^
-P -q -x -j4 ^
-g FAIL,BORK,LEAK,XLEAK ^
--no-progress ^
--offline ^
--show-diff ^
--show-slow 1000 ^
--show-slow 2000 ^
--set-timeout 120 ^
--repeat 2 ^
ext/async
--repeat 2
shell: cmd

- name: Run tests (macOS)
if: matrix.os == 'macos-latest'
working-directory: php-src
working-directory: php-src/ext/async
run: |
/usr/local/bin/php -v
/usr/local/bin/php run-tests.php \
/usr/local/bin/php ../../run-tests.php \
-d zend_extension=opcache.so \
-d opcache.enable_cli=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit=tracing \
-d zend_test.observer.enabled=1 \
-d zend_test.observer.show_output=0 \
-P -q -x -j2 \
-P -q -x -j4 \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress \
--offline \
--show-diff \
--show-slow 1000 \
--show-slow 2000 \
--set-timeout 120 \
--repeat 2 \
ext/async
--repeat 2
Loading