Skip to content

Commit e22d026

Browse files
committed
chore: update GitHub Actions workflow to include PHPStan for type checking and improve dependency installation
1 parent 7335a4c commit e22d026

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.github/workflows/php.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
name: PHP ${{ matrix.php-versions }} Test
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- name: Checkout code
24+
uses: actions/checkout@v4
2425

2526
- name: Setup PHP
2627
uses: shivammathur/setup-php@v2
@@ -43,7 +44,14 @@ jobs:
4344
${{ runner.os }}-php-
4445
4546
- name: Install dependencies
46-
run: composer install --no-interaction --prefer-dist --no-progress
47+
uses: nick-fields/retry@v3
48+
with:
49+
timeout_minutes: 5
50+
max_attempts: 5
51+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
52+
53+
- name: Execute type checking
54+
run: vendor/bin/phpstan --configuration="phpstan.neon.dist"
4755

4856
- name: Run test suite
4957
run: vendor/bin/phpunit --coverage-clover=coverage.xml --log-junit junit.xml

composer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@
3838
}
3939
},
4040
"require-dev": {
41+
"phpstan/phpstan": "^2.0",
4142
"phpunit/phpunit": "^10.0"
4243
},
43-
"scripts": {
44-
"test": [
45-
"vendor/bin/phpunit"
46-
]
47-
},
4844
"config": {
4945
"optimize-autoloader": true,
5046
"platform": {

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 1
3+
paths:
4+
- src

0 commit comments

Comments
 (0)