From a0e530f1152d25796fb2b2c8ac352c6ff61dcb2e Mon Sep 17 00:00:00 2001 From: Shivam Arora Date: Sun, 26 Jun 2022 00:39:24 +0530 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20example=20for=20cl?= =?UTF-8?q?ojure=20lein=20project=20deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Clojure, Lein tool is used to generate template for various projects. Lein project metadata (including project dependencies) are stored in prject.clj (in root directory) file. Lein downloads dependencies in classpath (~/.m2/repository). So here I am caching ~/.m2/repository path for reusing cache in subsequent builds. --- README.md | 1 + examples.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 0a3215f..1bfcc18 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Every programming language and framework has its own way of caching. See [Examples](examples.md) for a list of `actions/cache` implementations for use with: - [C# - NuGet](./examples.md#c---nuget) +- [Clojure - Lein Deps](./examples.md#clojure---lein-deps) - [D - DUB](./examples.md#d---dub) - [Deno](./examples.md#deno) - [Elixir - Mix](./examples.md#elixir---mix) diff --git a/examples.md b/examples.md index d9c4499..fca1f8c 100644 --- a/examples.md +++ b/examples.md @@ -1,6 +1,7 @@ # Examples - [C# - NuGet](#c---nuget) +- [Clojure - Lein Deps](#clojure---lein-deps) - [D - DUB](#d---dub) - [POSIX](#posix) - [Windows](#windows) @@ -80,6 +81,19 @@ steps: ${{ runner.os }}-nuget- ``` +## Clojure - Lein Deps + +```yaml +- name: Cache lein project dependencies + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-clojure-${{ hashFiles('**/project.clj') }} + restore-keys: | + ${{ runner.os }}-clojure +``` + + ## D - DUB ### POSIX