Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psalm #51

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
54 changes: 28 additions & 26 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,29 @@ jobs:

- name: PHPUnit
run: ./vendor/bin/phpunit

phpstan:
psalm:
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
Loading