From 75b39c28833a4add7e932e696dc221bc35afcde9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 6 Oct 2023 23:35:15 -0400 Subject: [PATCH] Use phive to install phpstan Normalize this branch of chronos on using phive like other cakephp projects. --- .github/workflows/ci.yml | 11 +++++++---- .gitignore | 1 + .phive/phars.xml | 4 ++++ composer.json | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 .phive/phars.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a760ebd..57032c1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: with: php-version: '8.1' extensions: mbstring, intl - tools: cs2pr + tools: cs2pr, phive coverage: none - name: Get composer cache directory @@ -101,11 +101,14 @@ jobs: key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} - name: Composer install - run: composer stan-setup + run: composer update + + - name: Install PHP tools with phive. + run: phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5' - name: Run PHP CodeSniffer run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr - name: Run phpstan - if: success() || failure() - run: vendor/bin/phpstan.phar analyse --error-format=github + if: always() + run: tools/phpstan analyse --error-format=github diff --git a/.gitignore b/.gitignore index 7d92a90b..690f4beb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ composer.phar composer.lock .phpunit.result.cache phpunit.xml +tools/ diff --git a/.phive/phars.xml b/.phive/phars.xml new file mode 100644 index 00000000..2c741fd4 --- /dev/null +++ b/.phive/phars.xml @@ -0,0 +1,4 @@ + + + + diff --git a/composer.json b/composer.json index 6d83b772..1bc16033 100644 --- a/composer.json +++ b/composer.json @@ -52,11 +52,11 @@ ], "cs-check": "phpcs --colors --parallel=16 -p src/ tests/", "cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/", - "phpstan": "phpstan.phar analyse", + "phpstan": "tools/phpstan analyse", "stan": [ "@phpstan" ], - "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.8.0 && mv composer.backup composer.json", + "stan-setup": "phive install", "test": "phpunit" }, "config": {