Skip to content

Release v0.5.1

Release v0.5.1 #140

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: ['v*.*.*']
pull_request:
permissions:
contents: read
jobs:
linux:
name: "Linux ${{ matrix.php }} ${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
zts: [false]
include:
- php: '8.4'
zts: true
# 8.5 tracks the development branch (nightly); failures here are
# informational and must not block the matrix.
- php: '8.5'
zts: false
experimental: true
continue-on-error: ${{ matrix.experimental == true }}
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mongodb, tidy
coverage: none
tools: none
env:
phpts: ${{ matrix.zts && 'zts' || 'nts' }}
- name: phpize
run: phpize
- name: configure
run: ./configure --enable-deepclone CFLAGS="-Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
- name: make
run: make -j$(nproc)
- name: make test
run: |
export NO_INTERACTION=1
export REPORT_EXIT_STATUS=1
export TEST_PHP_JUNIT=junit.xml
make test TESTS="-q --show-diff tests/"
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
asan:
name: "Linux 8.4 NTS + ASAN/UBSAN"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup PHP 8.4 with ASAN
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mongodb, tidy
coverage: none
tools: none
- name: phpize
run: phpize
- name: configure with sanitizers
run: |
export CFLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g -O1 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
export LDFLAGS="-fsanitize=address,undefined"
./configure --enable-deepclone
- name: make
run: make -j$(nproc)
- name: make test
env:
ASAN_OPTIONS: "detect_leaks=1:abort_on_error=1:halt_on_error=1"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
USE_ZEND_ALLOC: "0"
NO_INTERACTION: "1"
REPORT_EXIT_STATUS: "1"
run: make test TESTS="-q --show-diff tests/"
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
debug:
name: "Linux 8.4 NTS debug build (leak detection)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install build dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends \
build-essential autoconf pkg-config bison re2c \
libxml2-dev libsqlite3-dev
- name: Build PHP 8.4 with --enable-debug
run: |
curl -sL https://www.php.net/distributions/php-8.4.18.tar.gz | tar xz
cd php-8.4.18
./configure --enable-debug --disable-all --enable-cli --enable-reflection --enable-spl --disable-cgi --disable-phpdbg
make -j$(nproc)
sudo make install
php -v
- name: Build extension
run: |
phpize
./configure --enable-deepclone
make -j$(nproc)
- name: Run tests (Zend MM leak detection active)
env:
NO_INTERACTION: "1"
REPORT_EXIT_STATUS: "1"
run: make test TESTS="-q --show-diff tests/"
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
linux32:
# Native 32-bit Linux build. We can't use a `container:` block here
# because GitHub injects the x86_64 Node runtime into it and a pure
# i386 image can't execute it ("exec /__e/node24/bin/node: no such
# file or directory"). Instead, do checkout on the x86_64 host and
# spawn the i386 container manually for the build/test step. i386
# binaries run natively on x86_64 hosts — no qemu involved. Debian
# Bookworm still ships PHP 8.2 on i386, which is enough to validate
# the source compiles and runs correctly when sizeof(zend_long) == 4.
name: "Linux i386 PHP 8.2"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build and test inside i386/debian:bookworm
run: |
docker run --rm --platform linux/386 -v "$PWD:/work" -w /work \
-e NO_INTERACTION=1 -e REPORT_EXIT_STATUS=1 \
i386/debian:bookworm sh -eu -c '
apt-get update
apt-get install -y --no-install-recommends \
build-essential autoconf pkg-config ca-certificates \
php-cli php-dev
phpize
./configure --enable-deepclone \
CFLAGS="-Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
make -j"$(nproc)"
make test TESTS="-q --show-diff tests/"
'
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
macos:
name: "macOS ${{ matrix.php }}"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4']
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mongodb, tidy
coverage: none
tools: none
- name: build & test
run: |
phpize
./configure --enable-deepclone
make -j$(sysctl -n hw.ncpu)
NO_INTERACTION=1 REPORT_EXIT_STATUS=1 make test TESTS="-q tests/"
windows-matrix:
# Generate a Windows build matrix (PHP version × arch × ts × VS toolset)
# via the official php/php-windows-builder action — the same recipe used
# by ext/xdebug, ext/apcu, ext/uopz and other PECL extensions.
name: "Windows build matrix"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
php-version-list: '8.2, 8.3, 8.4, 8.5'
arch-list: 'x64'
windows:
name: "Windows ${{ matrix.php-version }} ${{ matrix.arch }} ${{ matrix.ts }}"
needs: windows-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.windows-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Build the extension
uses: php/php-windows-builder/extension@v1
with:
php-version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
args: --enable-deepclone
release:
# On tag pushes, collect every Windows build artifact uploaded by the
# `windows` matrix above and attach the resulting DLLs to the GitHub
# release. PIE will then download the matching prebuilt DLL on Windows
# instead of asking the user to compile from source.
name: "Publish Windows DLLs to release"
needs: windows
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: php/php-windows-builder/release@v1
with:
release: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}