All Projects → php-actions → phpstan

php-actions / phpstan

Licence: other
PHP Static Analysis in Github Actions.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to phpstan

vim-phpstan
A Vim plugin for PHPStan - https://github.com/phpstan/phpstan. It calls `phpstan` to do static analysis of your PHP code and displays the errors in Vim's quickfix list.
Stars: ✭ 26 (-36.59%)
Mutual labels:  static-analysis, phpstan
Huskyci
Performing security tests inside your CI
Stars: ✭ 398 (+870.73%)
Mutual labels:  continuous-integration, static-analysis
Phpstan
PHP Static Analysis Tool - discover bugs in your code without running it!
Stars: ✭ 10,534 (+25592.68%)
Mutual labels:  static-analysis, phpstan
haros
H(igh) A(ssurance) ROS - Static analysis of ROS application code.
Stars: ✭ 168 (+309.76%)
Mutual labels:  static-analysis, quality-assurance
Setup Php
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
Stars: ✭ 1,945 (+4643.9%)
Mutual labels:  continuous-integration, static-analysis
woocommerce-stubs
WooCommerce function and class declaration stubs for static analysis.
Stars: ✭ 49 (+19.51%)
Mutual labels:  static-analysis, phpstan
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (+173.17%)
Mutual labels:  continuous-integration, static-analysis
noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (+26.83%)
Mutual labels:  continuous-integration, phpstan
Gopherci
GopherCI was a project to help you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other third party static analysis tools.
Stars: ✭ 105 (+156.1%)
Mutual labels:  continuous-integration, static-analysis
Structured Acceptance Test
An open format definition for static analysis tools
Stars: ✭ 10 (-75.61%)
Mutual labels:  continuous-integration, static-analysis
phpstan-dba
PHPStan based SQL static analysis and type inference for the database access layer
Stars: ✭ 163 (+297.56%)
Mutual labels:  static-analysis, phpstan
phpstan-phpspec
PhpSpec extension for PHPStan
Stars: ✭ 19 (-53.66%)
Mutual labels:  static-analysis, phpstan
phpstan-webmozart-assert
PHPStan extension for webmozart/assert
Stars: ✭ 132 (+221.95%)
Mutual labels:  static-analysis, phpstan
phpstan-symfony
*DEPRECATED* Symfony extension for PHPStan
Stars: ✭ 42 (+2.44%)
Mutual labels:  static-analysis, phpstan
phpstan-nette
Nette Framework class reflection extension for PHPStan & framework-specific rules
Stars: ✭ 87 (+112.2%)
Mutual labels:  static-analysis, phpstan
Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (+1582.93%)
Mutual labels:  continuous-integration, static-analysis
phpstan-extensions
Extensions for PHPStan
Stars: ✭ 61 (+48.78%)
Mutual labels:  static-analysis, phpstan
phpstan-wordpress
WordPress extensions for PHPStan ⛏️
Stars: ✭ 182 (+343.9%)
Mutual labels:  static-analysis, phpstan
great expectations action
A GitHub Action that makes it easy to use Great Expectations to validate your data pipelines in your CI workflows.
Stars: ✭ 66 (+60.98%)
Mutual labels:  continuous-integration
concourse-ci-formula
All-in-one Concourse VM with S3-compatible storage and Vault secret manager
Stars: ✭ 26 (-36.59%)
Mutual labels:  continuous-integration

PHP Static Analysis in Github Actions

PHP Static Analysis in Github Actions.

PHPStan finds bugs in your code without writing tests by using runnin static analysis on your project's code.

Usage

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@v3
    - uses: php-actions/composer@v6 # or alternative dependency management
    - uses: php-actions/phpstan@v3
      with:
        path: src/

    # ... then your own project steps ...

Version numbers

This action is released with semantic version numbers, but also tagged so the latest major release's tag always points to the latest release within the matching major version.

Please feel free to use uses: php-actions/phpstan@v3 to always run the latest version of v3, or uses: php-actions/[email protected] to specify the exact release.

Example

We've put together an extremely simple example application that uses php-actions/phpstan. Check it out here: https://github.com/php-actions/example-phpstan.

Inputs

The following configuration options are available:

  • version The version of PHPStan to use e.g. 9 or 9.5.0 (default: latest)
  • php_version The version of PHP to use e.g. 7.4 (default: latest)
  • php_extensions Space-separated list of extensions using php-build e.g. xdebug mbstring (default: N/A)
  • vendored_phpstan_path The path to a phar file already present on the runner (default: N/A)
  • command The command to run e.g. list or worker (default: analyse)
  • path Path(s) with source code to run analysis on, space-separated (required)
  • configuration Configuration file location
  • level Level of rule options - the higher, the stricter
  • paths_file Path to a file with a list of paths to run analysis on
  • autoload_file Project's additional autoload file path
  • error_format Format in which to print the result of the analysis
  • generate_baseline Path to a file where the baseline should be saved
  • memory_limit Memory limit for analysis
  • args Extra arguments to pass to the phpstan binary

By default, adding - uses: php-actions/phpstan@v2 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@v3
      with:
        command: your-command-here

The syntax for passing in a custom input is the following:

...

jobs:
  phpstan:

    ...

    - name: PHPStan Static Analysis
      uses: php-actions/phpstan@v3
      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

PHP and PHPStan versions

It's possible to run any version of PHPStan under any version of PHP, with any PHP extensions you require. This is configured with the following inputs:

  • version - the version number of PHPStan to run e.g. 0.12.63 (default: latest)
  • php_version - the version number of PHP to use e.g. 7.4 (default: latest)
  • php_extensions - a space-separated list of extensions to install using php-build e.g. xdebug mbstring (default: N/A)

If you require a specific version combination that is not compatible with Github Actions for some reason, please make a request in the Github issue tracker.


If you found this repository helpful, please consider sponsoring the developer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].