Files
plugin-skeleton/.github/workflows/phpstan.yml

70 lines
2.1 KiB
YAML

name: phpstan
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
phpstan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.4, 8.3, 8.2]
laravel: [13.*, 12.*, 11.*]
stability: [prefer-stable]
include:
- laravel: 13.*
testbench: 11.*
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 13.*
php: 8.2
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Cache Composer dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.composer/cache/files
key: composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ matrix.php }}-${{ matrix.laravel }}-
composer-${{ matrix.php }}-
- name: Cache PHPStan result
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: /tmp/phpstan
key: phpstan-${{ matrix.php }}-${{ matrix.laravel }}-${{ github.sha }}
restore-keys: |
phpstan-${{ matrix.php }}-${{ matrix.laravel }}-
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github