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

CI: Add reusable workflow to clear caches within a repository #43

Merged
merged 13 commits into from
Sep 9, 2022

Conversation

akihironitta
Copy link
Contributor

@akihironitta akihironitta commented Sep 8, 2022

Before submitting

  • [:eyes:] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Adds a reusable workflow that clears caches match with the given pattern.

Usage

name: Clear cache weekly

on:
  schedule:
    # on Sundays
    - cron: "0 0 * * 0"

jobs:
  clear-cache:
    uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@v9.9.9
    with:
      pattern: 'pip|conda|docs'  # remove caches whose key includes any of the strings (`pip`, `conda`, and `docs`).

or anther example here: Lightning-AI/pytorch-lightning#14593

Motivation

I think this will be very nice as we can simplify workflows by removing the logic around weekly cache reset (like env.TIME_PERIOD) from workflow files.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@akihironitta akihironitta added enhancement New feature or request ci/cd Continuous integration and delivery labels Sep 8, 2022
@akihironitta akihironitta merged commit 8c3847a into main Sep 9, 2022
@akihironitta akihironitta deleted the ci/clear-cache branch September 9, 2022 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous integration and delivery enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants