cache icon indicating copy to clipboard operation
cache copied to clipboard

Add --remove-files on tarball creation

Open jlanga opened this issue 2 years ago • 2 comments

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.

jlanga avatar Nov 17 '23 09:11 jlanga

@bethanyj28 review please?

jlanga avatar May 01 '24 11:05 jlanga

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.

adazem009 avatar Jan 26 '25 14:01 adazem009