Skip to content

swlynch99/cargo-sweep-action

Repository files navigation

Create a GitHub Action Using TypeScript

GitHub Super-Linter CI Check dist/ CodeQL

Run cargo-sweep as part of your CI. When caching the target directory you usually want to continue from an older cache when Cargo.lock is updated. If you do this, however, then older artifacts can pile up in your target directory.

This action will use cargo-sweep to automatically remove any artifacts that were not used by the current job.

To use it, run it in your actions job after running your cache action:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      
      # Restore the cache
      - uses: Swatinem/rust-cache@v2

      # ... then setup cargo-sweep
      - uses: swlynch99/cargo-sweep-action@v1