From 0632225752ce6d3006ca12ffea9f632c5173b348 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 12 Aug 2024 09:44:35 +0100 Subject: [PATCH] build: test all feature combinations --- .forgejo/workflows/push-next.yml | 14 +++++++------- crates/cli/src/forge/mod.rs | 2 +- crates/cli/src/forge/tests.rs | 2 ++ justfile | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/push-next.yml b/.forgejo/workflows/push-next.yml index 20575cf..8d8b95b 100644 --- a/.forgejo/workflows/push-next.yml +++ b/.forgejo/workflows/push-next.yml @@ -18,21 +18,21 @@ jobs: uses: actions/checkout@v4 - name: Format - uses: https://git.kemitix.net/kemitix/rust@v1.80.0-2 + uses: https://git.kemitix.net/kemitix/rust@v1.80.1-1 with: args: cargo fmt --all -- --check - name: Clippy - uses: https://git.kemitix.net/kemitix/rust@v1.80.0-2 + uses: https://git.kemitix.net/kemitix/rust@v1.80.1-1 with: - args: cargo clippy + args: cargo hack --feature-powerset clippy - name: Build - uses: https://git.kemitix.net/kemitix/rust@v1.80.0-2 + uses: https://git.kemitix.net/kemitix/rust@v1.80.1-1 with: - args: cargo build + args: cargo hack --feature-powerset build - name: Test - uses: https://git.kemitix.net/kemitix/rust@v1.80.0-2 + uses: https://git.kemitix.net/kemitix/rust@v1.80.1-1 with: - args: cargo test + args: cargo hack --feature-powerset test diff --git a/crates/cli/src/forge/mod.rs b/crates/cli/src/forge/mod.rs index 12f06bb..a3e08a6 100644 --- a/crates/cli/src/forge/mod.rs +++ b/crates/cli/src/forge/mod.rs @@ -22,7 +22,7 @@ impl Forge { ForgeType::ForgeJo => Box::new(ForgeJo::new(repo_details, net)), #[cfg(feature = "github")] ForgeType::GitHub => Box::new(Github::new(repo_details, net)), - ForgeType::MockForge => unreachable!(), + _ => unreachable!(), } } } diff --git a/crates/cli/src/forge/tests.rs b/crates/cli/src/forge/tests.rs index dec6729..d6cb306 100644 --- a/crates/cli/src/forge/tests.rs +++ b/crates/cli/src/forge/tests.rs @@ -7,6 +7,7 @@ use git_next_core::{ GitDir, RepoConfigSource, StoragePathType, }; +#[cfg(feature = "forgejo")] #[test] fn test_forgejo_name() { let net = Network::new_mock(); @@ -15,6 +16,7 @@ fn test_forgejo_name() { assert_eq!(forge.name(), "forgejo"); } +#[cfg(feature = "github")] #[test] fn test_github_name() { let net = Network::new_mock(); diff --git a/justfile b/justfile index efa33b1..efcd8c8 100644 --- a/justfile +++ b/justfile @@ -8,9 +8,9 @@ validate-dev-branch: mock-ci: cargo fmt --check - cargo build - cargo test - cargo clippy + cargo hack --feature-powerset build + cargo hack --feature-powerset test + cargo hack --feature-powerset clippy start-ngrok: #!/usr/bin/env bash