-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
72 lines (57 loc) · 1.83 KB
/
justfile
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
VERSION := `toml get Cargo.toml workspace.package.version | jq -r`
export TAG:=`toml get Cargo.toml "workspace.package.version" | jq -r .`
# List available commands
_default:
just --choose --chooser "fzf +s -x --tac --cycle"
help:
just --list
test:
cargo nextest run --no-fail-fast
# Generate usage samples
usage:
cargo run -q -- --help > doc/cli/usage.adoc
cargo run -q -- generate --help > doc/cli/generate.adoc
cargo run -q -- scan --help > doc/cli/scan.adoc
cargo run -q -- check --help > doc/cli/check.adoc
cargo run -q -- load --help > doc/cli/load.adoc
# Build the Rust doc
rustdoc:
./scripts/build-doc.sh
# Generate documentation
doc: rustdoc usage
# Run rustfmt
fmt:
cargo +nightly fmt --all
# Run clippy
clippy:
cargo +nightly clippy --features="v14" --all-targets --tests
# Run checks such as clippy, rustfmt, etc...
check: clippy fmt
# Generate the readme as .md
md:
#!/usr/bin/env bash
asciidoctor -b docbook -a leveloffset=+1 -o - README_src.adoc | pandoc --markdown-headings=atx --wrap=preserve -t markdown_strict -f docbook - > README.md
tag:
#!/usr/bin/env bash
echo "Tagging version v$TAG"
git tag "v$TAG" -f
git tag | sort -Vr | head
tag-push:
#!/usr/bin/env bash
echo "Pushing version v$TAG"
git push origin "v$TAG"
# Build container using podman by default
container-build:
#!/usr/bin/env bash
ENGINE=${ENGINE:-podman}
$ENGINE build -t prdoc:v$TAG -t paritytech/prdoc -t docker.io/paritytech/prdoc .
$ENGINE run --rm -it -v $PWD:/repo prdoc --version
$ENGINE images | grep prdoc
container-check:
#!/usr/bin/env bash
ENGINE=${ENGINE:-podman}
$ENGINE run --rm -it -v $PWD:/repo prdoc --help
$ENGINE run --rm -it -v $PWD:/repo prdoc --version
# Watch and hot-reload the rustdoc
rustdoc_watch:
cargo watch -s './scripts/build-doc.sh && browser-sync start --ss target/doc -s target/doc --directory --no-open'