Open yeikel opened 1 year ago
@timtebeek If you think it makes more sense to split it per setup type, we can try creating separate issues for each
I'm trying to think through how a change like this would align with our "do no harm" convention. While there's definitely an improvement and simplification to switch to setup type caching, it's hard to reliably cover all cases where users have made subtle changes to cache keys and paths, and how they would compare the the setup type cache keyword. What are your thoughts on that @yeikel ?
I'm trying to think through how a change like this would align with our "do no harm" convention. While there's definitely an improvement and simplification to switch to setup type caching, it's hard to reliably cover all cases where users have made subtle changes to cache keys and paths, and how they would compare the the setup type cache keyword. What are your thoughts on that @yeikel ?
I think that's a fair point. We definitely shouldn't make this replacement blindly as there are custom usages
Perhaps, we can start with simple base examples?
For example :
For maven, a common pattern is :
path: ~/.m2/repository
key: ${{ runner.os }}-main-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-main-maven-
There is nothing special about this example and the default caching feature can cover it
Just thinking out loud here; we can possibly use the new data tables feature to explore common patterns in a sizable set of projects, and then target the top x for transformation. It limits the applicability of this recipe, but ensures we don't make any unexpected changes. Would work best in a larger organization with some standardization I suppose, as opposed to in the wild on projects that do not share a common base.
actions/cache
cache
key to the corresponding actions/setupSee : https://github.com/actions/setup-java#caching-packages-dependencies https://github.com/actions/setup-node#caching-packages-dependencies https://github.com/actions/setup-python https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs
Examples:
I think that the main challenge here is to determine what type to use.
For example, for
actions/setup-java
we havemaven
,gradle
andsbt
as options. The recipe should be able to detect the package manager and make the correct selection