Skip to content

Commit

Permalink
dev: replaced PHPStan with Psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
lapaliv committed May 21, 2024
1 parent c4d43a6 commit ac6978a
Show file tree
Hide file tree
Showing 32 changed files with 1,038 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
/CHANGELOG.md export-ignore
/phpunit.xml export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpstan.neon export-ignore
/psalm.xml export-ignore
/docker-compose.yml export-ignore
57 changes: 30 additions & 27 deletions .github/workflows/phpunit.yml → .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHPUnit & PHPStan
name: PHPUnit & Psalm

on: [push]

Expand All @@ -9,8 +9,17 @@ jobs:
phpunit:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php: '8.0'
- php: '8.1'
- php: '8.2'
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
Expand All @@ -25,16 +34,9 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
coverage: "none"
php-version: "${{ matrix.php }}"
tools: flex

- name: Install dependencies
run: composer install --prefer-dist --no-progress
Expand All @@ -47,29 +49,30 @@ jobs:
- name: PHPUnit
run: ./vendor/bin/phpunit
psalm:
name: Psalm
runs-on: Ubuntu-20.04

phpstan:
runs-on: ubuntu-latest

env:
php-version: '8.0'
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: ${{ env.php-version }}
ini-values: "memory_limit=-1"
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
- name: Checkout target branch
uses: actions/checkout@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
ref: ${{ github.base_ref }}

- name: Checkout PR
uses: actions/checkout@v4

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: PHPStan
run: ./vendor/bin/phpstan analyze --xdebug --memory-limit 512M
- name: Psalm
run: ./vendor/bin/psalm --output-format=github --no-progress
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "^3.13",
"orchestra/testbench": "^7.19",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "9.*",
"vimeo/psalm": "^5.13",
"vlucas/phpdotenv": "5.5.x-dev"
},
"extra": {
Expand Down
Loading

0 comments on commit ac6978a

Please sign in to comment.