Skip to content

Commit

Permalink
Merge pull request #61 from fezfez/start_psalm
Browse files Browse the repository at this point in the history
fix #45 : Psalm integration
  • Loading branch information
Ocramius authored Dec 9, 2020
2 parents 0e770b5 + 67bbbec commit 1735224
Show file tree
Hide file tree
Showing 5 changed files with 4,535 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/docs/ export-ignore
/mkdocs.yml export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
/test/ export-ignore
56 changes: 56 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Static Analysis by Psalm"

on:
pull_request:
push:

jobs:
static-analysis-psalm:
name: "Static Analysis by Psalm"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "7.4"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "psalm"
run: "vendor/bin/psalm --output-format=github --shepherd --stats"
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"doctrine/annotations": "^1.10.4",
"laminas/laminas-coding-standard": "^1.0.0",
"laminas/laminas-stdlib": "^3.3.0",
"phpunit/phpunit": "^9.4.2"
"phpunit/phpunit": "^9.4.2",
"psalm/plugin-phpunit": "^0.13.0",
"vimeo/psalm": "^4.2"
},
"conflict": {
"phpspec/prophecy": "<1.9.0"
Expand Down Expand Up @@ -56,7 +58,8 @@
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"static-analysis": "psalm --shepherd --stats"
},
"replace": {
"zendframework/zend-code": "self.version"
Expand Down
Loading

0 comments on commit 1735224

Please sign in to comment.