diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e18f0ad..cb7f712 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,14 +23,5 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - uses: actions-rs/cargo@v1 - with: - command: test --release \ No newline at end of file + - uses: dtolnay/rust-toolchain@stable + - run: cargo test --features test \ No newline at end of file diff --git a/crates/nsis-process/Cargo.toml b/crates/nsis-process/Cargo.toml index 61ed417..a0cd6fa 100644 --- a/crates/nsis-process/Cargo.toml +++ b/crates/nsis-process/Cargo.toml @@ -8,6 +8,9 @@ license = { workspace = true } [lib] crate-type = ["cdylib"] +[features] +test = [] + [dependencies] nsis-plugin-api = { workspace = true } windows-sys = { workspace = true } diff --git a/crates/nsis-process/build.rs b/crates/nsis-process/build.rs index f27bc53..ce8d102 100644 --- a/crates/nsis-process/build.rs +++ b/crates/nsis-process/build.rs @@ -1,3 +1,5 @@ fn main() { - println!("cargo::rustc-link-arg=/ENTRY:DllMain") + if std::env::var("CARGO_FEATURE_TEST").as_deref() != Ok("1") { + println!("cargo::rustc-link-arg=/ENTRY:DllMain") + } } diff --git a/crates/nsis-semvercompare/Cargo.toml b/crates/nsis-semvercompare/Cargo.toml index e1a5469..15e9f95 100644 --- a/crates/nsis-semvercompare/Cargo.toml +++ b/crates/nsis-semvercompare/Cargo.toml @@ -8,6 +8,9 @@ license = { workspace = true } [lib] crate-type = ["cdylib"] +[features] +test = [] + [dependencies] semver = { version = "1.0", default-features = false } nsis-plugin-api = { workspace = true } diff --git a/crates/nsis-semvercompare/build.rs b/crates/nsis-semvercompare/build.rs index f27bc53..ce8d102 100644 --- a/crates/nsis-semvercompare/build.rs +++ b/crates/nsis-semvercompare/build.rs @@ -1,3 +1,5 @@ fn main() { - println!("cargo::rustc-link-arg=/ENTRY:DllMain") + if std::env::var("CARGO_FEATURE_TEST").as_deref() != Ok("1") { + println!("cargo::rustc-link-arg=/ENTRY:DllMain") + } } diff --git a/crates/nsis-tauri-utils/Cargo.toml b/crates/nsis-tauri-utils/Cargo.toml index 56d3c73..40918a4 100644 --- a/crates/nsis-tauri-utils/Cargo.toml +++ b/crates/nsis-tauri-utils/Cargo.toml @@ -8,6 +8,9 @@ license = { workspace = true } [lib] crate-type = ["cdylib"] +[features] +test = [] + [dependencies] nsis-plugin-api = { workspace = true } windows-sys = { workspace = true } diff --git a/crates/nsis-tauri-utils/build.rs b/crates/nsis-tauri-utils/build.rs index 8243482..3a7a7cf 100644 --- a/crates/nsis-tauri-utils/build.rs +++ b/crates/nsis-tauri-utils/build.rs @@ -1,6 +1,8 @@ fn main() { combine_plugins_and_write_to_out_dir(); - println!("cargo::rustc-link-arg=/ENTRY:DllMain") + if std::env::var("CARGO_FEATURE_TEST").as_deref() != Ok("1") { + println!("cargo::rustc-link-arg=/ENTRY:DllMain") + } } /// Combines the plugins into one file that is included in lib.rs