Skip to content

Commit

Permalink
Merge pull request #436 from cakephp/phive-tools
Browse files Browse the repository at this point in the history
Use phive to install phpstan
  • Loading branch information
othercorey authored Oct 10, 2023
2 parents 1b563f0 + 75b39c2 commit 1d3536e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ composer.phar
composer.lock
.phpunit.result.cache
phpunit.xml
tools/
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.8.0" installed="1.8.0" location="./tools/phpstan" copy="false"/>
</phive>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 1d3536e

Please sign in to comment.