Closed alienxp03 closed 8 months ago
I'm not sure this is possible. How do you know the local assets are consistent with the remote?
One possible option is to check based on previous cache hit. Or any kind of cache key maybe? Some cache are very big and without this option, we have to pay quite a lot for S3 data transfer. And we could save few seconds/minutes too for each cache download.
From another repo: https://github.com/whywaita/actions-cache-s3#skipping-steps-based-on-cache-hit
Ah, yes, good point. We can check the previous downloaded compressed file. I think I'll implement this one. Thanks for the suggestion.
Revisiting this, I think the https://github.com/whywaita/actions-cache-s3#skipping-steps-based-on-cache-hit options is for the later steps to skip re-downloading dependencies that's already in the cache.
If you want to skip downloading the cache, you should probably have a step before the cache step to see if a good cache item already exists. For example (pseudo code):
- name: cache-exists
run: if cache exists then set-output skip-cache = true
- name: tespkg/actions-cache
if: ${{skip-cache != 'true'}}
...
Would be good if we could get this option.