-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathjustfile
More file actions
90 lines (73 loc) · 2.53 KB
/
Copy pathjustfile
File metadata and controls
90 lines (73 loc) · 2.53 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
# COMEBACKHERE-contracts task runner
# Compile all contracts
build:
cargo build
# Run all tests
test:
cargo test
# Run scoped mutation testing for treasury settlement math
mutants-treasury:
cargo mutants --package comebackhere-treasury --timeout 60 --test-threads 1 --in-place --no-shuffle --list-test-cases --exclude "contracts/treasury/tests/" || true
# Run only cross-contract integration tests (tests/ workspace package)
test-integration:
cargo test -p tests
# Format all code
fmt:
cargo fmt --all
# Run clippy lints
lint:
cargo clippy -- -D warnings
# Check dependencies for vulnerabilities and license issues
deny:
cargo deny check
# Audit dependencies for known security vulnerabilities
audit:
cargo audit
# Run format and lint checks (for CI)
check: fmt lint test deny
@echo "✓ All checks passed"
# Run all quality gates before pushing
check-all: fmt lint test audit
@echo "✓ All quality gates passed"
# Literal mirror of the Pre-commit CI job's command sequence (see .github/workflows/pre-commit.yml
# and .pre-commit-config.yaml) — run this before pushing for an authoritative local answer to
# "will Pre-commit pass".
precommit:
cargo fmt --all -- --check
cargo clippy -- -D warnings
scripts/check-enum-ordering.sh
scripts/check-enum-doc-comments.sh
@echo "✓ Pre-commit checks passed"
# Deploy all three contracts to testnet.
#
# Required env vars:
# STELLAR_ACCOUNT — signing identity (key name or secret key), e.g. "alice"
# STELLAR_NETWORK — network alias configured in the Stellar CLI, e.g. "testnet"
#
# Optional env vars (override when using a custom RPC):
# STELLAR_RPC_URL — RPC endpoint (defaults to the CLI network alias)
# STELLAR_NETWORK_PASSPHRASE — network passphrase (defaults to the CLI network alias)
#
# Example:
# STELLAR_ACCOUNT=alice STELLAR_NETWORK=testnet just deploy
deploy:
#!/usr/bin/env bash
set -euo pipefail
: "${STELLAR_ACCOUNT:?STELLAR_ACCOUNT must be set}"
: "${STELLAR_NETWORK:?STELLAR_NETWORK must be set}"
cargo build --target wasm32-unknown-unknown --release
WASM_DIR="target/wasm32-unknown-unknown/release"
deploy_contract() {
local name="$1"
local id
id=$(stellar contract deploy \
--wasm "$WASM_DIR/${name}.wasm" \
--source "$STELLAR_ACCOUNT" \
--network "$STELLAR_NETWORK")
echo "$name contract ID: $id"
}
deploy_contract compliance
deploy_contract invoice
deploy_contract treasury
# Default target
default: check