Skip to content

Commit daf5166

Browse files
ci(phpstan): add caching to speed up the CI
1 parent 937cfb2 commit daf5166

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/lint-and-analyse-php.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ jobs:
143143
- name: Install Composer dependencies
144144
uses: ramsey/composer-install@v3
145145

146+
- name: Cache PHPStan result cache
147+
uses: actions/cache@v5
148+
with:
149+
path: var/cache/phpstan
150+
key: phpstan-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.lock', 'phpstan.neon', 'phpstan_next.neon') }}
151+
restore-keys: |
152+
phpstan-${{ runner.os }}-${{ matrix.php-version }}-
153+
146154
- name: Analyse files with PHPStan
147155
run: composer phpstan -- --error-format=github --no-progress --memory-limit 2G
148156

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ includes:
44
parameters:
55
level: 2
66
errorFormat: prettyJson
7+
tmpDir: var/cache/phpstan/base
78
treatPhpDocTypesAsCertain: false
89
paths:
910
- Controls

phpstan_next.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ includes:
44
parameters:
55
level: 3
66
errorFormat: prettyJson
7+
tmpDir: var/cache/phpstan/next
78
treatPhpDocTypesAsCertain: false
89
paths:
910
- Controls

0 commit comments

Comments
 (0)