Skip to content

Commit

Permalink
Update build workflow to include core dump check
Browse files Browse the repository at this point in the history
The change introduces gdb installation and enables core dumps in the GitHub Actions workflow for debugging failed builds. It also modifies the commands under the "run demo" section and adds a new step that checks for the presence of a core dump file whenever a test failure occurs.
  • Loading branch information
koriym committed Jul 4, 2024
1 parent 57a38bf commit 2f34d28
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ jobs:
extensions: mbstring, intl

- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c
run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c gdb

- name: Enable core dumps
run: |
ulimit -c unlimited
echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
- name: Prepare build
run: |
Expand All @@ -37,5 +42,17 @@ jobs:

- name: Run demo
run: |
php -d extension=./modules/rayaop.so -i | grep rayaop
timeout 60s php -d extension=./modules/rayaop.so -d memory_limit=128M -d report_memleaks=1 -d zend.assertions=1 -d assert.exception=1 rayaop.php
php -dextension=./modules/rayaop.so -i | grep rayaop
timeout 60s php -dextension=./modules/rayaop.so -dmemory_limit=128M -dreport_memleaks=1 -dzend.assertions=1 -dassert.exception=1 smoke.php
- name: Check for core dump
if: failure()
run: |
if ls /tmp/core.* 1> /dev/null 2>&1; then
for corefile in /tmp/core.*; do
echo "Core dump found: $corefile"
gdb -batch -ex "bt full" -ex "quit" -c $corefile $(which php)
done
else
echo "No core dump found"
fi

0 comments on commit 2f34d28

Please sign in to comment.