From 67dedd42142280c98bf8ad639b20bd658fcf67ce Mon Sep 17 00:00:00 2001 From: Drillin Pierre Date: Wed, 20 Jan 2021 14:18:08 +0100 Subject: [PATCH] Adding PhpStan --- .github/workflows/php-stan.yml | 38 ++++++++++++++++++++++++++++++++++ php-stan.neon | 7 +++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/php-stan.yml create mode 100644 php-stan.neon diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml new file mode 100644 index 0000000..c2dd9b0 --- /dev/null +++ b/.github/workflows/php-stan.yml @@ -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 diff --git a/php-stan.neon b/php-stan.neon new file mode 100644 index 0000000..57dec9c --- /dev/null +++ b/php-stan.neon @@ -0,0 +1,7 @@ +parameters: + scanDirectories: + - pgmetadata/ + level: 0 + ignoreErrors: + paths: + - pgmetadata/ \ No newline at end of file