Skip to content

improve phpstan

improve phpstan #51

Workflow file for this run

---
name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
services:
redis:
image: redis/redis-stack-server
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
php-versions: ['8.2', '8.3']
env:
REDIS_HOST: localhost
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: redis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
-
name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
-
name: Install dependencies
run: composer install --prefer-dist
- name: Test cs-fixer
run: vendor/bin/php-cs-fixer fix src --dry-run --diff --no-ansi
- name: Run phpstan
run: vendor/bin/phpstan analyse src --level=5
- name: Run tests
run: vendor/bin/phpunit
- name: composer audit
run: composer audit
- name: composer validate
run: composer validate