Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
130 lines (104 loc) · 4.47 KB
/
Copy pathjustfile
File metadata and controls
130 lines (104 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import '.toolchain/rust.just'
_list:
@just --list
# Update the Actions lockfile after changing workflow dependencies.
actions-lock:
gh actions-lock
# Verify Actions lockfile coverage without network access.
check-actions-lock:
gh actions-lock --verify-local
# Show votes for open feature polls.
poll-results:
@./poll-results.sh
# Validate benchmark outputs without collecting timings.
[group("benchmark")]
bench-test:
cargo bench -p russe --bench decoder --bench encoder --all-features --locked -- --test
cargo bench -p actix-web-lab --bench sse --all-features --locked -- --test
# Build benchmarks for CPU and memory reporting.
[group("benchmark")]
bench-build:
cargo codspeed build --all-features --locked -m simulation -m memory
# Run the benchmarks built with CodSpeed.
[group("benchmark")]
bench-run:
cargo codspeed run
# Build benchmarks for local walltime measurements.
[group("benchmark")]
bench-build-walltime *args:
cargo codspeed build --locked -m walltime {{ args }}
# Measure walltime and upload the results to CodSpeed.
[group("benchmark")]
bench-run-walltime *args:
codspeed run -m walltime -- cargo codspeed run -m walltime {{ args }}
# Check security advisories.
check-advisories:
cargo deny --log-level warn --workspace --all-features check advisories
# Check project formatting.
check: && clippy
just --unstable --fmt --check
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --check
fd --hidden -e=toml --exec-batch taplo format --check
fd --hidden -e=toml --exec-batch taplo lint
cargo +nightly fmt -- --check
# Format project.
[group("lint")]
fmt: update-readmes
just --unstable --fmt
nixpkgs-fmt .
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --write
fd --type=file --hidden -e=toml --exec-batch taplo format
cargo +nightly fmt
# Update READMEs from crate root documentation.
[group("lint")]
update-readmes:
#!/usr/bin/env bash
set -euo pipefail
cargo metadata --no-deps --format-version=1 \
| jq -r '.packages[].name' \
| xargs -n 1 cargo rdme --force --workspace-project
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private]
downgrade-for-msrv:
@ echo "No downgrades currently needed for MSRV testing"
# Run tests on all crates in workspace using specified (or default) toolchain.
clippy toolchain="":
cargo {{ toolchain }} clippy --workspace --all-targets --all-features
# Run tests on all crates in workspace using specified (or default) toolchain and watch for changes.
clippy-watch toolchain="":
cargo watch -- just clippy {{ toolchain }}
# Run tests on all crates in workspace using its MSRV.
test-msrv: downgrade-for-msrv (test msrv_rustup)
# Run tests on all crates in workspace using specified (or default) toolchain.
test toolchain="": (test-no-docs toolchain) (test-docs toolchain)
[private]
test-no-docs toolchain="":
cargo {{ toolchain }} nextest run --no-default-features
cargo {{ toolchain }} nextest run
cargo {{ toolchain }} nextest run --all-features
# Test workspace docs.
test-docs toolchain="": && doc
cargo {{ toolchain }} test --doc --workspace --all-features --no-fail-fast -- --nocapture
# Run tests on all crates in workspace and produce coverage file (Codecov format).
test-coverage-codecov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --codecov --output-path codecov.json
# Run tests on all crates in workspace and produce coverage file (lcov format).
test-coverage-lcov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --lcov --output-path lcov.info
# Document crates in workspace.
doc *args: && doc-set-workspace-crates
rm -f "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace --all-features {{ args }}
[private]
doc-set-workspace-crates:
#!/usr/bin/env bash
(
echo "window.ALL_CRATES ="
cargo metadata --format-version=1 \
| jq '[.packages[] | select(.source == null) | .targets | map(select(.doc) | .name)] | flatten'
echo ";"
) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
# Build rustdoc for all crates in workspace and watch for changes.
doc-watch:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features --open
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features