]> git.mxchange.org Git - friendica.git/commitdiff
Add cache in phpmd workflow
authorArt4 <art4@wlabs.de>
Thu, 23 Jan 2025 15:11:59 +0000 (15:11 +0000)
committerArt4 <art4@wlabs.de>
Thu, 23 Jan 2025 15:11:59 +0000 (15:11 +0000)
.woodpecker/.phpmd_check.yml

index 1707aa589597550070f0abd809f5b37561add0e9..f03e44eec932ba821f7b43b3129a47a3ff592389 100644 (file)
@@ -9,9 +9,38 @@ when:
   event: [ pull_request, push ]
 
 steps:
+  restore_cache:
+    image: meltwater/drone-cache:dev
+    settings:
+      backend: "filesystem"
+      restore: true
+      cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
+      archive_format: "gzip"
+      mount:
+        - '.composer'
+    volumes:
+      - /tmp/drone-cache:/tmp/cache
+
+  composer_install:
+    image: friendicaci/php8.3:php8.3.3
+    commands:
+      - mkdir addon # create empty addon folder to appease composer
+      - export COMPOSER_HOME=.composer
+      - ./bin/composer.phar install --prefer-dist
+
+  rebuild_cache:
+    image: meltwater/drone-cache:dev
+    settings:
+      backend: "filesystem"
+      rebuild: true
+      cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
+      archive_format: "gzip"
+      mount:
+        - '.composer'
+    volumes:
+      - /tmp/drone-cache:/tmp/cache
+
   phpmd:
     image: friendicaci/php8.3:php8.3.3
     commands:
-      - mkdir addon
-      - ./bin/composer.phar install
       - ./bin/composer.phar run phpmd