Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean cache directory after use #95

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Clean cache directory after use #95

merged 1 commit into from
Mar 6, 2023

Conversation

pascallj
Copy link
Contributor

@pascallj pascallj commented Feb 24, 2023

By splitting the restore and save steps of the cache action, we can run some steps after the post cache step which otherwise would be run at the end of the workflow.

This allows us to clean the cache directory after it has been saved. This fixes #94, allows us to save the cache even if the rest of the workflow fails and also has the minor benefit of reduced disk usage.

Differences for existing workflows:

  • You can't rely on the ~/cache-apt-pkgs directory being present (you shouldn't).
  • There is no message from actions/checkout to indicate that the cache is not saved because a cache-hit has occurred.

@awalsh128 awalsh128 merged commit 946776e into awalsh128:master Mar 6, 2023
@awalsh128
Copy link
Owner

Thanks again. Will fold these into a new patch in the next couple of days.

@pascallj pascallj deleted the clean-after-use branch March 6, 2023 14:59
@awalsh128
Copy link
Owner

Looks like there is a regression test failure I will need to look into to see if it is valid or not before patching.

awalsh128 added a commit that referenced this pull request Mar 24, 2023
* More robust checking of age of apt cache (#90)

* Don't install apt-fast from source (#96)

* Clean cache directory after use (#95)

* Only install apt-fast from source if not present (#97)

* Revert "Don't install apt-fast from source (#96)"

This reverts commit 854bb53.

* Only install apt-fast from source if not present

---------

Co-authored-by: John Hughes <jondo2010@gmail.com>
Co-authored-by: Pascal Roeleven <dev@pascalroeleven.nl>
awalsh128 added a commit that referenced this pull request Mar 24, 2023
* More robust checking of age of apt cache (#90)

* Don't install apt-fast from source (#96)

* Clean cache directory after use (#95)

* Only install apt-fast from source if not present (#97)

* Revert "Don't install apt-fast from source (#96)"

This reverts commit 854bb53.

* Only install apt-fast from source if not present

---------

Co-authored-by: John Hughes <jondo2010@gmail.com>
Co-authored-by: Pascal Roeleven <dev@pascalroeleven.nl>
awalsh128 added a commit that referenced this pull request Mar 24, 2023
* More robust checking of age of apt cache (#90)

* Don't install apt-fast from source (#96)

* Clean cache directory after use (#95)

* Only install apt-fast from source if not present (#97)

* Revert "Don't install apt-fast from source (#96)"

This reverts commit 854bb53.

* Only install apt-fast from source if not present

---------

Co-authored-by: John Hughes <jondo2010@gmail.com>
Co-authored-by: Pascal Roeleven <dev@pascalroeleven.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache contains all packages if used multiple times
2 participants