Add --remove-files on tarball creation
Add --remove-files on tarball creation
Description
Just added --remove-files flag to tar on the save section. This flag removes files on the fly as they are being added to the tarball.
Motivation and Context
When the cache size is too big, the elements to be cached and the tar.gz coexist at the same time, filling the disk space, and failing to produce an object.
This PR solves #1281 .
How Has This Been Tested?
By using tar on a linux machine. I created a folder and mock files, and after running tar, the folder and the files weren't there.
I ran npm run test and it passed.
Screenshots (if appropriate):
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (add or update README or docs)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
@bethanyj28 review please?
I'm having the out of space problem too. I think you should make this the default when the cache action is used (which automatically saves cache after the workflow completes successfully), but make it optional when the restore and save actions are used because removing the files might break steps after saving.