Conversation
|
Looks good so far, can you add a test workflow to test just the saveOnly part? You can start by copying this file: https://github.com/tespkg/actions-cache/blob/main/.github/workflows/test.yml to a new file and modify the bits needed. |
|
| test-cache | ||
| ~/test-cache | ||
|
|
||
| test-restore-only: |
There was a problem hiding this comment.
I'm not sure this tests the new functionality. Can you elaborate how does this test the restore-only?
In my previous comment, I meant that you should make a new file and use your pattern of "save" and "restore" actions.
There was a problem hiding this comment.
Note how it uses the new sub-action that restores only via the uses: ./restore/ here:
They could be put into a different workflow, but it seemed redundant to me as it also functions just fine in this one. I can move it into a separate workflow if you'd prefer though
There was a problem hiding this comment.
The tests is setup so that it logs the machine ID it runs on and restores on the same machine. I know, it can be so much better, but it works so far. So a separate file will probably put it on a different machine. Hence tests the actual thing. If put in the same file it'll pick up from the previous step.
After written all these, I realised you do distinguish using the key. so all good for me.
| test-cache | ||
| ~/test-cache | ||
|
|
||
| test-restore-only: |
There was a problem hiding this comment.
The tests is setup so that it logs the machine ID it runs on and restores on the same machine. I know, it can be so much better, but it works so far. So a separate file will probably put it on a different machine. Hence tests the actual thing. If put in the same file it'll pick up from the previous step.
After written all these, I realised you do distinguish using the key. so all good for me.
Changes
Adds save and restore sub-actions to match the official actions cache behaviour and make this action a true drop in replacement for the official github cache action.
Usage is fairly straight forward, to save to the cache only (note the
/saveat the end of theuseskey):To restore only (note the
/restoreat the end of theuseskey)::Fix Issues
Closes #38