-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.33 KB
/
php-static-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: PHP Static Analysis
on:
pull_request:
jobs:
detect_php_changes:
name: Detect Changes in PHP Files
runs-on: ubuntu-latest
outputs:
php_files_changed: ${{ steps.filter.outputs.php_files }}
phpstan_config_changed: ${{ steps.filter.outputs.phpstan_config }}
steps:
- name: Identify Changed PHP Files
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
php_files:
- added|modified: '*.php'
phpstan_config:
- added|modified: 'phpstan.neon'
run_phpstan:
name: Run PHPStan Analysis
needs: detect_php_changes
if: ${{ needs.detect_php_changes.outputs.php_files_changed == 'true' || needs.detect_php_changes.outputs.phpstan_config_changed == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP Environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: dom, curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install Composer Dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse --error-format=github