Skip to content

Cache integration between actions/setup-java and actions/cache / actions/cache/restore #597

Open
@caquino

Description

@caquino

Description:
Expose cache-primary-key as an output to allow integration with actions/cacheand actions/cache/restore.

Justification:
Caching rules differ according to the build tool used (mvn/sbt/etc), and I would like to leverage the logic already implemented on actions/setup-java to handle the specifics for each build tool.

That being said, I have dependent jobs that I would like to guarantee that the same cache is used by forcing the same cache key.

I understand that any advanced cache usage should be done manually using actions/cache, but just exposing the cache key used by actions/setup-java as an output, like cache-hit, would make it possible to extend the functionality from actions/setup-java.

Another possibility would be for actions/setup-java not only to set an output with the cache key but also to accept an input cache-key, but I think this goes into the realm of "should be done using actions/cache".

Are you willing to submit a PR?

My understanding is that a small change here to set an output, and to action.yml to declare the output, would suffice.
I would be more than happy to submit a PR, but before doing so, I would like to check with the team to see if this aligns with the vision for the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions