Skip to content

twosigma/maven-cache-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

84c1f20 · Jan 23, 2025

History

13 Commits
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Jan 14, 2025
Dec 29, 2024
Jan 6, 2025
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024
Dec 29, 2024

Repository files navigation

maven-cache-cleaner

CI Check dist/

This action cleans up all Maven dependencies not used after calling the cache cleaner action. It is intended to be used after actions/cache to clean up the cache right before saving it. It is intended to prevent the cache from growing infinitely large with dependencies that are no longer used.

This action uses atime to determine if a dependency was used or not. If a dependency was not used, it will be deleted.

The action cleaning mechanism is inspired by this StackOverflow answer.

Usage

Add these near the top of the workflow:

- uses: actions/cache@v4
  with:
    path: ~/.m2/repository
    key: ${{ runner.os }}-maven-build # Or any other key you want
- uses: twosigma/maven-cache-cleaner@v1

Any files not accessed within the ~/.m2 directory after the twosigma/maven-cache-cleaner step will be deleted at the end of the action, before actions/cache saves the directory.

Developer Guide

Setup

$ npm install

Do a full build/lint/package run:

$ npm run all

Make sure to run the above before committing changes, or the GitHub action will fail.