ios-templates
ios-templates copied to clipboard
Add workflow to clear GitHub action cache
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.
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 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
.
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.