-
Notifications
You must be signed in to change notification settings - Fork 3
/
Justfile
48 lines (36 loc) · 1.22 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
set dotenv-load := true
rustfmt := if env('IN_DEV_SHELL', '0') == '1' { 'cargo fmt' } else { 'cargo +nightly fmt' }
# List all available recipes
help:
@just --list
# Various integrity checks
check:
# Running clippy...
cargo clippy --workspace --all-features --no-deps -- -Dwarnings
cargo clippy --workspace --tests --no-deps -- -Dwarnings
# Running rustfmt...
{{rustfmt}} --all --check
# Running rustdoc...
RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --all-features --document-private-items
# Running sqlx...
cargo sqlx prepare --workspace --check -- --tests
# Format the code
format:
# Running rustfmt...
{{rustfmt}} --all
# Run with tokio-console support
debug *ARGS:
RUSTFLAGS="--cfg tokio_unstable" cargo run -Fconsole serve {{ARGS}}
# Spin up the database container
create-database:
docker compose up --detach --wait cs2kz-database
# Remove the database container and clean volumes
clean-database:
docker compose down --timeout=3 cs2kz-database
sudo rm -rfv {{justfile_directory()}}/database/volumes/cs2kz
# Run database migrations
run-migrations:
cargo sqlx migrate run --source {{justfile_directory()}}/database/migrations
# Build sqlx's query cache
prepare-query-cache:
cargo sqlx prepare --workspace -- --tests