From eadc3c8254a7be53db62c6e2ba41cf0c74eb77f1 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 5 Apr 2024 09:23:12 +0200 Subject: [PATCH] php: Split phpstan tests into a separate workflow --- .github/workflows/php.yml | 17 +++-------------- .github/workflows/phpstan.yml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 89330aba3a..93bd4bde97 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -22,23 +22,16 @@ jobs: steps: - name: Checkout code base - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} tools: phpcs - extensions: ldap - name: Setup dependencies - run: | - composer require -n --no-progress overtrue/phplint phpstan/phpstan - 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-x509.git /usr/share/icingaweb2-modules/x509 - sudo git clone --depth 1 https://github.com/Icinga/icingadb-web.git /usr/share/icingaweb2-modules/icingadb - sudo git clone --depth 1 https://github.com/Icinga/icingaweb2-module-pdfexport.git /usr/share/icingaweb2-modules/pdfexport + run: composer require -n --no-progress overtrue/phplint - name: PHP Lint if: ${{ ! cancelled() }} @@ -48,10 +41,6 @@ jobs: if: ${{ ! cancelled() }} run: phpcs - - name: PHPStan - if: ${{ ! cancelled() }} - run: ./vendor/bin/phpstan analyse - test: name: Unit tests with php ${{ matrix.php }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -100,7 +89,7 @@ jobs: steps: - name: Checkout code base - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000000..94fb664e67 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,18 @@ +name: PHPStan + +on: + pull_request: + branches: + - main + +jobs: + phpstan: + uses: icinga/github-actions/.github/workflows/phpstan.yml@main + with: + phpExtensions: ldap + dependencies: | + { + "/usr/share/icingaweb2-modules/x509" : "https://github.com/Icinga/icingaweb2-module-x509.git", + "/usr/share/icingaweb2-modules/icingadb" : "https://github.com/Icinga/icingadb-web.git", + "/usr/share/icingaweb2-modules/pdfexport" : "https://github.com/Icinga/icingaweb2-module-pdfexport.git" + }