Skip to content

Commit

Permalink
Add phpstan action
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sommer <[email protected]>
  • Loading branch information
Erikmitk committed Jan 26, 2025
1 parent 7c6b943 commit 00fe6cc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/php-code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PHP Code Scanning

on:
push:
branches:
- '*' # This will trigger the action on any commit to any branch
pull_request:
branches:
- 'master' # This will trigger the action only for PRs targeting the 'master' branch

jobs:
phpstan:
runs-on: ubuntu-latest

steps:
# Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up PHP 7.4 environment
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

# Install dependencies (including PHPStan if it's a dev dependency)
- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist
# Run PHPStan to analyze code
- name: Run PHPStan
run: |
vendor/bin/phpstan
# Optional: Upload the results (for GitHub to process as Code Scanning Alerts)
- name: Upload Code Scanning Results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: phpstan.sarif

0 comments on commit 00fe6cc

Please sign in to comment.