Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ permissions:
contents: read

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install Rust
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
with:
toolchain: stable
components: clippy

- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ubuntu-latest-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ubuntu-latest-cargo-clippy-

- name: Run clippy
run: cargo clippy --workspace --all-features -- -D warnings

test:
strategy:
matrix:
Expand All @@ -22,7 +47,6 @@ jobs:
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
with:
toolchain: stable
components: clippy

- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
Expand All @@ -34,9 +58,6 @@ jobs:
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ matrix.os }}-cargo-

- name: Run clippy
run: cargo clippy --workspace --all-features -- -D warnings

- name: Run tests
run: cargo test --workspace --all-features

Expand Down Expand Up @@ -120,5 +141,12 @@ jobs:
with:
python-version: "3.12"

- name: Setup Ruby
if: matrix.suite == 'e2e_gem'
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
with:
ruby-version: '3.2'
bundler-cache: false

- name: Run e2e tests
run: cargo test -p socket-patch-cli --all-features --test ${{ matrix.suite }} -- --ignored
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cargo install socket-patch-cli
By default this builds with npm and PyPI support. For additional ecosystems:

```bash
cargo install socket-patch-cli --features cargo,golang,maven,gem,composer,nuget
cargo install socket-patch-cli --features cargo,golang,maven,composer,nuget
```

## Quick Start
Expand Down
1 change: 0 additions & 1 deletion crates/socket-patch-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ tempfile = { workspace = true }
[features]
default = []
cargo = ["socket-patch-core/cargo"]
gem = ["socket-patch-core/gem"]
golang = ["socket-patch-core/golang"]
maven = ["socket-patch-core/maven"]
composer = ["socket-patch-core/composer"]
Expand Down
4 changes: 0 additions & 4 deletions crates/socket-patch-cli/src/ecosystem_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::path::PathBuf;

#[cfg(feature = "cargo")]
use socket_patch_core::crawlers::CargoCrawler;
#[cfg(feature = "gem")]
use socket_patch_core::crawlers::RubyCrawler;
#[cfg(feature = "golang")]
use socket_patch_core::crawlers::GoCrawler;
Expand Down Expand Up @@ -141,7 +140,6 @@ pub async fn find_packages_for_purls(
}

// gem
#[cfg(feature = "gem")]
if let Some(gem_purls) = partitioned.get(&Ecosystem::Gem) {
if !gem_purls.is_empty() {
let ruby_crawler = RubyCrawler;
Expand Down Expand Up @@ -323,7 +321,6 @@ pub async fn crawl_all_ecosystems(
all_packages.extend(cargo_packages);
}

#[cfg(feature = "gem")]
{
let ruby_crawler = RubyCrawler;
let gem_packages = ruby_crawler.crawl_all(options).await;
Expand Down Expand Up @@ -468,7 +465,6 @@ pub async fn find_packages_for_rollback(
}

// gem
#[cfg(feature = "gem")]
if let Some(gem_purls) = partitioned.get(&Ecosystem::Gem) {
if !gem_purls.is_empty() {
let ruby_crawler = RubyCrawler;
Expand Down
Loading
Loading