chore: Create Justfile

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-12-22 20:10:21 +00:00
parent 3be8c52f23
commit a052e7f440
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F

26
Justfile Normal file
View file

@ -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"