|
|
@@ -170,11 +170,16 @@
|
|
|
cargoExtraArgs = "--workspace";
|
|
|
});
|
|
|
|
|
|
- # Helper function to create clippy checks
|
|
|
- mkClippy = name: cargoArgs: craneLib.cargoClippy (commonCraneArgs // {
|
|
|
- pname = "cdk-clippy-${name}";
|
|
|
+ # Helper function to create combined clippy + test checks
|
|
|
+ # Runs both in a single derivation to share build artifacts
|
|
|
+ mkClippyAndTest = name: cargoArgs: craneLib.mkCargoDerivation (commonCraneArgs // {
|
|
|
+ pname = "cdk-check-${name}";
|
|
|
cargoArtifacts = workspaceDeps;
|
|
|
- cargoClippyExtraArgs = "${cargoArgs} -- -D warnings";
|
|
|
+ buildPhaseCargoCommand = ''
|
|
|
+ cargo clippy ${cargoArgs} -- -D warnings
|
|
|
+ cargo test ${cargoArgs}
|
|
|
+ '';
|
|
|
+ installPhaseCommand = "mkdir -p $out";
|
|
|
});
|
|
|
|
|
|
# Helper function to create example checks (compile only, no network access in sandbox)
|
|
|
@@ -292,9 +297,10 @@
|
|
|
];
|
|
|
|
|
|
# ========================================
|
|
|
- # Clippy check definitions - single source of truth
|
|
|
+ # Clippy + test check definitions - single source of truth
|
|
|
+ # These run both clippy and unit tests in a single derivation
|
|
|
# ========================================
|
|
|
- clippyChecks = {
|
|
|
+ clippyAndTestChecks = {
|
|
|
# Core crate: cashu
|
|
|
"cashu" = "-p cashu";
|
|
|
"cashu-no-default" = "-p cashu --no-default-features";
|
|
|
@@ -347,31 +353,31 @@
|
|
|
"cdk-ffi" = "-p cdk-ffi";
|
|
|
|
|
|
# Binaries: cdk-cli
|
|
|
- "bin-cdk-cli" = "--bin cdk-cli";
|
|
|
- "bin-cdk-cli-sqlcipher" = "--bin cdk-cli --features sqlcipher";
|
|
|
- "bin-cdk-cli-redb" = "--bin cdk-cli --features redb";
|
|
|
+ "cdk-cli" = "-p cdk-cli";
|
|
|
+ "cdk-cli-sqlcipher" = "-p cdk-cli --features sqlcipher";
|
|
|
+ "cdk-cli-redb" = "-p cdk-cli --features redb";
|
|
|
|
|
|
# Binaries: cdk-mintd
|
|
|
- "bin-cdk-mintd" = "--bin cdk-mintd";
|
|
|
- "bin-cdk-mintd-redis" = "--bin cdk-mintd --features redis";
|
|
|
- "bin-cdk-mintd-sqlcipher" = "--bin cdk-mintd --features sqlcipher";
|
|
|
- "bin-cdk-mintd-lnd-sqlite" = "--bin cdk-mintd --no-default-features --features lnd,sqlite";
|
|
|
- "bin-cdk-mintd-cln-postgres" = "--bin cdk-mintd --no-default-features --features cln,postgres";
|
|
|
- "bin-cdk-mintd-lnbits-sqlite" = "--bin cdk-mintd --no-default-features --features lnbits,sqlite";
|
|
|
- "bin-cdk-mintd-fakewallet-sqlite" = "--bin cdk-mintd --no-default-features --features fakewallet,sqlite";
|
|
|
- "bin-cdk-mintd-grpc-processor-sqlite" = "--bin cdk-mintd --no-default-features --features grpc-processor,sqlite";
|
|
|
- "bin-cdk-mintd-management-rpc-lnd-sqlite" = "--bin cdk-mintd --no-default-features --features management-rpc,lnd,sqlite";
|
|
|
- "bin-cdk-mintd-cln-sqlite" = "--bin cdk-mintd --no-default-features --features cln,sqlite";
|
|
|
- "bin-cdk-mintd-lnd-postgres" = "--bin cdk-mintd --no-default-features --features lnd,postgres";
|
|
|
- "bin-cdk-mintd-lnbits-postgres" = "--bin cdk-mintd --no-default-features --features lnbits,postgres";
|
|
|
- "bin-cdk-mintd-fakewallet-postgres" = "--bin cdk-mintd --no-default-features --features fakewallet,postgres";
|
|
|
- "bin-cdk-mintd-grpc-processor-postgres" = "--bin cdk-mintd --no-default-features --features grpc-processor,postgres";
|
|
|
- "bin-cdk-mintd-management-rpc-cln-postgres" = "--bin cdk-mintd --no-default-features --features management-rpc,cln,postgres";
|
|
|
- "bin-cdk-mintd-auth-sqlite-fakewallet" = "--bin cdk-mintd --no-default-features --features auth,sqlite,fakewallet";
|
|
|
- "bin-cdk-mintd-auth-postgres-lnd" = "--bin cdk-mintd --no-default-features --features auth,postgres,lnd";
|
|
|
-
|
|
|
- # Binaries: cdk-mint-cli
|
|
|
- "bin-cdk-mint-cli" = "--bin cdk-mint-cli";
|
|
|
+ "cdk-mintd" = "-p cdk-mintd";
|
|
|
+ "cdk-mintd-redis" = "-p cdk-mintd --features redis";
|
|
|
+ "cdk-mintd-sqlcipher" = "-p cdk-mintd --features sqlcipher";
|
|
|
+ "cdk-mintd-lnd-sqlite" = "-p cdk-mintd --no-default-features --features lnd,sqlite";
|
|
|
+ "cdk-mintd-cln-postgres" = "-p cdk-mintd --no-default-features --features cln,postgres";
|
|
|
+ "cdk-mintd-lnbits-sqlite" = "-p cdk-mintd --no-default-features --features lnbits,sqlite";
|
|
|
+ "cdk-mintd-fakewallet-sqlite" = "-p cdk-mintd --no-default-features --features fakewallet,sqlite";
|
|
|
+ "cdk-mintd-grpc-processor-sqlite" = "-p cdk-mintd --no-default-features --features grpc-processor,sqlite";
|
|
|
+ "cdk-mintd-management-rpc-lnd-sqlite" = "-p cdk-mintd --no-default-features --features management-rpc,lnd,sqlite";
|
|
|
+ "cdk-mintd-cln-sqlite" = "-p cdk-mintd --no-default-features --features cln,sqlite";
|
|
|
+ "cdk-mintd-lnd-postgres" = "-p cdk-mintd --no-default-features --features lnd,postgres";
|
|
|
+ "cdk-mintd-lnbits-postgres" = "-p cdk-mintd --no-default-features --features lnbits,postgres";
|
|
|
+ "cdk-mintd-fakewallet-postgres" = "-p cdk-mintd --no-default-features --features fakewallet,postgres";
|
|
|
+ "cdk-mintd-grpc-processor-postgres" = "-p cdk-mintd --no-default-features --features grpc-processor,postgres";
|
|
|
+ "cdk-mintd-management-rpc-cln-postgres" = "-p cdk-mintd --no-default-features --features management-rpc,cln,postgres";
|
|
|
+ "cdk-mintd-auth-sqlite-fakewallet" = "-p cdk-mintd --no-default-features --features auth,sqlite,fakewallet";
|
|
|
+ "cdk-mintd-auth-postgres-lnd" = "-p cdk-mintd --no-default-features --features auth,postgres,lnd";
|
|
|
+
|
|
|
+ # Binaries: cdk-mint-cli (binary name, package is cdk-mint-rpc)
|
|
|
+ "cdk-mint-cli" = "-p cdk-mint-rpc";
|
|
|
};
|
|
|
|
|
|
# ========================================
|
|
|
@@ -537,8 +543,8 @@
|
|
|
# Example packages (binaries that can be run outside sandbox with network access)
|
|
|
// (builtins.listToAttrs (map (name: { name = "example-${name}"; value = mkExamplePackage name; }) exampleChecks));
|
|
|
checks =
|
|
|
- # Generate clippy checks from clippyChecks attrset
|
|
|
- (builtins.mapAttrs (name: args: mkClippy name args) clippyChecks)
|
|
|
+ # Generate clippy + test checks from clippyAndTestChecks attrset
|
|
|
+ (builtins.mapAttrs (name: args: mkClippyAndTest name args) clippyAndTestChecks)
|
|
|
# Generate MSRV build checks (prefixed with msrv-)
|
|
|
// (builtins.listToAttrs (map (name: { name = "msrv-${name}"; value = mkMsrvBuild name msrvChecks.${name}; }) (builtins.attrNames msrvChecks)))
|
|
|
# Generate WASM build checks (prefixed with wasm-)
|