forked from iOfficeAI/AionCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
102 lines (79 loc) · 3.96 KB
/
Copy pathjustfile
File metadata and controls
102 lines (79 loc) · 3.96 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
# Default: list available recipes
set windows-shell := ["powershell.exe", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command"]
cargo_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/cargo.ps1" } else { "bash scripts/just/cargo.sh" }
build_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/build.ps1" } else { "bash scripts/just/build.sh" }
install_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/install.ps1" } else { "bash scripts/just/install.sh" }
migration_check_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/migration/check-immutability.ps1" } else { "bash scripts/migration/check-immutability.sh" }
migration_check_test_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/migration/check-immutability.test.ps1" } else { "bash scripts/migration/check-immutability.test.sh" }
auto_commit_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/auto-commit-fixes.ps1" } else { "bash scripts/just/auto-commit-fixes.sh" }
update_aionrs_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/update-aionrs.ps1" } else { "bash scripts/just/update-aionrs.sh" }
cat_config_script := if os_family() == "windows" { "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File scripts/just/cat-config.ps1" } else { "bash scripts/just/cat-config.sh" }
default:
@just --list
# Enable pre-commit hooks (run once after clone)
setup:
git config core.hooksPath .githooks
@echo "Git hooks enabled"
# Run cargo with optional local aionrs SDK patches.
_cargo *ARGS:
@{{cargo_script}} {{ARGS}}
# Build in release mode (does not install; run `just install` for that)
# Use `just build --force` to skip cache check
build *FLAGS: lint-fix fmt
@{{build_script}} release {{FLAGS}}
# Build in debug mode
# Use `just build-debug --force` to skip cache check
build-debug *FLAGS:
@{{build_script}} debug {{FLAGS}}
# Build (if needed) then install the release binary to cargo bin
install: build
@{{install_script}} release
# Run all tests
test:
@just _cargo nextest run --workspace
# Ensure already-shipped database migrations stay immutable
migration-check:
@{{migration_check_script}}
# Test the migration immutability guard itself
migration-check-test:
@{{migration_check_test_script}}
# Lint (warnings = errors)
lint:
@just _cargo clippy --workspace -- -D warnings
lint-fix:
@just _cargo fix --allow-dirty --allow-staged
@just _cargo clippy --fix --workspace --allow-dirty --allow-staged -- -D warnings
# Format code
fmt:
@cargo fmt --all
# Check formatting (CI)
fmt-check:
@cargo fmt --all -- --check
# Lint + format check + migration check + test
check: migration-check lint fmt-check test
# Run the server (debug)
run *ARGS:
@just _cargo run --bin aioncore -- {{ARGS}}
# Run the server (release)
run-release *ARGS:
@just _cargo run --release --bin aioncore -- {{ARGS}}
# Pre-push gate: migration check, format, lint, auto-commit fixes, test, then push
push *ARGS: migration-check lint-fix fmt _auto-commit-fixes test
git push {{ARGS}}
# Auto-commit any formatting/lint fixes if there are changes
_auto-commit-fixes:
@{{auto_commit_script}}
# Update aionrs dependency: bump Cargo.toml tag, then open a PR whose body
# carries aionrs feat/fix/perf as conventional footer for release-please.
# e.g. `just update-aionrs` (latest) or `just update-aionrs v0.2.9`
update-aionrs *TAG:
@{{update_aionrs_script}} {{TAG}}
# Security audit
audit:
@cargo audit
# Clean build artifacts
clean:
@cargo clean
# Decode dev config and copy to clipboard when possible
cat-config:
@{{cat_config_script}}