mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-12-29 04:23:01 +00:00
Add MSRV to CI
This commit is contained in:
parent
575cfd485c
commit
066730f95d
@ -21,6 +21,7 @@ in pkgs.mkShell {
|
||||
pkgs.zsh
|
||||
|
||||
# Tools
|
||||
pkgs.cargo-msrv
|
||||
pkgs.cargo-nextest
|
||||
pkgs.mandoc
|
||||
pkgs.nixfmt
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user