Skip to content

Commit

Permalink
Adding PhpStan
Browse files Browse the repository at this point in the history
  • Loading branch information
pdrillin committed Jan 21, 2021
1 parent db8f5df commit 67dedd4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHPStan
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
phpstan:
name: "Php-Stan"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get composer cache directory
id: get-composer-cache-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: phpstan

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.get-composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run PHPStan
run: phpstan analyse -c php-stan.neon
7 changes: 7 additions & 0 deletions php-stan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
scanDirectories:
- pgmetadata/
level: 0
ignoreErrors:
paths:
- pgmetadata/

0 comments on commit 67dedd4

Please sign in to comment.