Fix deprecation warnings #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ['7.4', '8.0', '8.1', '8.2'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
- name: Lint | |
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 | |
echo "Syntax errors were found." | |
exit 1 | |
else | |
echo "No syntax errors were detected." | |
fi | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/composer/files | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer require phpstan/phpstan 1.10.50 | |
- name: PHPStan | |
run: ./upload/system/storage/vendor/bin/phpstan analyze --no-progress |