Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on i386 #76

Draft
wants to merge 1 commit into
base: v3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 11 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
expect_native: 1
werror: 1

- php: '8.1.0'
os: 'ubuntu-18.04'
expect_native: 1
werror: 1
arch: i386

- php: '8.0.0'
os: 'ubuntu-20.04'
expect_native: 1
Expand All @@ -42,6 +48,7 @@ jobs:
MEMORY_CHECK: ${{ matrix.memcheck }}
WERROR: ${{ matrix.werror }}
MEMPROF_EXPECT_NATIVE_TRACKING: ${{ matrix.expect_native }}
BUILD_ARCH: ${{ matrix.arch || 'amd64' }}
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v2'
Expand All @@ -51,7 +58,10 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/build-cache/php
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.memcheck }}
key: ${{ runner.os }}-${{matrix.arch}}-${{ matrix.php }}-${{ matrix.memcheck }}

- name: 'Setup'
run: './ext/.github/workflows/test/setup.sh'

- name: 'Build PHP'
run: './ext/.github/workflows/test/build-php.sh'
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test/build-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "Building extension with PHP version:"
php --version

if which apt-get >/dev/null 2>&1; then
sudo apt-get -y install libjudy-dev
sudo apt-get -y install libjudy-dev:$BUILD_ARCH
else
brew install traildb/judy/judy
fi
Expand All @@ -18,6 +18,12 @@ if [ "$WERROR" = "1" ]; then
PHP_EXT_CFLAGS="-Wall -Werror -Wno-deprecated-declarations"
fi

case "$BUILD_ARCH" in
i386)
PHP_EXT_CFLAGS="$PHP_EXT_CFLAGS -m32"
;;
esac

cd ext
phpize
CFLAGS="$PHP_EXT_CFLAGS" ./configure
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/test/build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

set -ex

if which apt-get >/dev/null 2>&1; then
sudo apt-get -y install zlib1g-dev:$BUILD_ARCH
fi

if [ "$MEMORY_CHECK" = "1" ]; then
if which apt-get >/dev/null 2>&1; then
sudo apt-get -y install valgrind
sudo apt-get -y install valgrind:$BUILD_ARCH
else
break install valgrind
brew install valgrind
fi
fi

Expand Down Expand Up @@ -36,7 +40,15 @@ if ! [ -f "$HOME/build-cache/php/$PREFIX/bin/php" ]; then
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --with-valgrind"
fi

./configure $PHP_BUILD_FLAGS $PHP_BUILD_EXTRA_FLAGS
case "$BUILD_ARCH" in
i386)
PHP_BUILD_CFLAGS="$PHP_BUILD_CFLAGS -m32"
PHP_BUILD_ASFLAGS="$PHP_BUILD_ASFLAGS -m32"
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --host=$BUILD_ARCH"
;;
esac

ASFLAGS="$PHP_BUILD_ASFLAGS=" CFLAGS="$PHP_BUILD_CFLAGS" ./configure $PHP_BUILD_FLAGS
make -j $(nproc)
rm -rf "$HOME/build-cache/php"
mkdir -p ~/build-cache/php
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test/build-xdebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ git clone --depth 1 --branch "3.1.2" "https://github.com/xdebug/xdebug.git"

cd xdebug

case "$BUILD_ARCH" in
i386)
PHP_EXT_CFLAGS="$PHP_EXT_CFLAGS -m32"
;;
esac

phpize
./configure
CFLAGS="$PHP_EXT_CFLAGS" ./configure
make
sudo make install
12 changes: 12 additions & 0 deletions .github/workflows/test/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -ex

case "$BUILD_ARCH" in
i386)
echo "Setup $BUILD_ARCH architecture"
sudo dpkg --add-architecture "$BUILD_ARCH"
sudo apt-get update
sudo apt-get install gcc-multilib
;;
esac