-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Erik Sommer <[email protected]>
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 analyse src --level max | ||
# 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 |