diff --git a/shell.nix b/shell.nix index 689a4b1..ccbd3af 100644 --- a/shell.nix +++ b/shell.nix @@ -21,6 +21,7 @@ in pkgs.mkShell { pkgs.zsh # Tools + pkgs.cargo-msrv pkgs.cargo-nextest pkgs.mandoc pkgs.nixfmt diff --git a/xtask/src/main.rs b/xtask/src/main.rs index ff997f7..2dee47a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -57,14 +57,10 @@ impl CommandExt for &mut Command { } fn run_ci(nix_enabled: bool) -> Result<()> { - // Run cargo-clippy. - Command::new("cargo") - .args(["clippy", "--all-features", "--all-targets"]) - .args(["--", "-Dwarnings"]) - .run()?; run_fmt(nix_enabled, true)?; run_lint(nix_enabled)?; - run_tests(nix_enabled, "") + run_tests(nix_enabled, "")?; + run_msrv(nix_enabled) } fn run_fmt(nix_enabled: bool, check: bool) -> Result<()> { @@ -89,6 +85,12 @@ fn run_fmt(nix_enabled: bool, check: bool) -> Result<()> { } fn run_lint(nix_enabled: bool) -> Result<()> { + // Run cargo-clippy. + Command::new("cargo") + .args(["clippy", "--all-features", "--all-targets"]) + .args(["--", "-Dwarnings"]) + .run()?; + if nix_enabled { // Run markdownlint. for result in Walk::new("./") { @@ -112,6 +114,14 @@ fn run_lint(nix_enabled: bool) -> Result<()> { Ok(()) } +fn run_msrv(nix_enabled: bool) -> Result<()> { + if nix_enabled { + // Run cargo-msrv. + Command::new("cargo-msrv").arg("verify").run()?; + } + Ok(()) +} + fn run_tests(nix_enabled: bool, name: &str) -> Result<()> { let args: &[&str] = if nix_enabled { &["nextest", "run", "--all-features"] } else { &["test"] }; Command::new("cargo").args(args).args(["--no-fail-fast", "--workspace", "--", name]).run()