From 7012f3ced6ae580c337a29b36d9ea0bca84a99e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Wed, 28 May 2025 17:34:57 +0200 Subject: [PATCH] Add CI cache --- .drone.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.drone.yml b/.drone.yml index ca154e0..4a4f3d4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,26 @@ trigger: - push steps: + - name: compute cache key + image: docker.io/library/elixir:1.18.3-otp-27 + commands: + - mix_lock_hash=$(sha256sum mix.lock | cut -d ' ' -f 1) + - echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$mix_lock_hash" >> .cache_key + # Print cache key for debugging + - cat .cache_key + + - name: restore-cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - ./deps + - ./_build + ttl: 30 + volumes: + - name: cache + path: /cache + - name: lint image: docker.io/library/elixir:1.18.3-otp-27 commands: @@ -64,6 +84,22 @@ steps: # Run tests - mix test + - name: rebuild-cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - ./deps + - ./_build + volumes: + - name: cache + path: /cache + +volumes: + - name: cache + host: + path: /tmp/drone_cache + --- kind: pipeline type: docker