1
0
Fork 0

Bump highest php lint to use nightly (#12058)

pull/11995/head
Jordi Boggiano 2024-07-25 16:26:13 +02:00 committed by GitHub
parent ea931df77d
commit db869409e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -21,7 +21,7 @@ jobs:
matrix: matrix:
php-version: php-version:
- "7.2" - "7.2"
- "latest" - "nightly"
steps: steps:
- name: "Checkout" - name: "Checkout"
@ -36,4 +36,16 @@ jobs:
php-version: "${{ matrix.php-version }}" php-version: "${{ matrix.php-version }}"
- name: "Lint PHP files" - 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