|
399 | 399 | ); |
400 | 400 |
|
401 | 401 | # Helper function to create combined clippy + test checks |
402 | | - # Runs both in a single derivation to share build artifacts |
| 402 | + # Runs both in a single derivation to share build artifacts. |
| 403 | + # Now accepts a list of cargoArgs to run multiple checks sequentially. |
403 | 404 | mkClippyAndTest = |
404 | | - name: cargoArgs: |
| 405 | + name: cargoArgsList: |
405 | 406 | craneLib.mkCargoDerivation ( |
406 | 407 | commonCraneArgs |
407 | 408 | // { |
408 | 409 | pname = "cdk-check-${name}"; |
409 | 410 | cargoArtifacts = workspaceDeps; |
410 | | - buildPhaseCargoCommand = '' |
411 | | - cargo clippy ${cargoArgs} -- -D warnings |
412 | | - cargo test ${cargoArgs} |
413 | | - ''; |
| 411 | + buildPhaseCargoCommand = builtins.concatStringsSep "\n" ( |
| 412 | + builtins.map |
| 413 | + (cargoArgs: '' |
| 414 | + echo "Running check with args: ${cargoArgs}" |
| 415 | + cargo clippy ${cargoArgs} -- -D warnings |
| 416 | + cargo test ${if builtins.match ".*cdk-cli.*" cargoArgs != null then "--bins" else "--lib"} ${cargoArgs} |
| 417 | + '') |
| 418 | + cargoArgsList |
| 419 | + ); |
| 420 | + doCheck = false; |
414 | 421 | installPhaseCommand = "mkdir -p $out"; |
415 | 422 | } |
416 | 423 | ); |
|
425 | 432 | cargoArtifacts = workspaceDeps; |
426 | 433 | buildPhaseCargoCommand = "cargo build --example ${name}"; |
427 | 434 | # Examples are compiled but not run (no network in Nix sandbox) |
| 435 | + doCheck = false; |
428 | 436 | installPhaseCommand = "mkdir -p $out"; |
429 | 437 | } |
430 | 438 | ); |
|
438 | 446 | pname = "cdk-example-${name}"; |
439 | 447 | cargoArtifacts = workspaceDeps; |
440 | 448 | buildPhaseCargoCommand = "cargo build --release --example ${name}"; |
| 449 | + doCheck = false; |
441 | 450 | installPhaseCommand = '' |
442 | 451 | mkdir -p $out/bin |
443 | 452 | cp target/release/examples/${name} $out/bin/ |
|
510 | 519 | -p cdk-cli \ |
511 | 520 | -p cdk-mintd |
512 | 521 | ''; |
| 522 | + doCheck = false; |
513 | 523 | installPhaseCommand = "mkdir -p $out"; |
514 | 524 | } |
515 | 525 | ); |
|
540 | 550 | python3 crates/cdk-ffi/tests/test_transactions.py |
541 | 551 | python3 crates/cdk-ffi/tests/test_kvstore.py |
542 | 552 | ''; |
| 553 | + doCheck = false; |
543 | 554 | installPhaseCommand = "mkdir -p $out"; |
544 | 555 | } |
545 | 556 | ); |
|
577 | 588 | cargo run --release -p cdk-ffi-dart --bin uniffi-bindgen -- \ |
578 | 589 | "../../../$CDK_FFI_LIB" --out-dir ../../../target/dart-bindings) |
579 | 590 | ''; |
| 591 | + doCheck = false; |
580 | 592 | installPhaseCommand = '' |
581 | 593 | LIB_EXT="${if isDarwin then "dylib" else "so"}" |
582 | 594 | mkdir -p $out/lib/src/generated |
|
605 | 617 | --out-dir target/kotlin-bindings \ |
606 | 618 | --no-format |
607 | 619 | ''; |
| 620 | + doCheck = false; |
608 | 621 | installPhaseCommand = '' |
609 | 622 | LIB_EXT="${if isDarwin then "dylib" else "so"}" |
610 | 623 |
|
|
640 | 653 | # These run both clippy and unit tests in a single derivation |
641 | 654 | # ======================================== |
642 | 655 | clippyAndTestChecks = { |
643 | | - # Core crate: cashu |
644 | | - "cashu" = "-p cashu"; |
645 | | - "cashu-no-default" = "-p cashu --no-default-features"; |
646 | | - "cashu-wallet" = "-p cashu --no-default-features --features wallet"; |
647 | | - "cashu-mint" = "-p cashu --no-default-features --features mint"; |
648 | | - |
649 | | - # Core crate: cdk-common |
650 | | - "cdk-common" = "-p cdk-common"; |
651 | | - "cdk-common-no-default" = "-p cdk-common --no-default-features"; |
652 | | - "cdk-common-wallet" = "-p cdk-common --no-default-features --features wallet"; |
653 | | - "cdk-common-mint" = "-p cdk-common --no-default-features --features mint"; |
654 | | - |
655 | | - # Core crate: cdk |
656 | | - "cdk" = "-p cdk"; |
657 | | - "cdk-no-default" = "-p cdk --no-default-features"; |
658 | | - "cdk-wallet" = "-p cdk --no-default-features --features wallet"; |
659 | | - "cdk-mint" = "-p cdk --no-default-features --features mint"; |
660 | | - |
661 | | - # SQL crates |
662 | | - "cdk-sql-common" = "-p cdk-sql-common"; |
663 | | - "cdk-sql-common-wallet" = "-p cdk-sql-common --no-default-features --features wallet"; |
664 | | - "cdk-sql-common-mint" = "-p cdk-sql-common --no-default-features --features mint"; |
665 | | - |
666 | | - # Database crates |
667 | | - "cdk-redb" = "-p cdk-redb"; |
668 | | - "cdk-sqlite" = "-p cdk-sqlite"; |
669 | | - "cdk-sqlite-sqlcipher" = "-p cdk-sqlite --features sqlcipher"; |
670 | | - |
671 | | - # HTTP/API layer |
672 | | - # Note: swagger feature excluded - downloads assets during build, incompatible with Nix sandbox |
673 | | - "cdk-axum" = "-p cdk-axum"; |
674 | | - "cdk-axum-no-default" = "-p cdk-axum --no-default-features"; |
675 | | - "cdk-axum-redis" = "-p cdk-axum --no-default-features --features redis"; |
676 | | - |
677 | | - # Lightning backends |
678 | | - "cdk-cln" = "-p cdk-cln"; |
679 | | - "cdk-lnd" = "-p cdk-lnd"; |
680 | | - "cdk-lnbits" = "-p cdk-lnbits"; |
681 | | - "cdk-fake-wallet" = "-p cdk-fake-wallet"; |
682 | | - "cdk-payment-processor" = "-p cdk-payment-processor"; |
683 | | - "cdk-ldk-node" = "-p cdk-ldk-node"; |
684 | | - |
685 | | - # Other crates |
686 | | - "cdk-signatory" = "-p cdk-signatory"; |
687 | | - "cdk-mint-rpc" = "-p cdk-mint-rpc"; |
688 | | - "cdk-prometheus" = "-p cdk-prometheus"; |
689 | | - "cdk-ffi" = "-p cdk-ffi"; |
690 | | - "cdk-npubcash" = "-p cdk-npubcash"; |
691 | | - |
692 | | - # Binaries: cdk-cli |
693 | | - "cdk-cli" = "-p cdk-cli"; |
694 | | - "cdk-cli-sqlcipher" = "-p cdk-cli --features sqlcipher"; |
695 | | - "cdk-cli-redb" = "-p cdk-cli --features redb"; |
696 | | - |
697 | | - # Binaries: cdk-mintd |
698 | | - "cdk-mintd" = "-p cdk-mintd"; |
699 | | - "cdk-mintd-redis" = "-p cdk-mintd --features redis"; |
700 | | - "cdk-mintd-sqlcipher" = "-p cdk-mintd --features sqlcipher"; |
701 | | - "cdk-mintd-lnd-sqlite" = "-p cdk-mintd --no-default-features --features lnd,sqlite"; |
702 | | - "cdk-mintd-cln-postgres" = "-p cdk-mintd --no-default-features --features cln,postgres"; |
703 | | - "cdk-mintd-lnbits-sqlite" = "-p cdk-mintd --no-default-features --features lnbits,sqlite"; |
704 | | - "cdk-mintd-fakewallet-sqlite" = "-p cdk-mintd --no-default-features --features fakewallet,sqlite"; |
705 | | - "cdk-mintd-grpc-processor-sqlite" = |
706 | | - "-p cdk-mintd --no-default-features --features grpc-processor,sqlite"; |
707 | | - "cdk-mintd-management-rpc-lnd-sqlite" = |
708 | | - "-p cdk-mintd --no-default-features --features management-rpc,lnd,sqlite"; |
709 | | - "cdk-mintd-cln-sqlite" = "-p cdk-mintd --no-default-features --features cln,sqlite"; |
710 | | - "cdk-mintd-lnd-postgres" = "-p cdk-mintd --no-default-features --features lnd,postgres"; |
711 | | - "cdk-mintd-lnbits-postgres" = "-p cdk-mintd --no-default-features --features lnbits,postgres"; |
712 | | - "cdk-mintd-fakewallet-postgres" = |
713 | | - "-p cdk-mintd --no-default-features --features fakewallet,postgres"; |
714 | | - "cdk-mintd-grpc-processor-postgres" = |
715 | | - "-p cdk-mintd --no-default-features --features grpc-processor,postgres"; |
716 | | - "cdk-mintd-management-rpc-cln-postgres" = |
717 | | - "-p cdk-mintd --no-default-features --features management-rpc,cln,postgres"; |
718 | | - |
719 | | - # Binaries: cdk-mint-cli (binary name, package is cdk-mint-rpc) |
720 | | - "cdk-mint-cli" = "-p cdk-mint-rpc"; |
| 656 | + "core-lib" = [ |
| 657 | + "-p cashu" |
| 658 | + "-p cashu --no-default-features" |
| 659 | + "-p cashu --no-default-features --features wallet" |
| 660 | + "-p cashu --no-default-features --features mint" |
| 661 | + "-p cdk-common" |
| 662 | + "-p cdk-common --no-default-features" |
| 663 | + "-p cdk-common --no-default-features --features wallet" |
| 664 | + "-p cdk-common --no-default-features --features mint" |
| 665 | + "-p cdk" |
| 666 | + "-p cdk --no-default-features" |
| 667 | + "-p cdk --no-default-features --features wallet" |
| 668 | + "-p cdk --no-default-features --features mint" |
| 669 | + ]; |
| 670 | + |
| 671 | + "storage-and-cli" = [ |
| 672 | + "-p cdk-sql-common" |
| 673 | + "-p cdk-sql-common --no-default-features --features wallet" |
| 674 | + "-p cdk-sql-common --no-default-features --features mint" |
| 675 | + "-p cdk-redb" |
| 676 | + "-p cdk-sqlite" |
| 677 | + "-p cdk-sqlite --features sqlcipher" |
| 678 | + "-p cdk-cli" |
| 679 | + "-p cdk-cli --features sqlcipher" |
| 680 | + "-p cdk-cli --features redb" |
| 681 | + ]; |
| 682 | + |
| 683 | + "lightning-and-api" = [ |
| 684 | + "-p cdk-axum" |
| 685 | + "-p cdk-axum --no-default-features" |
| 686 | + "-p cdk-axum --no-default-features --features redis" |
| 687 | + "-p cdk-cln" |
| 688 | + "-p cdk-lnd" |
| 689 | + "-p cdk-lnbits" |
| 690 | + "-p cdk-fake-wallet" |
| 691 | + "-p cdk-payment-processor" |
| 692 | + "-p cdk-ldk-node" |
| 693 | + "-p cdk-npubcash" |
| 694 | + ]; |
| 695 | + |
| 696 | + "mintd-main" = [ |
| 697 | + "-p cdk-mintd" |
| 698 | + "-p cdk-mintd --features redis" |
| 699 | + "-p cdk-mintd --features sqlcipher" |
| 700 | + "-p cdk-signatory" |
| 701 | + "-p cdk-mint-rpc" |
| 702 | + "-p cdk-prometheus" |
| 703 | + "-p cdk-ffi" |
| 704 | + ]; |
| 705 | + |
| 706 | + "mintd-backends-sqlite" = [ |
| 707 | + "-p cdk-mintd --no-default-features --features lnd,sqlite" |
| 708 | + "-p cdk-mintd --no-default-features --features lnbits,sqlite" |
| 709 | + "-p cdk-mintd --no-default-features --features fakewallet,sqlite" |
| 710 | + "-p cdk-mintd --no-default-features --features grpc-processor,sqlite" |
| 711 | + "-p cdk-mintd --no-default-features --features management-rpc,lnd,sqlite" |
| 712 | + "-p cdk-mintd --no-default-features --features cln,sqlite" |
| 713 | + ]; |
| 714 | + |
| 715 | + "mintd-backends-postgres" = [ |
| 716 | + "-p cdk-mintd --no-default-features --features cln,postgres" |
| 717 | + "-p cdk-mintd --no-default-features --features lnd,postgres" |
| 718 | + "-p cdk-mintd --no-default-features --features lnbits,postgres" |
| 719 | + "-p cdk-mintd --no-default-features --features fakewallet,postgres" |
| 720 | + "-p cdk-mintd --no-default-features --features grpc-processor,postgres" |
| 721 | + "-p cdk-mintd --no-default-features --features management-rpc,cln,postgres" |
| 722 | + ]; |
721 | 723 | }; |
722 | 724 |
|
723 | 725 | # ======================================== |
|
1066 | 1068 | -p cdk-integration-tests \ |
1067 | 1069 | --archive-file $out/itest-archive.tar.zst |
1068 | 1070 | ''; |
| 1071 | + doCheck = false; |
1069 | 1072 | installPhaseCommand = ""; |
1070 | 1073 | } |
1071 | 1074 | ); |
|
0 commit comments