Showing
4 changed files
with
1 additions
and
66 deletions
.github/.DS_Store
deleted
100644 → 0
No preview for this file type
.github/workflows/Lint.yml
deleted
100644 → 0
| 1 | -name: Lint | ||
| 2 | - | ||
| 3 | -on: | ||
| 4 | - push: | ||
| 5 | - branches: | ||
| 6 | - - 3.0.x.x | ||
| 7 | - pull_request: | ||
| 8 | - types: [opened, synchronize] | ||
| 9 | - | ||
| 10 | -concurrency: | ||
| 11 | - group: ${{ github.workflow }}-${{ github.ref }} | ||
| 12 | - cancel-in-progress: true | ||
| 13 | - | ||
| 14 | -jobs: | ||
| 15 | - tests: | ||
| 16 | - runs-on: ubuntu-latest | ||
| 17 | - strategy: | ||
| 18 | - matrix: | ||
| 19 | - php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] | ||
| 20 | - steps: | ||
| 21 | - - name: Checkout | ||
| 22 | - uses: actions/checkout@v2 | ||
| 23 | - | ||
| 24 | - - name: Setup PHP | ||
| 25 | - uses: shivammathur/setup-php@v2 | ||
| 26 | - with: | ||
| 27 | - php-version: ${{ matrix.php }} | ||
| 28 | - tools: composer:v2, cs2pr | ||
| 29 | - extensions: mbstring | ||
| 30 | - | ||
| 31 | - - name: Lint | ||
| 32 | - run: | | ||
| 33 | - error=0 | ||
| 34 | - for file in $(find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*'); do | ||
| 35 | - php -l -n $file | grep -v "No syntax errors detected" && error=1 | ||
| 36 | - done | ||
| 37 | - if [ $error -eq 1 ]; then | ||
| 38 | - echo "Syntax errors were found." | ||
| 39 | - exit 1 | ||
| 40 | - else | ||
| 41 | - echo "No syntax errors were detected." | ||
| 42 | - fi | ||
| 43 | - | ||
| 44 | - - name: Cache dependencies | ||
| 45 | - uses: actions/cache@v3 | ||
| 46 | - with: | ||
| 47 | - path: | | ||
| 48 | - ~/.cache/composer/files | ||
| 49 | - ./.cache | ||
| 50 | - ./.php-cs-fixer.cache | ||
| 51 | - key: OC3.0-PHP${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
| 52 | - restore-keys: OC3.0-PHP${{ matrix.php }}- | ||
| 53 | - | ||
| 54 | - - name: PHPStan | ||
| 55 | - run: | | ||
| 56 | - composer require phpstan/phpstan 1.10.57 | ||
| 57 | - ./upload/system/storage/vendor/bin/phpstan analyze --no-progress | ||
| 58 | - | ||
| 59 | - - name: Code style | ||
| 60 | - if: matrix.php == '8.3' | ||
| 61 | - run: | | ||
| 62 | - composer require --dev -w friendsofphp/php-cs-fixer v3.41.1 | ||
| 63 | - ./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --diff --ansi || true | ||
| 64 | - ./upload/system/storage/vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr |
-
Please register or login to post a comment