Skip to content

Commit 7db4e6b

Browse files
committed
chore: adds phpstan workflow
1 parent a735850 commit 7db4e6b

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/phpstan.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'PHPStan Static Analysis'
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
phpstan:
11+
name: PHPStan
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 1
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: '7.2'
24+
coverage: none
25+
tools: composer:v2
26+
27+
- name: Get Composer Cache Directory
28+
id: composer-cache
29+
run: |
30+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache Composer dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-composer-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
42+
43+
- name: Run PHPStan
44+
run: composer phpstan

0 commit comments

Comments
 (0)