Repository navigation
Expand file tree
/
Copy pathtaskfile.yml
More file actions
135 lines (117 loc) Β· 3.35 KB
/
Copy pathtaskfile.yml
File metadata and controls
135 lines (117 loc) Β· 3.35 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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3.0"
set: ['e', 'u', 'pipefail']
shopt: ['globstar']
dotenv: ['.env']
vars:
# Reserve 2 cores for system, minimum 1 job
BUILD_JOBS: '{{if gt (sub numCPU 2) 0}}{{sub numCPU 2}}{{else}}1{{end}}'
env:
# Strip IDE extension paths (e.g. VS Code globalStorage) from PATH so
# IDE-bundled tools don't shadow project-pinned versions during builds
PATH:
sh: 'echo "$PATH" | tr ":" "\n" | grep -v "globalStorage" | paste -sd ":" -'
CARGO_HOME: "{{.ROOT_DIR}}/.cache/cargo"
CARGO_TARGET_DIR: "{{.ROOT_DIR}}/target"
RUSTUP_TOOLCHAIN:
sh: grep '^rust ' "{{.ROOT_DIR}}/.tool-versions" | awk '{print $2}'
RUSTC_WRAPPER: sccache
CARGO_BUILD_JOBS: "{{.BUILD_JOBS}}"
includes:
npm:
taskfile: ./taskfiles/npm.yml
deno:
taskfile: ./taskfiles/deno.yml
cargo:
taskfile: ./taskfiles/cargo.yml
zig:
taskfile: ./taskfiles/zig.yml
tauri:
taskfile: ./taskfiles/tauri.yml
ci:
taskfile: ./taskfiles/ci.yml
tasks:
default:
desc: "Default task"
cmds:
- task --list
pre-commit:
desc: "Run pre-commit hooks (prek reads .pre-commit-config.yml)"
cmds:
- prek run --all-files
lint:
desc: "Run linters"
cmds:
- task: cargo:lint
- task: deno:lint
- task: zig:lint
format:
desc: "Run formatters"
cmds:
- task: cargo:format
- task: deno:format
- task: zig:format
test:
desc: "Run tests (Rust + Frontend + Zig)"
cmds:
- task: cargo:test
- task: deno:test
- task: zig:test
test:e2e:
desc: "Run Playwright E2E tests"
cmds:
- task: deno:test:e2e
build:
desc: "Build Tauri app for current architecture"
cmds:
- task: tauri:build
build:arm64:
desc: "Build Tauri app for Apple Silicon (arm64)"
cmds:
- task: tauri:build:arm64
build:x64:
desc: "Build Tauri app for Intel (x86_64)"
cmds:
- task: tauri:build:x64
build:linux-amd64:
desc: "Build Linux amd64 .deb via Docker"
cmds:
- task: tauri:build:linux-amd64
build:timings:
desc: "Analyze build performance bottlenecks"
cmds:
- task: cargo:build:timings
profile:
desc: "Show CPU/RAM usage for mt processes (dev + release)"
platforms: [darwin, linux]
cmds:
- |
case "{{OS}}" in
darwin)
procs=$(ps aux | grep -E '[m]t-tauri|/[m]t( |$)' || true)
;;
linux)
procs=$(ps aux --no-headers | grep -E '[m]t-tauri|/[m]t( |$)|[W]ebKit' || true)
;;
esac
if [ -z "$procs" ]; then
echo "No mt processes found."
exit 0
fi
echo "$procs" | awk '
BEGIN {
printf "%-8s %-25s %6s %6s %10s\n", "PID", "PROCESS", "CPU%", "MEM%", "RSS (MB)"
printf "%-8s %-25s %6s %6s %10s\n", "---", "-------", "----", "----", "--------"
}
{
pid=$2; cpu=$3; mem=$4; rss=$6/1024
cmd=$11; gsub(/.*\//, "", cmd)
printf "%-8s %-25s %6.1f %6.1f %10.1f\n", pid, cmd, cpu, mem, rss
tcpu+=cpu; tmem+=mem; trss+=rss
}
END {
printf "%-8s %-25s %6s %6s %10s\n", "---", "-------", "----", "----", "--------"
printf "%-8s %-25s %6.1f %6.1f %10.1f\n", "", "TOTAL", tcpu, tmem, trss
}
'
silent: true