Skip to content

Commit 2c4fdb8

Browse files
committed
#22: % update build-cross-platform.yml3
1 parent f8e13b3 commit 2c4fdb8

File tree

1 file changed

+100
-105
lines changed

1 file changed

+100
-105
lines changed

.github/workflows/build-cross-platform.yml

Lines changed: 100 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@ on:
77
branches: [build]
88

99
jobs:
10-
cross-platform-build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
os: [ubuntu-latest, windows-latest, macos-latest]
15-
include:
16-
- os: ubuntu-latest
17-
platform: ubuntu
18-
- os: windows-latest
19-
platform: windows
20-
- os: macos-latest
21-
platform: macos
22-
23-
runs-on: ${{ matrix.os }}
10+
ubuntu-build:
11+
runs-on: ubuntu-latest
2412

2513
services:
2614
mysql:
27-
image: ${{ matrix.os == 'ubuntu-latest' && 'mysql:8.3' || '' }}
15+
image: mysql:8.3
2816
env:
2917
MYSQL_ROOT_PASSWORD: ''
3018
MYSQL_ALLOW_EMPTY_PASSWORD: yes
@@ -37,7 +25,7 @@ jobs:
3725
--health-retries=5
3826
3927
postgres:
40-
image: ${{ matrix.os == 'ubuntu-latest' && 'postgres:16' || '' }}
28+
image: postgres:16
4129
env:
4230
POSTGRES_PASSWORD: postgres
4331
POSTGRES_DB: test
@@ -48,7 +36,6 @@ jobs:
4836
--health-timeout=5s
4937
--health-retries=5
5038
51-
5239
steps:
5340
- name: Checkout php-async repo
5441
uses: actions/checkout@v4
@@ -64,9 +51,7 @@ jobs:
6451
mkdir -p php-src/ext/async
6552
cp -r async/* php-src/ext/async/
6653
67-
# ==================== UBUNTU DEPENDENCIES ====================
68-
- name: Install build dependencies (Ubuntu)
69-
if: matrix.os == 'ubuntu-latest'
54+
- name: Install build dependencies
7055
run: |
7156
sudo apt-get update
7257
sudo apt-get install -y \
@@ -78,8 +63,7 @@ jobs:
7863
firebird-dev \
7964
valgrind cmake
8065
81-
- name: Install LibUV >= 1.44.0 (Ubuntu)
82-
if: matrix.os == 'ubuntu-latest'
66+
- name: Install LibUV >= 1.44.0
8367
run: |
8468
# Check if system libuv meets requirements
8569
if pkg-config --exists libuv && pkg-config --atleast-version=1.44.0 libuv; then
@@ -98,60 +82,7 @@ jobs:
9882
cd ../..
9983
fi
10084
101-
# ==================== WINDOWS DEPENDENCIES ====================
102-
- name: Install build dependencies (Windows)
103-
if: matrix.os == 'windows-latest'
104-
run: |
105-
# Install php-sdk
106-
git clone https://github.com/Microsoft/php-sdk-binary-tools.git C:\php-sdk
107-
108-
# Install vcpkg and LibUV >= 1.44.0
109-
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
110-
C:\vcpkg\bootstrap-vcpkg.bat
111-
C:\vcpkg\vcpkg.exe install libuv:x64-windows
112-
113-
# Verify LibUV version
114-
C:\vcpkg\vcpkg.exe list libuv
115-
116-
# Create deps structure for php-sdk
117-
mkdir C:\php-sdk\deps\include\libuv
118-
mkdir C:\php-sdk\deps\lib
119-
120-
# Copy LibUV files
121-
xcopy /E /I C:\vcpkg\installed\x64-windows\include C:\php-sdk\deps\include\libuv\
122-
copy C:\vcpkg\installed\x64-windows\lib\uv.lib C:\php-sdk\deps\lib\libuv.lib
123-
shell: cmd
124-
125-
# ==================== MACOS DEPENDENCIES ====================
126-
- name: Install build dependencies (macOS)
127-
if: matrix.os == 'macos-latest'
128-
run: |
129-
# Update Homebrew first
130-
brew update
131-
132-
# Core build tools
133-
brew install autoconf automake libtool pkg-config bison
134-
135-
# LibUV >= 1.44.0 - main dependency
136-
brew install libuv
137-
138-
# Verify LibUV version
139-
pkg-config --modversion libuv || true
140-
libuv_version=$(pkg-config --modversion libuv 2>/dev/null || echo "unknown")
141-
echo "Installed LibUV version: $libuv_version"
142-
143-
# Essential dependencies only (avoid conflicts)
144-
brew install tidy-html5 icu4c openssl@3 libxml2 libxslt
145-
146-
# Setup environment variables for keg-only packages
147-
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$(brew --prefix libxslt)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
148-
echo "PATH=$(brew --prefix bison)/bin:$PATH" >> $GITHUB_ENV
149-
echo "CPPFLAGS=-I$(brew --prefix openssl@3)/include -I$(brew --prefix icu4c)/include" >> $GITHUB_ENV
150-
echo "LDFLAGS=-L$(brew --prefix openssl@3)/lib -L$(brew --prefix icu4c)/lib" >> $GITHUB_ENV
151-
152-
# ==================== UBUNTU CONFIGURE & BUILD ====================
153-
- name: Configure PHP (Ubuntu)
154-
if: matrix.os == 'ubuntu-latest'
85+
- name: Configure PHP
15586
working-directory: php-src
15687
run: |
15788
./buildconf -f
@@ -206,8 +137,7 @@ jobs:
206137
--enable-address-sanitizer \
207138
--enable-async
208139
209-
- name: Build PHP (Ubuntu)
210-
if: matrix.os == 'ubuntu-latest'
140+
- name: Build PHP
211141
working-directory: php-src
212142
run: |
213143
make -j"$(nproc)"
@@ -219,6 +149,97 @@ jobs:
219149
echo "opcache.protect_memory=1"
220150
} > /etc/php.d/opcache.ini
221151
152+
- name: Run tests
153+
working-directory: php-src/ext/async
154+
run: |
155+
/usr/local/bin/php -v
156+
/usr/local/bin/php ../../run-tests.php \
157+
-d zend_extension=opcache.so \
158+
-d opcache.enable_cli=1 \
159+
-d opcache.jit_buffer_size=64M \
160+
-d opcache.jit=tracing \
161+
-d zend_test.observer.enabled=1 \
162+
-d zend_test.observer.show_output=0 \
163+
-P -q -x -j4 \
164+
-g FAIL,BORK,LEAK,XLEAK \
165+
--no-progress \
166+
--offline \
167+
--show-diff \
168+
--show-slow 4000 \
169+
--set-timeout 120 \
170+
--repeat 2
171+
172+
cross-platform-build:
173+
strategy:
174+
fail-fast: false
175+
matrix:
176+
os: [windows-latest, macos-latest]
177+
include:
178+
- os: windows-latest
179+
platform: windows
180+
- os: macos-latest
181+
platform: macos
182+
183+
runs-on: ${{ matrix.os }}
184+
185+
186+
steps:
187+
- name: Checkout php-async repo
188+
uses: actions/checkout@v4
189+
with:
190+
path: async
191+
192+
- name: Clone php-src (true-async-stable)
193+
run: |
194+
git clone --depth=1 --branch=true-async-stable https://github.com/true-async/php-src php-src
195+
196+
- name: Copy php-async extension into php-src
197+
run: |
198+
mkdir -p php-src/ext/async
199+
cp -r async/* php-src/ext/async/
200+
201+
# ==================== WINDOWS DEPENDENCIES ====================
202+
- name: Install build dependencies (Windows)
203+
if: matrix.os == 'windows-latest'
204+
run: |
205+
# Install php-sdk
206+
git clone https://github.com/Microsoft/php-sdk-binary-tools.git C:\php-sdk
207+
208+
# Install vcpkg and LibUV >= 1.44.0
209+
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
210+
C:\vcpkg\bootstrap-vcpkg.bat
211+
C:\vcpkg\vcpkg.exe install libuv:x64-windows
212+
213+
# Verify LibUV version
214+
C:\vcpkg\vcpkg.exe list libuv
215+
216+
# Create deps structure for php-sdk
217+
mkdir C:\php-sdk\deps\include\libuv
218+
mkdir C:\php-sdk\deps\lib
219+
220+
# Copy LibUV files
221+
xcopy /E /I C:\vcpkg\installed\x64-windows\include C:\php-sdk\deps\include\libuv\
222+
copy C:\vcpkg\installed\x64-windows\lib\uv.lib C:\php-sdk\deps\lib\libuv.lib
223+
shell: cmd
224+
225+
# ==================== MACOS DEPENDENCIES ====================
226+
- name: Install build dependencies (macOS)
227+
if: matrix.os == 'macos-latest'
228+
run: |
229+
# Use already installed packages when possible, install only missing
230+
brew list autoconf || brew install autoconf
231+
brew list libuv || brew install libuv
232+
brew list icu4c || brew install icu4c
233+
brew list openssl@3 || brew install openssl@3
234+
235+
# Verify LibUV version
236+
pkg-config --modversion libuv || true
237+
238+
# Setup environment variables for keg-only packages
239+
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
240+
echo "CPPFLAGS=-I$(brew --prefix openssl@3)/include -I$(brew --prefix icu4c)/include" >> $GITHUB_ENV
241+
echo "LDFLAGS=-L$(brew --prefix openssl@3)/lib -L$(brew --prefix icu4c)/lib" >> $GITHUB_ENV
242+
222243
# ==================== WINDOWS CONFIGURE & BUILD ====================
223244
- name: Configure and Build PHP (Windows)
224245
if: matrix.os == 'windows-latest'
@@ -263,39 +284,13 @@ jobs:
263284
} > /usr/local/etc/php.d/opcache.ini
264285
265286
# ==================== TESTING FOR ALL PLATFORMS ====================
266-
- name: Run tests (Ubuntu)
267-
if: matrix.os == 'ubuntu-latest'
268-
working-directory: php-src/ext/async
269-
run: |
270-
/usr/local/bin/php -v
271-
/usr/local/bin/php ../../run-tests.php \
272-
-d zend_extension=opcache.so \
273-
-d opcache.enable_cli=1 \
274-
-d opcache.jit_buffer_size=64M \
275-
-d opcache.jit=tracing \
276-
-d zend_test.observer.enabled=1 \
277-
-d zend_test.observer.show_output=0 \
278-
-P -q -x -j4 \
279-
-g FAIL,BORK,LEAK,XLEAK \
280-
--no-progress \
281-
--offline \
282-
--show-diff \
283-
--show-slow 4000 \
284-
--set-timeout 120 \
285-
--repeat 2
286-
287287
- name: Run tests (Windows)
288288
if: matrix.os == 'windows-latest'
289289
working-directory: php-src/ext/async
290290
run: |
291291
php.exe -v
292+
php.exe -m
292293
php.exe ../../run-tests.php ^
293-
-d zend_extension=opcache.dll ^
294-
-d opcache.enable_cli=1 ^
295-
-d opcache.jit_buffer_size=64M ^
296-
-d opcache.jit=tracing ^
297-
-d zend_test.observer.enabled=1 ^
298-
-d zend_test.observer.show_output=0 ^
299294
-P -q -x -j4 ^
300295
-g FAIL,BORK,LEAK,XLEAK ^
301296
--no-progress ^

0 commit comments

Comments
 (0)