Skip to content

Commit 34e3c57

Browse files
committed
Gate indicatif dependency and gha logic behind cargo features
1 parent 4bc6ec1 commit 34e3c57

File tree

5 files changed

+350
-274
lines changed

5 files changed

+350
-274
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rustfix = "0.8.1"
2323
cargo-platform = { version = "0.1.2", optional = true }
2424
comma = "1.0.0"
2525
anyhow = "1.0.6"
26-
indicatif = "0.17.6"
26+
indicatif = { version = "0.17.6", optional = true }
2727
prettydiff = { version = "0.7", default-features = false }
2828
annotate-snippets = { version = "0.11.2" }
2929
levenshtein = "1.0.5"
@@ -52,5 +52,6 @@ name = "build_std"
5252
test = false
5353

5454
[features]
55-
default = ["rustc"]
55+
default = ["rustc", "indicatif", "gha"]
56+
gha = []
5657
rustc = ["dep:cargo-platform", "dep:cargo_metadata"]

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub mod diagnostics;
4747
mod diff;
4848
mod error;
4949
pub mod filter;
50+
#[cfg(feature = "gha")]
5051
pub mod github_actions;
5152
mod mode;
5253
pub mod nextest;
@@ -76,6 +77,7 @@ pub fn run_tests(mut config: Config) -> Result<()> {
7677
);
7778
}
7879

80+
#[cfg(feature = "gha")]
7981
let name = display(&config.root_dir);
8082

8183
let text = match args.format {
@@ -88,7 +90,11 @@ pub fn run_tests(mut config: Config) -> Result<()> {
8890
vec![config],
8991
default_file_filter,
9092
default_per_file_config,
91-
(text, status_emitter::Gha::<true> { name }),
93+
(
94+
text,
95+
#[cfg(feature = "gha")]
96+
status_emitter::Gha::<true> { name },
97+
),
9298
)
9399
}
94100

0 commit comments

Comments
 (0)