diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4bb1b75..dbe3b63 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,6 +14,6 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose -- --test-threads 1 + run: cargo test --verbose --features githubActions -- --test-threads 1 - name: Clippy run: cargo clippy diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8d73058..7e685ec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,6 +14,6 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose -- --test-threads 1 + run: cargo test --verbose --features githubActions -- --test-threads 1 - name: Clippy run: cargo clippy diff --git a/Cargo.toml b/Cargo.toml index b639bc7..998fdbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,10 @@ users = "0.11.0" [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies] keyring = "0.10.1" +# Features +[features] +githubActions = [] # used to run particular on github actions + [[bin]] name = "termscp" path = "src/main.rs" diff --git a/src/utils/git.rs b/src/utils/git.rs index a6b5e4f..f92b500 100644 --- a/src/utils/git.rs +++ b/src/utils/git.rs @@ -78,6 +78,7 @@ mod tests { use super::*; #[test] + #[cfg(not(all(target_os = "macos", feature = "githubActions")))] fn test_utils_git_check_for_updates() { assert!(check_for_updates("100.0.0").ok().unwrap().is_none()); assert!(check_for_updates("0.0.1").ok().unwrap().is_some());