Yarn cache and cache-push/pull


I am trying to improve the caching on our builds for a react-native app.
I know that there is the cache steps (cache-push / cache-pull), but there is also a caching option added to the yarn step: https://github.com/bitrise-steplib/steps-yarn/blob/master/step.yml#L40

I am wondering how those two things coexist and if there is a specific setup to use?
If I use the caching on the yarn step, what happens to the caching on cache-push, etc.

It kind of relates to this question: How can I use cache push/pull for react native apps?

Thank you!

Hi @fabien_hinge!

Yarn caching happens automatically through the push and pull steps by default.The input you are referring to here, can be used to cache the contents of the node_modules directories located under the project root, in addition.

Hope this helps!

1 Like

Thank you.

Just to clarify:

Yarn caching happens automatically through the push and pull steps by default.

Do you mean that push/pull caches the node_modules as well?
Or what’s getting cached otherwise? I am struggling to understand the diff


1 Like

No worries!

We’ve dug into the step a bit more and turns out what I stated above was not correct, and your question is totally just, the step isn’t caching anything by default, only when the input is enabled.

Ok thank you, I think it’s clearer. I will give it another try

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.