-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
50 lines (36 loc) · 1.38 KB
/
justfile
File metadata and controls
50 lines (36 loc) · 1.38 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
envfile := justfile_directory() / ".env.server"
# Construct the DATABASE_URL from environment variables in the envfile
database_url := shell("dotenvx --quiet run -f \"$1\" -- bash -c 'echo \"postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:$POSTGRES_PORT/$POSTGRES_DB\"'", envfile)
default:
just --list
publish:
cargo publish --workspace
lint:
cargo clippy --workspace --all-targets --all-features
cargo clippy --workspace --all-targets --no-default-features
cargo fmt --check --all
cargo doc --workspace --no-deps
cargo check --workspace
test:
cargo test --workspace
# Generate HTML coverage report
coverage:
cargo llvm-cov --all-features --workspace --html
# Generate and open HTML coverage report in browser
coverage-open:
cargo llvm-cov --all-features --workspace --html --open
# Generate coverage in LCOV format (for CI)
coverage-lcov:
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
# Clean coverage artifacts
coverage-clean:
cargo llvm-cov clean --workspace
start-db:
dotenvx run -f {{ envfile }} -- docker compose up postgres --detach
stop-db:
dotenvx run -f {{ envfile }} -- docker compose down
serve $RUST_LOG="info":
cargo run -p capsula-server -- --database-url {{ database_url }}
[working-directory('crates/capsula-server')]
sqlx-prepare:
cargo sqlx prepare --database-url {{ database_url }}