Start fixing phpstan fails #13
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: 'PHPStan Tests' | |
on: | |
pull_request: | |
paths: | |
- 'src/**.php' | |
- '*.php' | |
jobs: | |
phpstan: | |
strategy: | |
matrix: | |
phpVersion: [ | |
"7.4", | |
"8.0", | |
"8.1", | |
"8.2", | |
"8.3", | |
] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1000 | |
submodules: recursive | |
# ------------------------------------------------------------------------------ | |
# Set up PHP and run phpstan | |
# ------------------------------------------------------------------------------ | |
- name: Configure PHP environment to run phpstan | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.phpVersion }} | |
# ------------------------------------------------------------------------------ | |
# Override composer php version | |
# ------------------------------------------------------------------------------ | |
- name: Set php version ${{ matrix.phpVersion }} in composer | |
run: composer config platform.php ${{ matrix.phpVersion }} | |
# ------------------------------------------------------------------------------ | |
# Install dependencies - ignoring php requirements | |
# ------------------------------------------------------------------------------ | |
- name: Install dependencies | |
run: composer i --ignore-platform-req=php+ | |
# ------------------------------------------------------------------------------ | |
# Run phpstan | |
# ------------------------------------------------------------------------------ | |
- name: Run phpstan | |
run: ./vendor/bin/phpstan analyse --error-format=table | |