Add a key to steps-cache-push and steps-cache-pull

Description of the feature request

Add a key to identify the cache and allow multiple cache to exist.

Use case / for what or how I would use it

We have separate workflows to build iOS and Android apps.
They run in parallel.
Then other workflows are called (one for each OS) to handle the deployment and others for running tests.
All of this is to keep the running time of each workflow to the minimum.

With the cache based solely to the branch name (why not the commit hash, it’s a mystery), when workflows run in parallel, one cache could overwrite the other.

By adding a key, I can have one cache pushed and pulled for each OS.

That key can be a simple string or a variable (e.g. the commit hash), or a combination of the two (e.g. Android-${BITRISE_GIT_COMMIT}).

That key can be used by the VM to store the cache in a subfolder.

This is also necessary if you use different stacks for each platform:

current stack id: osx-xcode-12.3.x

archive stack id: linux-docker-android

Cache was created on stack: linux-docker-android, current stack: osx-xcode-12.3.x

Skipping cache pull, because of the stack has changed

Hi @andrea.s,

Thank you for posting this it’s a great request indeed🙂

As the list of feature requests are continuously growing, I cannot provide an ETA, but the team will look into it as soon as possible!

This has been released

See: Key-based caching - Bitrise Docs

1 Like