mirror of
https://github.com/predis/predis.git
synced 2026-10-26 21:56:53 +00:00
3daf75508d
* Remove unused arguments * Fix return types * Removed unused parameter and argument * Add phpstan job * merge files * Delete phpstan-baseline.neon * Delete static-analysis.yml * merge workflows * Update composer.json * format yaml * install composer reps * fix yaml Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
name: Linters
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- v2.**
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
php-cs-fixer:
|
|
name: PHP CS Fixer
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup PHP with Composer and extensions
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: 8.1
|
|
tools: php-cs-fixer
|
|
|
|
- name: Run php-cs-fixer
|
|
run: php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no
|
|
|
|
phpstan:
|
|
name: PHPStan
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup PHP with Composer and extensions
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: 8.2
|
|
tools: phpstan
|
|
|
|
- name: Get Composer cache directory
|
|
id: composer-cache
|
|
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache Composer dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.directory }}
|
|
key: tests-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: tests-php-${{ matrix.php }}-composer
|
|
|
|
- name: Install Composer dependencies
|
|
env:
|
|
PHP_VERSION: ${{ matrix.php }}
|
|
run: composer install --ansi --no-progress --prefer-dist $(if [ "$PHP_VERSION" == "8.0" ]; then echo "--ignore-platform-reqs"; fi;)
|
|
|
|
- name: Run PHPStan
|
|
run: phpstan analyse
|