Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.43 KB

README.md

File metadata and controls

40 lines (26 loc) · 1.43 KB

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.