Skip to content

Commit 24c24f1

Browse files
CI: enable leak detection in ASAN job + add PHP debug build job
1 parent b3c4b2f commit 24c24f1

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797

9898
- name: make test
9999
env:
100-
ASAN_OPTIONS: "detect_leaks=0:abort_on_error=1:halt_on_error=1"
100+
ASAN_OPTIONS: "detect_leaks=1:abort_on_error=1:halt_on_error=1"
101101
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
102102
USE_ZEND_ALLOC: "0"
103103
NO_INTERACTION: "1"
@@ -114,6 +114,51 @@ jobs:
114114
echo "::endgroup::"
115115
done
116116
117+
debug:
118+
name: "Linux 8.4 NTS debug build (leak detection)"
119+
runs-on: ubuntu-latest
120+
121+
steps:
122+
- uses: actions/checkout@v6
123+
124+
- name: Install build dependencies
125+
run: |
126+
sudo apt-get update -q
127+
sudo apt-get install -y --no-install-recommends \
128+
build-essential autoconf pkg-config bison re2c \
129+
libxml2-dev libsqlite3-dev
130+
131+
- name: Build PHP 8.4 with --enable-debug
132+
run: |
133+
curl -sL https://www.php.net/distributions/php-8.4.18.tar.gz | tar xz
134+
cd php-8.4.18
135+
./configure --enable-debug --disable-all --enable-cli --enable-reflection --enable-spl --disable-cgi --disable-phpdbg
136+
make -j$(nproc)
137+
sudo make install
138+
php -v
139+
140+
- name: Build extension
141+
run: |
142+
phpize
143+
./configure --enable-deepclone
144+
make -j$(nproc)
145+
146+
- name: Run tests (leak detection active)
147+
env:
148+
NO_INTERACTION: "1"
149+
REPORT_EXIT_STATUS: "1"
150+
run: make test TESTS="-q --show-diff -m tests/"
151+
152+
- name: Show failing test diffs
153+
if: failure()
154+
run: |
155+
for f in tests/*.diff tests/*.out tests/*.log; do
156+
[ -e "$f" ] || continue
157+
echo "::group::$f"
158+
cat "$f"
159+
echo "::endgroup::"
160+
done
161+
117162
linux32:
118163
# Native 32-bit Linux build. We can't use a `container:` block here
119164
# because GitHub injects the x86_64 Node runtime into it and a pure

0 commit comments

Comments
 (0)