diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml index 412cf18d5..fa3c97caf 100644 --- a/.github/workflows/Lint.yml +++ b/.github/workflows/Lint.yml @@ -27,20 +27,16 @@ jobs: php-version: ${{ matrix.php }} tools: composer:v2, cs2pr - - name: Lint + - name: Lint PHP Files run: | - error=0 - for file in $(find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*'); do - php -l -n $file | grep -v "No syntax errors detected" && error=1 - done - if [ $error -eq 1 ]; then + if find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*' -exec php -l -n {} + | grep -q "Errors parsing"; then echo "Syntax errors were found." exit 1 else echo "No syntax errors were detected." fi - - name: Cache dependencies + - name: Install dependencies uses: actions/cache@v3 with: path: | @@ -50,12 +46,12 @@ jobs: key: ${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} restore-keys: OC3.2-PHP${{ matrix.php }}- - - name: PHPStan + - name: Run PHPStan run: | composer require --dev phpstan/phpstan 2.02 ./upload/system/storage/vendor/bin/phpstan analyze --no-progress - - name: Code style + - name: Check Code style run: | composer require --dev friendsofphp/php-cs-fixer v3.64.0 ./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --diff --ansi || true