From f16ea755f57afc7387f3ffaf393dc7711204b9a7 Mon Sep 17 00:00:00 2001 From: Sander Muller Date: Thu, 25 Jun 2026 12:23:54 +0200 Subject: [PATCH] ci: cache PHPStan's result cache between runs The PHPStan static-analysis job ran with a cold cache on every push and PR, re-analysing the whole codebase each time, because PHPStan's tmpDir (.cache/phpstan) was not persisted between runs. Restore the cache before the run and save it afterwards (with `if: !cancelled()` so it is written even when PHPStan exits non-zero on findings), following PHPStan's documented CI recipe. `.cache/` is already gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/coding-conventions.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/coding-conventions.yml b/.github/workflows/coding-conventions.yml index 913f97d80..caa33aaf4 100644 --- a/.github/workflows/coding-conventions.yml +++ b/.github/workflows/coding-conventions.yml @@ -54,9 +54,24 @@ jobs: - name: Install composer dependencies uses: ramsey/composer-install@v3 + - name: Restore PHPStan result cache + uses: actions/cache/restore@v4 + with: + path: .cache/phpstan + key: "phpstan-result-cache-${{ github.run_id }}" + restore-keys: | + phpstan-result-cache- + - name: Run PHPStan run: vendor/bin/phpstan --error-format=github + - name: Save PHPStan result cache + uses: actions/cache/save@v4 + if: ${{ !cancelled() }} + with: + path: .cache/phpstan + key: "phpstan-result-cache-${{ github.run_id }}" + # rector: # name: "Run static analysis: Rector" # runs-on: ubuntu-latest