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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
version: '3'
vars:
BINARY: birdnet-analyze
# Ensure cargo is available
env:
PATH: '{{.HOME}}/.cargo/bin:{{.PATH}}'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# ============================================================================
# Build Tasks
# ============================================================================
build:
desc: Build in debug mode
cmds:
- cargo build
build:release:
desc: Build in release mode (optimized)
cmds:
- cargo build --release
build:cli:
desc: Build CLI binary in release mode
cmds:
- cargo build --release --bin {{.BINARY}}
# ============================================================================
# Test Tasks
# ============================================================================
test:
desc: Run all unit tests
cmds:
- cargo test
test:all:
desc: Run all tests including integration tests (requires model fixtures)
cmds:
- cargo test -- --include-ignored
test:integration:
desc: Run only integration tests (requires model fixtures)
cmds:
- cargo test --test integration_test -- --ignored
test:watch:
desc: Run tests on file changes (requires cargo-watch)
cmds:
- cargo watch -x test
# ============================================================================
# Lint & Format Tasks
# ============================================================================
lint:
desc: Run clippy linter
cmds:
- cargo clippy --all-targets
lint:fix:
desc: Run clippy and apply automatic fixes
cmds:
- cargo clippy --all-targets --fix --allow-dirty
fmt:
desc: Format code with rustfmt
cmds:
- cargo fmt
fmt:check:
desc: Check code formatting without changes
cmds:
- cargo fmt -- --check
# ============================================================================
# Check Tasks
# ============================================================================
check:
desc: Quick compilation check (faster than build)
cmds:
- cargo check
check:all:
desc: Check all targets including tests
cmds:
- cargo check --all-targets
audit:
desc: Check for security vulnerabilities in dependencies
cmds:
- cargo audit
# ============================================================================
# Clean Tasks
# ============================================================================
clean:
desc: Remove build artifacts
cmds:
- cargo clean
clean:release:
desc: Remove only release build artifacts
cmds:
- rm -rf target/release
# ============================================================================
# Documentation Tasks
# ============================================================================
doc:
desc: Generate documentation
cmds:
- cargo doc --no-deps
doc:open:
desc: Generate and open documentation in browser
cmds:
- cargo doc --no-deps --open
# ============================================================================
# CI Tasks
# ============================================================================
ci:
desc: Run all CI checks (format, lint, test)
cmds:
- task: fmt:check
- task: lint
- task: audit
- task: test
# ============================================================================
# Run Tasks
# ============================================================================
run:
desc: Run CLI with arguments (use -- to pass args)
cmds:
- cargo run --release --bin {{.BINARY}} -- {{.CLI_ARGS}}
vars:
CLI_ARGS: '{{.CLI_ARGS | default "--help"}}'
# ============================================================================
# Development Tasks
# ============================================================================
dev:
desc: Development loop - check, lint, test
cmds:
- task: check
- task: lint
- task: test
watch:
desc: Watch for changes and run checks (requires cargo-watch)
cmds:
- cargo watch -x check -x clippy -x test
# ============================================================================
# Setup Tasks
# ============================================================================
setup:
desc: Install development tools
cmds:
- rustup component add clippy rustfmt
- cargo install cargo-watch
- cargo install cargo-audit
status:
- which cargo-watch
- which cargo-audit
setup:fixtures:
desc: Show instructions for setting up test fixtures
cmds:
- |
echo "To run integration tests, add model files to tests/fixtures/:"
echo ""
echo " tests/fixtures/"
echo " ├── birdnet_v24.onnx"
echo " ├── birdnet_v24_labels.txt"
echo " ├── birdnet_v30.onnx"
echo " ├── birdnet_v30_labels.csv"
echo " ├── perch_v2.onnx"
echo " └── perch_v2_labels.json"
echo ""
echo "Then run: task test:integration"
setup:hooks:
desc: Install git hooks for pre-commit and pre-push CI validation
cmds:
- git config core.hooksPath .githooks
- echo "Git hooks installed from .githooks/"
- echo " - pre-commit: format + clippy checks"
- echo " - pre-push: full CI validation (format, clippy, deny, tests)"