Skip to content

Commit

Permalink
Configure PHP error logging and display on failure
Browse files Browse the repository at this point in the history
The PHP error logging has been enabled and configured to write to a specific location. In addition, several steps have been added to the GitHub action workflow to display the PHP error log, standard error output, and check for a core dump any time a failure occurs during the workflow execution.
  • Loading branch information
koriym committed Jun 27, 2024
1 parent 88eea6e commit 4c41956
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
ulimit -c unlimited
echo '/tmp/core-%e.%p' | sudo tee /proc/sys/kernel/core_pattern
- name: Set PHP error logging
run: |
echo "error_log = /tmp/php_errors.log" | sudo tee -a /usr/local/etc/php/php.ini
echo "log_errors = On" | sudo tee -a /usr/local/etc/php/php.ini
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c

Expand All @@ -43,4 +48,23 @@ jobs:
- name: Run demo
run: |
php -d extension=./modules/rayaop.so -i | grep rayaop
php -d extension=./modules/rayaop.so -d memory_limit=128M -d report_memleaks=1 rayaop.php
php -d extension=./modules/rayaop.so -d memory_limit=128M -d report_memleaks=1 -d zend.assertions=1 -d assert.exception=1 rayaop.php 2> php_stderr.log
continue-on-error: true

- name: Display PHP error log
run: cat /tmp/php_errors.log
if: failure()

- name: Display stderr output
run: cat php_stderr.log
if: failure()

- name: Check for core dump
run: |
if ls /tmp/core-* 1> /dev/null 2>&1; then
echo "Core dump found"
ls -l /tmp/core-*
else
echo "No core dump found"
fi
if: failure()

0 comments on commit 4c41956

Please sign in to comment.