diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05a78c7..71f820d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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' @@ -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' diff --git a/.github/workflows/test/build-extension.sh b/.github/workflows/test/build-extension.sh index 1159d88..adc4db7 100755 --- a/.github/workflows/test/build-extension.sh +++ b/.github/workflows/test/build-extension.sh @@ -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 @@ -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 diff --git a/.github/workflows/test/build-php.sh b/.github/workflows/test/build-php.sh index a227384..34e1187 100755 --- a/.github/workflows/test/build-php.sh +++ b/.github/workflows/test/build-php.sh @@ -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 @@ -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 diff --git a/.github/workflows/test/build-xdebug.sh b/.github/workflows/test/build-xdebug.sh index cf313e6..4ac04bc 100755 --- a/.github/workflows/test/build-xdebug.sh +++ b/.github/workflows/test/build-xdebug.sh @@ -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 diff --git a/.github/workflows/test/setup.sh b/.github/workflows/test/setup.sh new file mode 100755 index 0000000..5b71de0 --- /dev/null +++ b/.github/workflows/test/setup.sh @@ -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