From a9329ff811551cf8712f42c0a9c8ac9d1ce2897e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 19 Aug 2023 17:09:11 +0200 Subject: feat(tvix): add clippy target in CI This will invoke `cargo clippy` on the codebase, ensuring we spot things early on. Relates to b/321. Change-Id: Ifba13e5bef995d33b24346c6cee134e84d6566c4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9106 Tested-by: BuildkiteCI Autosubmit: flokli Reviewed-by: tazjin --- tvix/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tvix/default.nix b/tvix/default.nix index 43b942cef0..339a657efd 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -131,7 +131,31 @@ in ''; }; + # Run cargo clippy. We run it with -Dwarnings, so warnings cause a nonzero + # exit code. + clippy = pkgs.stdenv.mkDerivation { + inherit cargoDeps; + name = "tvix-clippy"; + src = depot.third_party.gitignoreSource ./.; + PROTO_ROOT = depot.tvix.proto; + + buildInputs = [ + pkgs.fuse + ]; + nativeBuildInputs = with pkgs; [ + cargo + clippy + pkg-config + protobuf + rustc + rustPlatform.cargoSetupHook + ]; + + buildPhase = "cargo clippy -- -Dwarnings | tee $out"; + }; + meta.ci.targets = [ + "clippy" "shell" "rust-docs" ]; -- cgit 1.4.1