From d82444b7bf0571e701358ee14342d7bd60eef610 Mon Sep 17 00:00:00 2001 From: Paul Redmond Date: Thu, 20 Jul 2023 15:25:22 -0700 Subject: [PATCH] feat: phpstan caching (#58) --- .github/workflows/php-stan.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/php-stan.yaml b/.github/workflows/php-stan.yaml index ec9c72c..0e3deb9 100644 --- a/.github/workflows/php-stan.yaml +++ b/.github/workflows/php-stan.yaml @@ -21,6 +21,11 @@ on: required: false type: string default: "phpstan-errors" + cache_path: + description: "The tmpDir path (i.e. ./.phpstan.cache)" + required: false + type: string + default: "./.phpstan.cache" secrets: packagist_username: required: true @@ -55,6 +60,14 @@ jobs: - name: Install composer dependencies uses: ramsey/composer-install@v2 + - name: Cache PHPStan Results + uses: actions/cache@v3 + with: + path: ${{ inputs.cache_path }} + key: "${{ runner.os }}-phpstan-${{ github.run_id }}" # always unique key - always writes a new cache + restore-keys: | + ${{ runner.os }}-phpstan- + - name: Run PHPStan run: ${{ inputs.command }} env: