Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deps caching example to README.md #64

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ jobs:
cljstyle: 0.15.0 # cljstyle
cmd-exe-workaround: 'latest' # Replaces `clojure` with `deps.clj` on Windows
zprint: 1.2.3 # zprint

# Optional step:
- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen variation that use runner.os as the part of key, but seems like it's quite safe to use same cache for all platforms. Maybe I'm wrong, though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I don't see the reason to keep runner.os. Let's keep it the way you brought it :) thanks!

# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
# key: cljdeps-${{ hashFiles('project.clj') }}
# key: cljdeps-${{ hashFiles('build.boot') }}
restore-keys: cljdeps-

- name: Execute clojure code
run: clojure -e "(+ 1 1)"
Expand Down