Skip to content

Commit abb81b6

Browse files
committed
Refines CI workflow for workspace compatibility
Replaces --all-features with --workspace in build, test, and doc commands to align with multi-package workspace setup. Adds targeted clippy and test runs for birefnet package with train features to ensure comprehensive coverage. Updates security audit permissions for precision.
1 parent 96047df commit abb81b6

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/rust.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
with:
3131
components: clippy
3232
- uses: Swatinem/rust-cache@v2
33-
- run: cargo clippy --all-targets --all-features -- -D warnings
33+
- run: cargo clippy --workspace --all-targets -- -D warnings
34+
- run: cargo clippy -p birefnet --features train --all-targets -- -D warnings
3435

3536
test:
3637
name: Test Suite
@@ -45,9 +46,9 @@ jobs:
4546
with:
4647
toolchain: ${{ matrix.rust }}
4748
- uses: Swatinem/rust-cache@v2
48-
- run: cargo build --all-features
49-
- run: cargo test --all-features
50-
- run: cargo test --no-default-features
49+
- run: cargo build --workspace
50+
- run: cargo test --workspace
51+
- run: cargo test -p birefnet --features train
5152

5253
docs:
5354
name: Documentation
@@ -56,13 +57,16 @@ jobs:
5657
- uses: actions/checkout@v6
5758
- uses: dtolnay/rust-toolchain@stable
5859
- uses: Swatinem/rust-cache@v2
59-
- run: cargo doc --all-features --no-deps
60-
- run: cargo test --doc
60+
- run: cargo doc --workspace --no-deps
61+
- run: cargo test --workspace --doc
6162

6263
security-audit:
6364
name: Security Audit
6465
runs-on: ubuntu-latest
65-
permissions: write-all
66+
permissions:
67+
checks: write
68+
contents: read
69+
issues: write
6670
steps:
6771
- uses: actions/checkout@v6
6872
- uses: rustsec/audit-check@v2
@@ -78,8 +82,8 @@ jobs:
7882
with:
7983
toolchain: 1.85.1
8084
- uses: Swatinem/rust-cache@v2
81-
- run: cargo build --all-features
82-
- run: cargo test --all-features
85+
- run: cargo build --workspace
86+
- run: cargo test --workspace
8387

8488
coverage:
8589
name: Code Coverage
@@ -89,7 +93,7 @@ jobs:
8993
- uses: dtolnay/rust-toolchain@stable
9094
- uses: Swatinem/rust-cache@v2
9195
- uses: taiki-e/install-action@cargo-llvm-cov
92-
- run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
96+
- run: cargo llvm-cov --workspace --lcov --output-path lcov.info
9397
- uses: codecov/codecov-action@v5
9498
with:
9599
files: lcov.info
@@ -102,4 +106,4 @@ jobs:
102106
- uses: actions/checkout@v6
103107
- uses: dtolnay/rust-toolchain@stable
104108
- uses: Swatinem/rust-cache@v2
105-
- run: cargo bench --no-run
109+
- run: cargo bench --workspace --no-run

crates/birefnet/src/inference.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ pub fn run_inference(config: &InferenceConfig, device: &InferenceDevice) -> Resu
100100
} else if config.input_path.is_dir() {
101101
process_directory(&model, &config.input_path, &config.output_path, device)?;
102102
} else {
103-
anyhow::bail!(
104-
"Input path does not exist: {}",
105-
config.input_path.display()
106-
);
103+
anyhow::bail!("Input path does not exist: {}", config.input_path.display());
107104
}
108105

109106
tracing::info!("inference completed");

0 commit comments

Comments
 (0)