From db869409e1dc7f40a2eb4c92c5f381c3388493d5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 25 Jul 2024 16:26:13 +0200 Subject: [PATCH] Bump highest php lint to use nightly (#12058) --- .github/workflows/lint.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 479fe09c2..5e3fe1d29 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: - "7.2" - - "latest" + - "nightly" steps: - name: "Checkout" @@ -36,4 +36,16 @@ jobs: php-version: "${{ matrix.php-version }}" - name: "Lint PHP files" - run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f" + run: | + hasErrors=0 + for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*') + do + { error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1; + if [ "$error" != "" ]; then + while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error" + hasErrors=1 + fi + done + if [ $hasErrors -eq 1 ]; then + exit 1 + fi