1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-05-19 07:23:17 +02:00

build: rework justfile toolchain

This commit is contained in:
Rob Ede 2025-05-09 20:15:36 +01:00
parent e27e1e3806
commit ad73cdc823
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
2 changed files with 18 additions and 14 deletions

View File

@ -1,3 +1,4 @@
version: "0.2" version: "0.2"
words: words:
- actix - actix
- rustup

View File

@ -1,6 +1,8 @@
_list: _list:
@just --list @just --list
toolchain := ""
# Format workspace. # Format workspace.
fmt: fmt:
just --unstable --fmt just --unstable --fmt
@ -10,11 +12,11 @@ fmt:
# Downgrade dependencies necessary to run MSRV checks/tests. # Downgrade dependencies necessary to run MSRV checks/tests.
[private] [private]
downgrade-for-msrv: downgrade-for-msrv:
cargo update -p=clap --precise=4.4.18 # next ver: 1.74.0 cargo {{ toolchain }} update -p=divan --precise=0.1.15 # next ver: 1.80.0
cargo update -p=divan --precise=0.1.15 # next ver: 1.80.0 cargo {{ toolchain }} update -p=half --precise=2.4.1 # next ver: 1.81.0
cargo update -p=litemap --precise=0.7.4 # next ver: 1.81.0 cargo {{ toolchain }} update -p=litemap --precise=0.7.4 # next ver: 1.81.0
cargo update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0 cargo {{ toolchain }} update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0
cargo update -p=half --precise=2.4.1 # next ver: 1.81.0 cargo {{ toolchain }} update -p=idna_adapter --precise=1.2.0 # next ver: 1.82.0
msrv := ``` msrv := ```
cargo metadata --format-version=1 \ cargo metadata --format-version=1 \
@ -40,41 +42,42 @@ check-default:
cargo hack --workspace check cargo hack --workspace check
# Run Clippy over workspace. # Run Clippy over workspace.
check toolchain="": && (clippy toolchain) check: && clippy
# Run Clippy over workspace. # Run Clippy over workspace.
clippy toolchain="": clippy:
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
# Test workspace using MSRV. # Test workspace using MSRV.
test-msrv: downgrade-for-msrv (test msrv_rustup) test-msrv: downgrade-for-msrv
@just toolchain={{ msrv_rustup }} test
# Test workspace code. # Test workspace code.
test toolchain="": test:
cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features cargo {{ toolchain }} test --lib --tests -p=actix-web-codegen --all-features
cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features cargo {{ toolchain }} test --lib --tests -p=actix-multipart-derive --all-features
cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features cargo {{ toolchain }} nextest run --no-tests=warn -p=actix-router --no-default-features
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)" cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-web-codegen --exclude=actix-multipart-derive {{ all_crate_features }} --filter-expr="not test(test_reading_deflate_encoding_large_random_rustls)"
# Test workspace docs. # Test workspace docs.
test-docs toolchain="": && doc test-docs: && doc
cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
# Test workspace. # Test workspace.
test-all toolchain="": (test toolchain) (test-docs toolchain) test-all: test test-docs
# Test workspace and collect coverage info. # Test workspace and collect coverage info.
[private] [private]
test-coverage toolchain="": test-coverage:
cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov nextest --no-tests=warn --no-report {{ all_crate_features }}
cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }} cargo {{ toolchain }} llvm-cov --doc --no-report {{ all_crate_features }}
# Test workspace and generate Codecov report. # Test workspace and generate Codecov report.
test-coverage-codecov toolchain="": (test-coverage toolchain) test-coverage-codecov: test-coverage
cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json cargo {{ toolchain }} llvm-cov report --doctests --codecov --output-path=codecov.json
# Test workspace and generate LCOV report. # Test workspace and generate LCOV report.
test-coverage-lcov toolchain="": (test-coverage toolchain) test-coverage-lcov: test-coverage
cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info cargo {{ toolchain }} llvm-cov report --doctests --lcov --output-path=lcov.info
# Document crates in workspace. # Document crates in workspace.