Skip to content

Commit 029b6ef

Browse files
committed
#1930 add caching for Github Workflow
1 parent 8fdabba commit 029b6ef

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/coding-standards.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,33 @@ jobs:
7171
extensions: curl, mbstring
7272
tools: composer:v2
7373
coverage: none
74+
75+
- name: Cache dependencies
76+
id: composer-cache
77+
uses: actions/cache@v3
78+
with:
79+
path: ./vendor
80+
key: composer-${{ hashFiles('**/composer.lock') }}
81+
7482
- name: Install dependencies
7583
run: composer install
7684

85+
- name: Restore cache PHPStan results
86+
id: phpstan-cache-restore
87+
uses: actions/cache/restore@v3
88+
with:
89+
path: .cache
90+
key: "phpstan-result-cache-${{ github.run_id }}"
91+
restore-keys: |
92+
phpstan-result-cache-
93+
7794
- name: Run PHPStan
7895
run: ./vendor/bin/phpstan analyse --no-interaction --no-progress --ansi
96+
97+
- name: Save cache PHPStan results
98+
id: phpstan-cache-save
99+
if: always()
100+
uses: actions/cache/save@v3
101+
with:
102+
path: .cache
103+
key: ${{ steps.phpstan-cache-restore.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)