-
Notifications
You must be signed in to change notification settings - Fork 315
93 lines (79 loc) · 2.6 KB
/
Copy pathphpstan.yaml
File metadata and controls
93 lines (79 loc) · 2.6 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: PHPStan
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
phpstan:
runs-on: ubuntu-latest
# define every php version to test
strategy:
# do not stop at first fail
fail-fast: false
matrix:
php: [7.4, 8.2]
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php }} for dependencies
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
run: composer update --ignore-platform-reqs
- name: Restore PHPStan cache
id: cache-phpstan
uses: actions/cache/restore@v5
with:
path: phpstan.phar
key: phpstan-1
- name: Run PHPStan
run: vendor/bin/phpstan analyse --configuration phpstan.neon
update-baseline:
needs: phpstan
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Delete existing branch if exists
run: |
if git ls-remote --heads origin update-phpstan-baseline | grep -q update-phpstan-baseline; then
git push origin --delete update-phpstan-baseline
fi
- name: Setup PHP 7.4 for dependencies
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Install Dependencies
run: composer update --ignore-platform-reqs
- name: Generate new baseline
id: generate-baseline
run: |
cp phpstan-baseline.neon phpstan-baseline.neon.old
vendor/bin/phpstan analyse --configuration phpstan.neon --generate-baseline
if ! diff -q phpstan-baseline.neon phpstan-baseline.neon.old > /dev/null; then
echo "baseline_changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.generate-baseline.outputs.baseline_changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
commit-message: '[skip ci] Update PHPStan baseline'
title: '[CI] Update PHPStan baseline'
body: |
Automatic update of the PHPStan baseline following error fixes.
This PR was automatically generated by the CI/CD workflow.
branch: update-phpstan-baseline
base: develop
delete-branch: true
add-paths: |
phpstan-baseline.neon
reviewers: |
zoic21
Hotfirenet
Salvialf
Sekiro-kost
reineabs
Mips2648