-
-
Notifications
You must be signed in to change notification settings - Fork 143
73 lines (57 loc) · 1.92 KB
/
php-stan.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
72
73
name: "🐘 PHPStan"
on:
workflow_dispatch:
push:
branches:
- master
- release_3_*
pull_request:
branches:
- master
- release_3_*
defaults:
run:
working-directory: ./lizmap
jobs:
phpstan:
name: "Analyze"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get composer cache directory
id: get-composer-cache-dir
run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
# About the PHP version, do not forget to change in PHP Unit as well
with:
php-version: '8.0'
tools: phpstan:1.11.11
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ env.composer_cache_dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHPStan version
run: |
phpstan -V
echo "PHPSTAN_VERSION=$(phpstan -V)" >> $GITHUB_ENV
- name: Run PHPStan
id: test-phpstan
run: phpstan analyse -c ../phpstan.neon
- name: Notify in case of failure
uses: peter-evans/commit-comment@v3
if: failure()
with:
body: |
The latest run of **PHPStan** has **failed**, maybe it's due to a newer version released recently 😣
Current version used on CI :
> ${{ env.PHPSTAN_VERSION }}
https://github.com/phpstan/phpstan/releases
Have a look to **your** current version of PHPStan like :
➡ `docker exec CONTAINER_test_php tests/units/vendor/phpstan/phpstan/phpstan -V`
And update if needed :
➡ `./lizmap-ctl composer-update`