-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathjustfile
More file actions
136 lines (102 loc) · 3.44 KB
/
Copy pathjustfile
File metadata and controls
136 lines (102 loc) · 3.44 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
mod android 'sdks/android/android.just'
mod ios 'sdks/ios/ios.just'
mod node 'bindings/node/node.just'
mod wasm 'bindings/wasm/wasm.just'
mod js 'sdks/js/js.just'
export NIX_DEVSHELL := env("NIX_DEVSHELL", "default")
set shell := ["./dev/nix-shell"]
nix_system := arch() + "-" + if os() == "macos" { "darwin" } else { "linux" }
# CI overrides to "cargo llvm-cov nextest --no-fail-fast --no-report" for coverage
cargo_test := env("CARGO_TEST_CMD", "cargo nextest run")
[script("bash")]
default:
just --list --list-submodules
# --- CHECK ---
# `just check`, `just check crate xmtp_mls`, `just check crate xmtp_mls xmtp_db`
[script("bash")]
check target="workspace" *args="":
just _check-{{ target }} {{ args }}
[private]
_check-workspace:
cargo check --locked
[private]
_check-crate +crates:
args=""; for c in {{ crates }}; do args="$args -p $c"; done; \
cargo check --locked $args
# --- LINT ---
lint: lint-rust lint-config lint-markdown
lint-rust:
cargo clippy --locked --all-features --all-targets --no-deps -- -Dwarnings
cargo fmt --check
cargo hakari generate --diff
cargo hakari manage-deps --dry-run
# Config linting: TOML, Nix, shell scripts
lint-config: lint-treefmt
lint-toml:
taplo format --check --diff
taplo check
[script("bash")]
lint-treefmt:
nix fmt -- --fail-on-change
lint-markdown:
markdownlint "**/*.md" --disable MD001 MD013
# --- FORMAT ---
[script("bash")]
format:
nix fmt
just android format
just ios format
just node format
just wasm format
# --- TEST ---
# run the nix derivation for v3/d14n tests. no local incremental compilation but does use global cachix.
nix-test:
nix run nixpkgs#nix-output-monitor build .#nextest.{{ nix_system }}.v3
nix run nixpkgs#nix-output-monitor build .#nextest.{{ nix_system }}.d14n
# `just test`, `just test v3`, `just test d14n`, `just test crate xmtp_mls`
[script("bash")]
test target="all" *args="":
just _test-{{ target }} {{ args }}
[private]
_test-all *args="": (_test-v3 args) (_test-d14n args)
[private]
_test-v3 *args="":
{{ cargo_test }} --profile ci {{ args }}
[private]
_test-d14n *args="":
{{ cargo_test }} \
--features d14n --profile ci-d14n \
-E 'package(xmtp_mls)' -E 'rdeps(xmtp_mls)' {{ args }}
[private]
_test-crate +crates:
args=""; for c in {{ crates }}; do args="$args -p $c"; done; \
{{ cargo_test }} $args
# Run xdbg cross-version compat harness. Stable HEADs by default; pass
# --profile nightly for nightly samples. Anything after `--` is forwarded
# to every xdbg invocation as global flags (e.g. -vvvv for trace logs).
#
# just cross-test # stable, sample-size 0
# just cross-test --profile nightly # nightly, default 3
# just cross-test --profile nightly --sample-size 5 -- -vvvv
cross-test *args="":
nix run .#cross-version-test -- run {{ args }}
# Sibling to `cross-test`: each version runs under --strict-versioning
# against a shared XDBG_DB_ROOT, so it tests wire-level MLS interop
# rather than SQLite-upgrade compatibility. Same arg shape.
cross-talk-test *args="":
nix run .#cross-talk-test -- run {{ args }}
# --- BACKEND ---
# `just backend up`, `just backend down`
[script("bash")]
backend command="up":
just _backend-{{ command }}
[private]
[script("bash")]
_backend-up:
set -euo pipefail
nix build .#validation-service-image
dev/docker/up
[private]
[script("bash")]
_backend-down:
dev/docker/down