You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
PHPStan (php-actions)
v1
PHPStan finds bugs in your code without writing tests by using runnin static analysis on your project's code.
Create your Github Workflow configuration in .github/workflows/ci.yml
or similar.
name: CI
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v2 # or alternative dependency management
- uses: php-actions/phpstan@v1
# ... then your own project steps ...
By default, adding - uses: php-actions/phpstan@v1 into your workflow will run phpstan analyse
, as analyse
is the default command name.
You can issue custom commands by passing a command input, like so:
jobs:
phpstan:
...
- name: PHPStan
uses: php-actions/phpstan@v1
with:
command: your-command-here
The following configuration options are available:
configuration
Path to the project configuration filelevel
Level of rule options - the higher the stricterpaths_file
Path to a file with a list of paths to run analysis onautoload_file
Project's additional autoload file patherror_format
Format in which to print the result of the analysisgenerate_baseline
Path to a file where the baseline should be savedmemory_limit
Memory limit for analysis
The syntax for passing in a custom input is the following:
...
jobs:
phpstan:
...
- name: PHPStan Static Analysis
uses: php-actions/phpstan@v1
with:
configuration: custom/path/to/phpstan.neon
memory_limit: 256M
If you require other configurations of phpstan, please request them in the Github issue tracker
If you found this repository helpful, please consider sponsoring the developer.