diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..ed35207 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,40 @@ +name: PHPStan + +on: + push: + pull_request: + branches: + - main + +concurrency: + group: phpstan-${{ github.ref_name || github.run_id }} + cancel-in-progress: true + +jobs: + + phpstan: + name: PHPStan PHP ${{ matrix.php }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + with: + composer-options: "--no-progress --prefer-dist --optimize-autoloader" + + - name: Larastan + run: php ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github diff --git a/composer.json b/composer.json index ba46ada..9c5a827 100644 --- a/composer.json +++ b/composer.json @@ -24,5 +24,10 @@ "phpstan/phpstan": "^1.10", "nunomaduro/larastan": "^2.5", "orchestra/testbench": "^8.0" + }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true + } } }