Skip to content

Commit

Permalink
Merge pull request #1017 from AJenbo/phpstan-ci
Browse files Browse the repository at this point in the history
Run PHPStan in CI
  • Loading branch information
tvbeek committed Jul 14, 2023
2 parents e2ed690 + 8742f62 commit 10f8159
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: PHPStan

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1

strategy:
fail-fast: false
matrix:
php: [ '7.4' ]
setup: [ 'stable' ]
phpstan: [1.10.25]

name: PHP ${{ matrix.php }} - ${{ matrix.setup }} - ${{ matrix.phpstan }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}
- name: Install dependencies
run: |
composer require phpstan/phpstan:${{ matrix.phpstan }} --no-interaction --dev --no-update;
composer update --prefer-dist --no-progress --no-suggest --prefer-${{ matrix.setup }};
- name: Run PHPStan
run: vendor/bin/phpstan analyze
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
paths:
- src/main
rememberPossiblyImpureFunctionValues: false
level: 1

0 comments on commit 10f8159

Please sign in to comment.