From 5a5bcb3b0bc6b4290f182041c33b5ea4064803ee Mon Sep 17 00:00:00 2001 From: wotnak Date: Sun, 31 Dec 2023 09:27:33 +0100 Subject: [PATCH] Persist phpstan result cache between workflow runs --- .github/workflows/deliver.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deliver.yml b/.github/workflows/deliver.yml index 88bac18cc..ffe38472c 100644 --- a/.github/workflows/deliver.yml +++ b/.github/workflows/deliver.yml @@ -73,14 +73,15 @@ jobs: run: docker load < /tmp/farmos-dev.tar - name: Create cache directory run: mkdir -p ./cache - - name: Load phpcs cache + - name: Load phpcs and phpstan cache uses: actions/cache/restore@v3 with: path: | ./cache/.phpcs.cache.farmos ./cache/.phpcs.cache.contrib - key: phpcs-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib') }} - restore-keys: phpcs- + ./cache/resultCache.php + key: phpcs-phpstan-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib', './cache/resultCache.php') }} + restore-keys: phpcs-phpstan- - name: Run PHP CodeSniffer run: | docker run \ @@ -88,20 +89,25 @@ jobs: farmos/farmos:3.x-dev \ phpcs --cache=/tmp/phpcs/.phpcs.cache.farmos --parallel=$(nproc) /opt/drupal/web/profiles/farm - name: Run PHPStan - run: docker run farmos/farmos:3.x-dev phpstan analyze --memory-limit 1G /opt/drupal/web/profiles/farm + run: | + docker run \ + -v ./cache:/tmp/phpstan \ + farmos/farmos:3.x-dev \ + phpstan -vvv analyze --memory-limit 1G /opt/drupal/web/profiles/farm - name: Check PHP compatibility of contrib modules and themes (ignore warnings). run: | docker run \ -v ./cache:/tmp/phpcs \ farmos/farmos:3.x-dev \ phpcs --cache=/tmp/phpcs/.phpcs.cache.contrib --parallel=$(nproc) --standard=PHPCompatibility --runtime-set testVersion 8.2- --warning-severity=0 /opt/drupal/web/modules /opt/drupal/web/themes - - name: Save phpcs cache + - name: Save phpcs and phpstan cache uses: actions/cache/save@v3 with: path: | ./cache/.phpcs.cache.farmos ./cache/.phpcs.cache.contrib - key: phpcs-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib') }} + ./cache/resultCache.php + key: phpcs-phpstan-${{ hashFiles('./cache/.phpcs.cache.farmos', './cache/.phpcs.cache.contrib', './cache/resultCache.php') }} test: name: Run PHPUnit tests