ios-templates icon indicating copy to clipboard operation
ios-templates copied to clipboard

Add workflow to clear GitHub action cache

Open phongvhd93 opened this issue 1 year ago • 2 comments

Why

The workflow of testing a PR has to cache the steps to cache pods and gems. Each PR will have 3 cache folders and around 20 ~ 30 MB each, and they will soon pile up when we create more and more PR. Thus, we should have a workflow to remove the cache of closed PR to free up the space on the hosting machine.

Screenshot 2023-09-18 at 08 42 38

Acceptance Criteria

  • Create a workflow that will be triggered when PR get merged or closed)
  • The caches related to the PR must be remove after that PR get merged or closed

Resources

  • https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries

phongvhd93 avatar Sep 19 '23 01:09 phongvhd93

@phongvhd93 This is a very interesting find. I read further on this and it seems that

When using self-hosted runners, caches from workflow runs are stored on GitHub-owned cloud storage. A customer-owned storage solution is only available with GitHub Enterprise Server.

So it's nothing to worry about on the self hosted machine. However; when using self-hosted machine, we remove the caching completely since pods are also cached on self-hosted machine with pod install.

blyscuit avatar Oct 04 '23 05:10 blyscuit

On the other hand, if the concern is with GitHub's provided storage, we do not need to worry as well because GitHub automatically manage the storage for the users.

blyscuit avatar Oct 04 '23 05:10 blyscuit