diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index d9a68fee88..ca1a860efd 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -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/sccache-action@v0.0.5 diff --git a/.github/workflows/clear-caches.yml b/.github/workflows/clear-caches.yml new file mode 100644 index 0000000000..5bee0dc29f --- /dev/null +++ b/.github/workflows/clear-caches.yml @@ -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 }}