Skip to content

Commit da26b03

Browse files
committed
use phive for stan
1 parent ed226dd commit da26b03

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,23 @@ jobs:
100100
php-version: '8.2'
101101
extensions: mbstring, intl
102102
coverage: none
103-
tools: cs2pr
103+
tools: phive, cs2pr
104104

105-
- name: Composer Install
106-
run: composer stan-setup
105+
- name: Composer install
106+
uses: ramsey/composer-install@v2
107+
108+
- name: Install PHP tools with phive.
109+
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'"
107110

108111
- name: Run phpcs
112+
if: always()
109113
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr
110114

111115
- name: Run psalm
112-
run: vendor/bin/psalm.phar --output-format=github
116+
if: always()
117+
run: tools/psalm --output-format=github
113118

114119
- name: Run phpstan
115120
if: always()
116-
run: vendor/bin/phpstan.phar analyse --error-format=github
121+
run: tools/phpstan analyse --error-format=github
122+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/.idea/
99
/setup
1010
/tmp
11+
/tools

.phive/phars.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpstan" version="1.10.28" installed="1.10.28" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.14.1" installed="5.14.1" location="./tools/psalm" copy="false"/>
5+
</phive>

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"test": "phpunit",
2828
"cs-check": "phpcs --colors -p src tests",
2929
"cs-fix": "phpcbf --colors -p src tests",
30-
"phpstan": "phpstan.phar analyse",
31-
"psalm": "psalm.phar --show-info=false",
30+
"phpstan": "tools/phpstan analyse",
31+
"psalm": "tools/psalm --show-info=false",
3232
"stan": [
3333
"@phpstan",
3434
"@psalm"
3535
],
36-
"stan-baseline": "phpstan.phar --generate-baseline",
37-
"psalm-baseline": "psalm.phar --set-baseline=psalm-baseline.xml",
38-
"stan-setup": "cp composer.json composer.backup && composer require --dev symfony/polyfill-php81 phpstan/phpstan:^1.9 psalm/phar:^5.1 && mv composer.backup composer.json"
36+
"stan-baseline": "tools/phpstan --generate-baseline",
37+
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
38+
"stan-setup": "phive install"
3939
},
4040
"minimum-stability": "dev",
4141
"prefer-stable": true,

0 commit comments

Comments
 (0)