1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 18:02:58 +01:00
actix-net/justfile

93 lines
3.3 KiB
Makefile
Raw Normal View History

_list:
@just --list
2024-05-02 02:28:38 +02:00
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private]
2024-05-11 16:10:56 +02:00
downgrade-for-msrv:
2024-05-12 20:10:27 +02:00
cargo update -p=clap --precise=4.4.18
2024-05-02 02:28:38 +02:00
2024-05-11 16:10:56 +02:00
msrv := ```
cargo metadata --format-version=1 \
2024-05-18 18:34:18 +02:00
| jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \
2024-05-12 22:53:26 +02:00
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
2024-05-11 16:10:56 +02:00
```
2024-05-12 22:53:26 +02:00
msrv_rustup := "+" + msrv
2024-05-11 16:10:56 +02:00
non_linux_all_features_list := ```
cargo metadata --format-version=1 \
| jq '.packages[] | select(.source == null) | .features | keys' \
| jq -r --slurp \
--arg exclusions "tokio-uring,io-uring" \
'add | unique | . - ($exclusions | split(",")) | join(",")'
```
all_crate_features := if os() == "linux" {
"--all-features"
} else {
"--features='" + non_linux_all_features_list + "'"
}
# Run Clippy over workspace.
clippy toolchain="":
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
2024-05-11 16:10:56 +02:00
# Test workspace code.
[macos, windows]
2024-05-11 16:10:56 +02:00
test toolchain="":
cargo {{ toolchain }} test --lib --tests --package=actix-macros
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ all_crate_features }}
# Test workspace code.
[linux]
test toolchain="":
cargo {{ toolchain }} test --lib --tests --package=actix-macros
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ non_linux_all_features_list }}
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ all_crate_features }}
2024-05-11 16:10:56 +02:00
# Test workspace using MSRV.
test-msrv: downgrade-for-msrv (test msrv_rustup)
# Test workspace docs.
test-docs toolchain="": && doc
cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
# Test workspace.
2024-05-18 18:34:18 +02:00
test-all toolchain="": (test toolchain) (test-docs toolchain)
2024-05-11 16:10:56 +02:00
# Document crates in workspace.
2024-05-11 16:10:56 +02:00
doc *args:
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }}
# Document crates in workspace and watch for changes.
doc-watch:
2024-05-11 16:10:56 +02:00
@just doc --open
cargo watch -- just doc
# Check for unintentional external type exposure on all crates in workspace.
2023-11-06 23:12:58 +01:00
check-external-types-all toolchain="+nightly":
#!/usr/bin/env bash
set -euo pipefail
2023-10-30 01:26:39 +01:00
exit=0
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
2024-05-11 16:10:56 +02:00
if ! just check-external-types-manifest "$f" {{ toolchain }}; then exit=1; fi
echo
echo
done
2023-10-30 01:26:39 +01:00
exit $exit
# Check for unintentional external type exposure on all crates in workspace.
2023-11-06 23:12:58 +01:00
check-external-types-all-table toolchain="+nightly":
#!/usr/bin/env bash
set -euo pipefail
2023-10-30 01:26:39 +01:00
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
echo
echo "Checking for $f"
2024-05-11 16:10:56 +02:00
just check-external-types-manifest "$f" {{ toolchain }} --output-format=markdown-table
done
# Check for unintentional external type exposure on a crate.
2023-11-06 23:12:58 +01:00
check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="":
2024-05-11 16:10:56 +02:00
cargo {{ toolchain }} check-external-types --manifest-path "{{ manifest_path }}" {{ extra_args }}