I have an idea that I think could speed up my PR builds and would like to know if it’s currently possible to implement this idea.
So, the idea itself is the following, when doing a PR build, I would like to tell the cache pull step to pull the cache from the ‘$base’ branch the PR is to be put on and disable the cache push step.
Is something currently feasible on the current step mode and the cache pull step somehow? I know the ‘$branch’ thing is available, so I think remaining things to know are:
- Is cache pull configurable to pick which branch to pull data from? (I think no in my ready of step options).
- How to conditionally change an input of a step based on a Go template evaluation? (Environment variable I would guess).
The reasoning here is that lots of PR do not change the actual dependencies. As such, starting with a pre-built cache that with high chance will be in “perfect” state would decrease the build time need to run PR.
Any insights in this? Maybe somehow already implemented something like? Or maybe cache pull is already working like this and I need to do (almost) nothing? (That would me awesome ).