jiro4989 / setup-nim-action

Set up your GitHub Actions workflow with a specific version of Nim
MIT License
98 stars 11 forks source link

Question: Are where any advantage to cache .choosenim ? #18

Closed inv2004 closed 4 years ago

inv2004 commented 4 years ago

Hello,

Thank you for your package, I added it to https://github.com/nim-lang/Nim/wiki/BuildServices , because I suppose it is the easiest way to setup github actions for nim.

But I have a question: In "Use cache" example I see caching for ~/.choosenim, but in the source file I see it downloads choosenim every installation. Are there any reasons to use this cache in the case?

It is clear why cache .nimble.

Thank you,

jiro4989 commented 4 years ago

In "Use cache" example I see caching for ~/.choosenim, but in the source file I see it downloads choosenim every installation. Are there any reasons to use this cache in the case?

The reason is speed-up for devel version of Nim. This build-job uses only 1 sec.

The build of devel or devel --latest needs much time. Choosenim switches vesion of compiler if ~/.choosenim has existed. (But this means devel is not always really latest ...)

The CI probably does not need caching ~/.choosenim If you will not use devel compiler.

jiro4989 commented 4 years ago

I removed ~/.choosenim cache from basic usage.

And I added a new example for devel --latest. https://github.com/jiro4989/setup-nim-action#devel---latest-usage

This example needs a caching ~/.choosenim for speed-up.

Thank your question.

inv2004 commented 4 years ago

Do I understand correct that it runs choosenim every run anyway?

Are there any way to compare Nim version from .nimble with nim-version value and run installation if it is not equal only? Or something like that.

On Mon, Jun 1, 2020, 17:37 jiro notifications@github.com wrote:

I removed ~/.choosenim cache from basic usage.

And I added a new example for devel --latest. https://github.com/jiro4989/setup-nim-action#devel---latest-usage

This example needs a caching ~/.choosenim for speed-up.

Thank your question.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jiro4989/setup-nim-action/issues/18#issuecomment-636896577, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFYITOZU4PB53H4WBG3WW3RUO4J5ANCNFSM4NPKZ4CA .

jiro4989 commented 4 years ago

Do I understand correct that it runs choosenim every run anyway?

I think that is not correct. But it effects only a few minute of CI workflow. I don't care.

Are there any way to compare Nim version from .nimble with nim-version value and run installation if it is not equal only?

No. setup-nim-action does not have the function like it.

inv2004 commented 4 years ago

Thank you for your answers. I was thinking how to reduce build time as much as possible for stable nim