Skip to content

Commit

Permalink
Merge pull request #4 from dflydev/2-add-phstan-github-workflow
Browse files Browse the repository at this point in the history
Adding phstan GitHub workflow
  • Loading branch information
simensen authored May 5, 2023
2 parents 87aca74 + 64e1c2d commit 3e91ad2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PHPStan

on:
push:
pull_request:
branches:
- main

concurrency:
group: phpstan-${{ github.ref_name || github.run_id }}
cancel-in-progress: true

jobs:

phpstan:
name: PHPStan PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2']

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--no-progress --prefer-dist --optimize-autoloader"

- name: Larastan
run: php ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"phpstan/phpstan": "^1.10",
"nunomaduro/larastan": "^2.5",
"orchestra/testbench": "^8.0"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
}
}

0 comments on commit 3e91ad2

Please sign in to comment.