Skip to content

Commit

Permalink
Use the same cache cleanup as pola-rs (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Jul 10, 2024
1 parent 4ae7a28 commit 7fee1c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ runs:
- name: Rust Dependency Cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/develop' }}
save-if: ${{ github.ref_name == 'develop' }}
shared-key: "shared" # To allow reuse across jobs
cache-targets: false

- name: Cargo clean
shell: bash
run: |
cargo clean

- name: Rust Compile Cache
uses: mozilla-actions/[email protected]
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/clear-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Taken from pola-rs/polars
# Clearing caches regularly takes care of Rust caches growing to problematic size over time

name: Clear caches

on:
schedule:
- cron: '0 4 * * MON'
workflow_dispatch:

jobs:
clear-caches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Clear all caches
run: gh cache delete --all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7fee1c0

Please sign in to comment.