-
-
Notifications
You must be signed in to change notification settings - Fork 19
71 lines (62 loc) · 2.16 KB
/
phpstan.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: PHPStan
on:
push:
branches:
- "*"
pull_request:
branches: [ 'master', 'main' ]
pull_request_target:
types:
- closed
jobs:
run:
name: Run PHPStan
runs-on: 'ubuntu-latest'
strategy:
matrix:
level: [ 1, 2 ]
include:
- current-level: 1
- max-level: 2
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: '8.4'
- name: Remove phpDocumentor temporarily and Install PHPStan
run: composer remove --dev --no-update phpdocumentor/phpdocumentor; composer update
- name: Restore cached baseline for PHPStan
id: cache-baseline-restore
uses: actions/cache/restore@v4
with:
path: |
test/phpstan-baseline.neon
key: phpstan-baseline-${{ github.run_id }}"
restore-keys: |
phpstan-baseline-
- name: Run PHPStan
if: matrix.level == matrix.current-level
continue-on-error: true
run: |
./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
- name: Run PHPStan
if: matrix.level > matrix.current-level
continue-on-error: true
run: |
./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon src test -l "${{ matrix.level }}"
exit 0
- name: Generate the baseline for PHPStan
if: matrix.level == matrix.max-level && github.event.pull_request.merged == true
continue-on-error: true
run: |
./vendor/bin/phpstan analyse --memory-limit 1G -c test/phpstan.neon --generate-baseline test/phpstan-baseline.neon src test -vvv --debug -l "${{ matrix.level }}"
exit 0
- name: Save the baseline for PHPStan
id: cache-baseline-save
if: matrix.level == matrix.max-level && github.event.pull_request.merged == true
uses: actions/cache/save@v4
with:
path: |
test/phpstan-baseline.neon
key: phpstan-baseline-${{ github.run_id }}"