-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
100 lines (82 loc) 路 2.46 KB
/
Copy pathjustfile
File metadata and controls
100 lines (82 loc) 路 2.46 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
# chough Justfile
# Fast chunked ASR CLI using sherpa-onnx
# Default recipe - show available commands
[private]
default:
@just --list
# Build the CLI binary (current host)
build:
go build -o dist/chough ./cmd/chough
# Validate goreleaser config
release-check:
goreleaser check
# Local archive snapshot using goreleaser-cross (publishing and Docker disabled)
release-cross-snapshot:
docker run --rm \
-v "$PWD":/work \
-w /work \
--entrypoint /bin/sh \
ghcr.io/goreleaser/goreleaser-cross:latest \
-lc 'apt-get update >/dev/null && apt-get install -y patchelf >/dev/null && git config --global --add safe.directory /work && go mod download && goreleaser release --snapshot --clean --skip=publish --skip=announce --skip=aur --skip=winget --skip=docker'
# Run the CLI with test file
dev *ARGS:
go run ./cmd/chough {{ARGS}}
# Test with 30s chunks
test: build
./dist/chough -c 30 ./test/audio/audio-1min.wav
# Test different chunk sizes
test-chunks: build
#!/usr/bin/env bash
set -euo pipefail
echo "=== 15s chunks ==="
time ./dist/chough -c 15 ./test/audio/audio-1min.wav 2>&1 | tail -3
echo ""
echo "=== 30s chunks ==="
time ./dist/chough -c 30 ./test/audio/audio-1min.wav 2>&1 | tail -3
echo ""
echo "=== 60s chunks ==="
time ./dist/chough -c 60 ./test/audio/audio-1min.wav 2>&1 | tail -3
# Test 5-minute file (good stress test)
test-long: build
time ./dist/chough -c 30 ./test/audio/audio-5min.wav
# Run Go tests
unit-test:
go test -v ./...
# Format code
fmt:
go fmt ./...
# Run linter
lint:
golangci-lint run ./...
# Clean build artifacts
clean:
@if [ -d dist ]; then trash dist; fi
go clean -cache
# Download and tidy dependencies
get:
go mod download
go mod tidy
# Update dependencies
update:
go get -u ./...
go mod tidy
# Check for vulnerabilities
vuln:
govulncheck ./...
# Run all local validation checks
check:
@files="$(gofmt -l .)"; if [ -n "$files" ]; then echo "unformatted Go files:"; echo "$files"; exit 1; fi
go test -race ./...
go vet ./...
golangci-lint run ./...
govulncheck ./...
actionlint
shellcheck benchmarks/*.sh scripts/*.sh
git diff --check
# Show help
help:
@just --list
# Benchmark cold CLI and warm server performance (requires hyperfine)
benchmark *ARGS:
@command -v hyperfine >/dev/null 2>&1 || (echo "Install hyperfine: cargo install hyperfine" && exit 1)
./benchmarks/benchmark.sh {{ARGS}}