From 1dd11c7ddf0417cea8c839996979a6fb22e545cb Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 21 Mar 2024 07:22:00 +0100 Subject: [PATCH] added gha config --- .github/workflows/static-analysis.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 000000000..39cd31dc6 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,44 @@ +name: Static Analysis + +on: + pull_request: + branches: + - master + paths: + - .github/workflows/static-analysis.yml + - tests/StaticAnalysis/* + - composer.* + - lib/** + - phpstan* + + push: + branches: + - master + paths: + - .github/workflows/static-analysis.yml + - tests/StaticAnalysis/* + - composer.* + - lib/** + - phpstan* + +jobs: + static-analysis-phpstan: + name: Static Analysis with PHPStan + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: 7.4 + tools: cs2pr + + - name: Install dependencies with Composer + uses: ramsey/composer-install@v2 + + - name: Run static analysis + run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr