From 4c419565be4b9d1354d0591196a510ff0d7e9617 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 28 Jun 2024 05:47:50 +0900 Subject: [PATCH] Configure PHP error logging and display on failure 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. --- .github/workflows/build.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83cc576..6f266e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 \ No newline at end of file + 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()