-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
@ValuedMammal We've had a lot of back and forth on this PR: #103, mostly because I only ran cargo test
and missed tests in the matrix, was wondering if you what you think about adding a justfile so anyone contributing could run the tests locally before doing a PR. If you want I can make the PR, it would look mostly like this.
# Default recipe shows available commands
default:
@just --list
# Set default values
rust_version := "stable"
feature := "default"
# Build with specific Rust version and feature
build VERSION=rust_version FEAT=feature:
@echo "Building with Rust {{VERSION}} and feature {{FEAT}}"
cargo build --features {{FEAT}} --no-default-features
# Test with specific Rust version and feature
test VERSION=rust_version FEAT=feature:
@echo "Testing with Rust {{VERSION}} and feature {{FEAT}}"
cargo test --features {{FEAT}} --no-default-features -- --test-threads=1
# Switch Rust version
switch-rust VERSION:
rustup default {{VERSION}}
rustup set profile minimal
rustup update
# Pin dependencies for MSRV 1.63.0
pin-msrv:
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
cargo update -p time --precise "0.3.20"
cargo update -p home --precise 0.5.5
cargo update -p url --precise "2.5.0"
cargo update -p tokio --precise "1.38.1"
cargo update -p tokio-util --precise "0.7.11"
# Run full test matrix
test-matrix:
just test-stable
just test-msrv
# Test all features on stable Rust
test-stable:
#!/usr/bin/env bash
features=(
"default"
"blocking"
"blocking-https"
"blocking-https-rustls"
"blocking-https-native"
"blocking-https-bundled"
"async"
"async-https"
"async-https-native"
"async-https-rustls"
"async-https-rustls-manual-roots"
)
just switch-rust stable
for feature in "${features[@]}"; do
just test stable "$feature"
done
# Test all features on MSRV (1.63.0)
test-msrv:
#!/usr/bin/env bash
features=(
"default"
"blocking"
"blocking-https"
"blocking-https-rustls"
"blocking-https-native"
"blocking-https-bundled"
"async"
"async-https"
"async-https-native"
"async-https-rustls"
"async-https-rustls-manual-roots"
)
just switch-rust 1.63.0
just pin-msrv
for feature in "${features[@]}"; do
just test 1.63.0 "$feature"
done
# Clean build artifacts
clean:
cargo clean
Metadata
Metadata
Assignees
Labels
No labels