Open holyjak opened 1 year ago
setup-babashka
should also use the cache if available.
See:
Is there an indication that this is not working as expected?
Hi @nha , Below log is from one of our actions, and it's been running for weeks. And this is from its latest run
Looks, it couldn't find any cached version, and downloads bb.
This is the part of action
- name: Install babashka v1.3.188
uses: turtlequeue/setup-babashka@v1.5.0
with:
babashka-version: '1.3.188'
@nha , I use the below snippet to workaround, it looks to work, is it possible that the issue is Windows only?
- name: Cache Babashka binary (Workaround)
uses: actions/cache@v4
id: cache-bb
with:
# save-always: true
path: C:\hostedtoolcache\windows\Babashka\1.3.188\x64
key: ${{ runner.os }}-bb-1.3.188
- name: Install babashka v1.3.188
if: steps.cache-bb.outputs.cache-hit != 'true'
uses: turtlequeue/setup-babashka@v1.5.0
with:
babashka-version: '1.3.188'
- name: add bb to path
if: steps.cache-bb.outputs.cache-hit == 'true'
run: echo "C:\hostedtoolcache\windows\Babashka\1.3.188\x64" >> $env:GITHUB_PATH
@liny01-nbsa Thank you for the report, I will look into it. While I do not use Windows myself, it should work all the same. Do I understand correctly that you are using the self-hosted github runner?
@nha , no, we are using the hosted runner. windows-latest
.
Please give a try to v1.7.0.
I should also mention that I am not convinced if caching makes a practical difference here because it usually takes about 3 seconds to run the action without caching.
@nha , thank you! That is a very interesting point. I don't have access to my workstation now. But from my screenshot, I noticed in about Jan 2024, a non-cached run would take > 1 min.
I will test the new version when I got back.
Oh interesting. Here is a sample run from the main
branch on windows, it took 3s:
https://github.com/turtlequeue/setup-babashka/actions/runs/8510483088/job/23308162033
I see that every run of the setup action, bb is downloaded anew. It should be possible to cache it.
Actually looking at DeLaGuardo/setup-clojure@10.1 it seems it does cache it itself:
so perhaps setup-babashka could do the same? 🙏