From 501e6dfa4ae6a2281b5ffb2da7dd233c7399a111 Mon Sep 17 00:00:00 2001 From: Koala Yeung Date: Fri, 4 Nov 2022 09:28:48 +0800 Subject: [PATCH] GitHub CI: Improve debug experience with twig (#1698) --- .github/workflows/ci.yml | 27 +++++++++++++++------------ .gitignore | 3 ++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbdda3426e..6b4fd5e36d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,13 +53,13 @@ jobs: - name: Run PHP server for tests to run run: | # Start a PHP test server for codeception to run against - [ -d ./tests/log ] || mkdir ./tests/log + [ -d ./tests/_logs ] || mkdir ./tests/_logs php --server 127.0.0.1:8888 \ --docroot ${{ github.workspace }} \ --define display_startup_errors=1 \ --define display_errors=1 \ --define error_reporting=E_ALL \ - >/dev/null 2>./tests/log/server_log & + >/dev/null 2>./tests/_logs/server_log & - name: Cache Composer dependencies uses: actions/cache@v3 @@ -90,48 +90,48 @@ jobs: - name: Check PHP warning and deprecated messages in server_log run: | # Check number of uncaught exceptions. - export NUM_EXCEPTION=$(grep --perl-regexp 'Uncaught Exception: ' ./tests/log/server_log | wc -l) + export NUM_EXCEPTION=$(grep --perl-regexp 'Uncaught Exception: ' ./tests/_logs/server_log | wc -l) if [ "$NUM_EXCEPTION" -eq 0 ]; then echo -e '\e[32mNo Uncaught exception.\e[0m' echo else echo -e "\e[1m\e[33mGot $NUM_EXCEPTION uncaught exceptions:\e[0m" - grep --line-number --color=always --perl-regexp 'Uncaught Exception: ' ./tests/log/server_log + grep --line-number --color=always --perl-regexp 'Uncaught Exception: ' ./tests/_logs/server_log echo (exit 1) fi # Check number of warning messages. - export NUM_WARNING=$(grep --perl-regexp '(? ./tests/log/mysqldump.sql + mkdir -p ./tests/_dump + mysqldump -u root --protocol=tcp --column-statistics=0 gibbon_test > ./tests/_dump/mysqldump.sql - name: Save Test Artifacts uses: actions/upload-artifact@v3 @@ -148,6 +149,8 @@ jobs: with: name: Test Artifacts (PHP ${{ matrix.php-version }}) path: | - tests/log + tests/_logs + tests/_dump tests/_output + uploads/cache/templates retention-days: 5 diff --git a/.gitignore b/.gitignore index 0fb2b95c4f..b5d2236a57 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,8 @@ themes/* !themes/2021 # Test generated temporary files -tests/log/* +tests/_logs/* +tests/_dump/* tests/_support/_generated/* tests/_output .phpunit.result.cache