From a052e7f4408d2decc0e7d1bb721cdb6215ea0355 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Sun, 22 Dec 2024 20:10:21 +0000
Subject: [PATCH] chore: Create Justfile
Signed-off-by: Awiteb
---
Justfile | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Justfile
diff --git a/Justfile b/Justfile
new file mode 100644
index 0000000..54f2c80
--- /dev/null
+++ b/Justfile
@@ -0,0 +1,26 @@
+set shell := ["/usr/bin/env", "bash", "-c"]
+
+JUST_EXECUTABLE := "just -u -f " + justfile()
+header := "Available tasks:\n"
+# Get the MSRV from the Cargo.toml
+msrv := `cat Cargo.toml | grep "rust-version" | sed 's/.*"\(.*\)".*/\1/'`
+
+
+_default:
+ @{{JUST_EXECUTABLE}} --list-heading "{{header}}" --list
+
+@test test_name='':
+ cargo test {test_name}
+
+# Run the CI
+@ci: && msrv test
+ cargo build --all-targets
+ cargo fmt --all -- --check
+ cargo clippy --all-targets -- -D warnings
+
+# Check that the current MSRV is correct
+@msrv:
+ rustup toolchain install {{msrv}}
+ echo "Checking MSRV ({{msrv}})"
+ cargo +{{msrv}} check -q --workspace
+ echo "MSRV is correct"