From 6ecbd1b6b4845ae5fc065b61e48dd22ed3c9daa9 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Mon, 22 Jan 2024 09:55:53 +0100 Subject: [PATCH] phpistan: Streamline vendor file location with local dev-env phpstan is not run with an action anymore, as the action runs it its own docker container and hence has no access to files outside the repository root. A side-effect of this is, that phpstan now **really** runs with the php version set up by the matrix. --- .github/workflows/php.yml | 16 ++++++++-------- phpstan.neon | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 510c05f8..d17da2f9 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -32,13 +32,13 @@ jobs: - name: Setup dependencies run: | - composer require -n --no-progress overtrue/phplint - git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2 - git clone --depth 1 https://github.com/Icinga/icingaweb2-module-reporting.git vendor/reporting - git clone --depth 1 https://github.com/Icinga/icingaweb2-module-x509.git vendor/x509 - git clone --depth 1 https://github.com/Icinga/icingaweb2-module-pdfexport.git vendor/pdfexport - git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library - git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty + composer require -n --no-progress overtrue/phplint phpstan/phpstan + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2.git /icingaweb2 + sudo git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git /usr/share/icinga-php/ipl + sudo git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git /usr/share/icinga-php/vendor + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-reporting.git /usr/share/icingaweb2-modules/reporting + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-pdfexport.git /usr/share/icingaweb2-modules/pdfexport + sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-x509.git /usr/share/icingaweb2-modules/x509 - name: PHP Lint if: ${{ ! cancelled() }} @@ -50,7 +50,7 @@ jobs: - name: PHPStan if: ${{ ! cancelled() }} - uses: php-actions/phpstan@v3 + run: ./vendor/bin/phpstan analyse test: name: Unit tests with php ${{ matrix.php }} on ${{ matrix.os }} diff --git a/phpstan.neon b/phpstan.neon index 4cfb7e5e..0529dbd7 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -13,7 +13,9 @@ parameters: - library scanDirectories: - - vendor + - /icingaweb2 + - /usr/share/icinga-php + - /usr/share/icingaweb2-modules ignoreErrors: -