3
3
4
4
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
5
5
[private ]
6
- downgrade-msrv :
6
+ downgrade-for- msrv :
7
7
cargo update -p=ciborium --precise=0.2.1
8
8
cargo update -p=ciborium-ll --precise=0.2.1
9
9
cargo update -p=time --precise=0.3.16
@@ -12,22 +12,59 @@ downgrade-msrv:
12
12
cargo update -p=anstyle --precise=1.0.2
13
13
cargo update -p=trybuild --precise=1.0.89
14
14
15
+ msrv := ```
16
+ cargo metadata --format-version=1 \
17
+ | jq -r ' first(.packages[] | .name = "actix-tls") | .rust_version'
18
+ ```
19
+ msrv_full := msrv + " .0" # comment out if the MSRV has a patch version specified
20
+ msrv_rustup := " +" + msrv_full
21
+
22
+ non_linux_all_features_list := ```
23
+ cargo metadata --format-version=1 \
24
+ | jq ' .packages[] | select(.source == null) | .features | keys' \
25
+ | jq -r --slurp \
26
+ --arg exclusions " tokio-uring,io-uring" \
27
+ ' add | unique | . - ($exclusions | split(",")) | join(",")'
28
+ ```
29
+
30
+ all_crate_features := if os () == " linux" {
31
+ " --all-features"
32
+ } else {
33
+ " --features='" + non_linux_all_features_list + " '"
34
+ }
35
+
36
+ # Test workspace code.
37
+ test toolchain = " ":
38
+ cargo {{ toolchain }} test --lib --tests --package=actix-macros
39
+ cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features
40
+ cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ all_crate_features }}
41
+
42
+ # Test workspace using MSRV.
43
+ test-msrv : downgrade-for-msrv (test msrv_rustup)
44
+
45
+ # Test workspace docs.
46
+ test-docs toolchain = " ": && doc
47
+ cargo {{ toolchain }} test --doc --workspace {{ all_crate_features }} --no-fail-fast -- --nocapture
48
+
49
+ # Test workspace.
50
+ test-all toolchain = " ": (test toolchain) (test-docs )
51
+
15
52
# Document crates in workspace.
16
- doc :
17
- RUSTDOCFLAGS=" --cfg=docsrs" cargo + nightly doc --no-deps --workspace --features=rustls,openssl
53
+ doc * args :
54
+ RUSTDOCFLAGS=" --cfg=docsrs -Dwarnings " cargo + nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }}
18
55
19
56
# Document crates in workspace and watch for changes.
20
57
doc-watch :
21
- RUSTDOCFLAGS= " --cfg=docsrs" cargo + nightly doc --no-deps --workspace --features=rustls-0_20,rustls-0_2 1 ,rustls-0_20-native-roots,rustls-0_2 1 -native-roots,openssl --open
22
- cargo watch -- RUSTDOCFLAGS= " --cfg=docsrs" cargo + nightly doc --no-deps --workspace --features=rustls-0_20,rustls-0_2 1 ,rustls-0_20-native-roots,rustls-0_2 1 -native-roots,openssl
58
+ @ just doc --open
59
+ cargo watch -- just doc
23
60
24
61
# Check for unintentional external type exposure on all crates in workspace.
25
62
check-external-types-all toolchain = " +nightly":
26
63
#!/usr/bin/env bash
27
64
set -euo pipefail
28
65
exit=0
29
66
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE " \- codegen/|\- derive/|\- macros/" ); do
30
- if ! just check-external-types-manifest " $f" {{ toolchain}} ; then exit=1 ; fi
67
+ if ! just check-external-types-manifest " $f" {{ toolchain }} ; then exit=1 ; fi
31
68
echo
32
69
echo
33
70
done
@@ -40,9 +77,9 @@ check-external-types-all-table toolchain="+nightly":
40
77
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE " \- codegen/|\- derive/|\- macros/" ); do
41
78
echo
42
79
echo " Checking for $f"
43
- just check-external-types-manifest " $f" {{ toolchain}} --output-format=markdown-table
80
+ just check-external-types-manifest " $f" {{ toolchain }} --output-format=markdown-table
44
81
done
45
82
46
83
# Check for unintentional external type exposure on a crate.
47
84
check-external-types-manifest manifest_path toolchain = " +nightly" * extra_args = " ":
48
- cargo {{ toolchain}} check-external-types --manifest-path " {{ manifest_path}} " {{ extra_args}}
85
+ cargo {{ toolchain }} check-external-types --manifest-path " {{ manifest_path }} " {{ extra_args }}
0 commit comments