-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
73 lines (60 loc) · 1.35 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
73
# cargo install just
# just manual: https://github.com/casey/just/#readme
set dotenv-load := true
_default:
@just --list
_install:
#!/usr/bin/env bash
set -euxo pipefail
if ! command -v sqlx
then
cargo install sqlx-cli
fi
if ! command -v bunyan
then
cargo install bunyan
fi
if ! command -v cargo llvm-cov
then
cargo install llvm-cov
fi
# Start Docker containers
start: _install
#!/usr/bin/env bash
set -euxo pipefail
if [ ! $( docker ps | grep postgres | wc -l ) -gt 0 ]; then
./scripts/init_db.sh
fi
if [ ! $( docker ps | grep otel | wc -l ) -gt 0 ]; then
if [ -z ${HONEYCOMB_API_KEY+x} ]; then
echo "HONEYCOMB_API_KEY is not set. Your local server will not upload its tracing diagnostics to Honeycomb...";
fi
./scripts/init_collector.sh
fi
# Stop Docker containers
stop:
./scripts/stop_containers.sh
# Run application
run: start
cargo run | bunyan
# Runs unit tests
test:
ulimit -n 10000
cargo test -q --locked
# Count lines of code
cloc:
cloc configuration src tests migrations scripts
# Coverage analysis
coverage:
cargo llvm-cov -q --open --ignore-filename-regex "build.rs|src\/main.rs"
# Format code and fix common anti-patterns
fix:
cargo clippy --fix
cargo fmt
# Run CI pipeline
ci: coverage
cargo clippy --locked -- -D warnings
cargo fmt -- --check
# Update sqlx-data.json
sqlx:
cargo sqlx prepare -- --lib