-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
106 lines (76 loc) · 2.06 KB
/
Copy pathjustfile
File metadata and controls
106 lines (76 loc) · 2.06 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
# Tests are run by nextest
# --all-features is not passed since `minify-html` is a optional dependency which takes long to compile,
# and is not going to be included in local development.
# CI will run with the `--all-features` flag.
set dotenv-required := true
set dotenv-filename := ".env"
watch_base := "cargo watch -q -c -i 'tests/resources/**/*'"
no_capture := if env_var("TEST_LOG") == "true" { "--no-capture" } else { "" }
run bin="":
clear
cargo run --bin {{ bin }} -r
# Watch
watch:
{{ watch_base }} -x "c --all-targets"
watch-test name="":
{{ watch_base }} -s "just test {{ name }}"
watch-test-pkg pkg:
{{ watch_base }} -s "just test-pkg {{ pkg }}"
watch-example package name:
{{ watch_base }} -s "just example {{ package }} {{ name }}"
watch-test-integration:
{{ watch_base }} -x "nextest run -E 'kind(test)'"
watch-bench name="":
{{ watch_base }} -s "just bench {{ name }}"
# Test commands
test name="":
clear
cargo nextest run {{ no_capture }} --all-targets {{ name }}
test-pkg pkg:
clear
cargo nextest run --all-targets --package {{ pkg }}
test-doc:
clear
cargo test --doc
check-lib-bins:
clear
cargo check --lib --bins
cov:
clear
rustup run nightly cargo llvm-cov nextest --open --lib --locked
# Other cargo commands
example package name:
clear
cargo run -p {{ package }} --example {{ name }}
bench package name="":
clear
cargo bench --all-features --all-targets -p {{ package }} {{ name }}
lint:
clear
cargo clippy --all-targets --locked
tree crate:
clear
cargo tree --all-features --all-targets -i {{ crate }}
doc package="":
clear
cargo doc --all-features --no-deps -p {{ package }} --open
# DB
backup-db:
scripts/backup_postgres_db.sh
dm-list:
diesel migration list
dm-run:
diesel migration run
dm-revert:
diesel migration revert
dm-redo:
diesel migration redo
# Postgres
compose-up:
docker compose up -d
compose-config:
echo $POSTGRES_PASSWORD
docker compose config
# Others
git-gc:
git gc --prune=now --aggressive