Skip to content

Commit

Permalink
fix: fully removed deleted features
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Oct 30, 2024
1 parent e171ad8 commit 9b0c9f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 116 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ on:

jobs:
test:
name: 'Test action (${{ matrix.os }}, prebuilt: ${{ matrix.prebuilt }}, cache: ${{ matrix.cache }})'
name: 'Test action (${{ matrix.os }})'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
prebuilt: [true, false]
cache: [true, false]
project-path: ['.', subdir]
# project-path: ['.', subdir]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand All @@ -28,29 +26,27 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Initialize Rust project
run: cargo init --bin ${{ matrix.project-path }}
run: cargo init --bin

- name: Cache build files
uses: Leafwing-Studios/cargo-cache@v2
with:
manifest-path: ${{ matrix.project-path }}/Cargo.toml
cargo-target-dir: ${{ matrix.project-path }}/target
manifest-path: Cargo.toml
cargo-target-dir: target
# Disable `cargo-cache`'s `cargo-sweep` integration.
sweep-cache: false

- name: Build Rust project
working-directory: ${{ matrix.project-path }}
# working-directory: ${{ matrix.project-path }}
run: cargo build

- name: cargo-sweep
uses: ./
with:
use-cache: ${{ matrix.cache }}
use-prebuilt: ${{ matrix.prebuilt }}
project-path: ${{ matrix.project-path }}
# with:
# project-path: ${{ matrix.project-path }}

- name: Check Rust project
working-directory: ${{ matrix.project-path }}
# working-directory: ${{ matrix.project-path }}
run: cargo check

# `cargo-sweep` should delete all build files, but keep the check ones.
19 changes: 0 additions & 19 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,12 @@ name: cargo-sweep
author: BD103
description: Sweep away unused Cargo files from the `target` directory.
inputs:
use-cache:
description: |
If true, the action will save `cargo-sweep` to the Github Actions cache and restore it
instead of compiling / downloading it again. This can greatly speed up this action when
`use-prebuilt` is false, but has little effect when it is true. By default this is true.
required: false
default: true
use-prebuilt:
description: |
If true, the action will download a prebuilt binary of `cargo-sweep` instead of installing it
using `cargo install`. By default this is false.
required: false
default: false
project-path:
description: |
The path to the folder containing `Cargo.toml` and `target`, without a trailing slash. By
default this is the current working directory.
required: false
default: '.'
gh-token:
description: |
The Github token used to fetch the most recent artifact. This defaults to
`github.token`, but is only required if `use-prebuilt` is true.
required: false
default: ${{ github.token }}
runs:
using: node20
main: dist/main/index.js
Expand Down
84 changes: 0 additions & 84 deletions src/index.js

This file was deleted.

0 comments on commit 9b0c9f8

Please sign in to comment.