-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
144 lines (125 loc) · 5.31 KB
/
Taskfile.yml
File metadata and controls
144 lines (125 loc) · 5.31 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
136
137
138
139
140
141
142
143
144
version: "3"
tasks:
fmt:
desc: Format code with rustfmt
cmds:
- cargo fmt
fmt-check:
desc: Check if code is formatted
cmds:
- cargo fmt -- --check
lint:
desc: Run linter
cmds:
- cargo clippy --workspace --all-targets --all-features -- -D warnings
doc:
desc: Build docs warnings-as-errors and run doc tests (mirrors CI)
# Mirrors the CI "build-and-test" doc job. RUSTDOCFLAGS=-D warnings turns
# rustdoc lints (broken/private intra-doc links, etc.) into hard errors —
# these only run in CI otherwise, so a clean `task dev` could still fail the
# doc job. `task dev` inlines the build half of this; the doc tests there
# come along with `cargo test --workspace`.
cmds:
- RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
- cargo test --doc
build-release:
desc: Build release version
cmds:
- cargo build --release
test-debug:
desc: Run tests with debug logging
cmds:
- RUST_LOG=debug cargo test
test-quiet:
desc: Run tests quietly (no debug output)
cmds:
- RUST_LOG=off cargo test
test-slow:
desc: Run ignored slow regression and stochastic tests
cmds:
- cargo test --workspace -- --ignored
test-ts:
desc: Compile the TS wrapper and run the @jolars/eunoia/svg unit tests
# `prepare-package.mjs` recompiles `ts/*.ts` → `npm/*.js` first, so the
# tests always run against fresh output. It only needs the (checked-in)
# wasm `.d.ts` in `npm/`, not a fresh wasm-pack build. The svg module is
# pure/wasm-free, so `node --test` loads `npm/svg.js` directly.
cmds:
- node ts/prepare-package.mjs
- node --test 'ts/tests/**/*.test.mjs'
coverage:
desc: Generate code coverage report
cmds:
- cargo llvm-cov --all-features --workspace --html
- echo "Coverage report generated at target/llvm-cov/html/index.html"
coverage-open:
desc: Generate and open coverage report in browser
cmds:
- cargo llvm-cov --all-features --workspace --open
dev:
desc: Development workflow - format, check, test (+ corpus guardrail), lint, doc
cmds:
- cargo fmt
- cargo check --workspace
- cargo test --workspace
# Fit-quality guardrail: the corpus_quality passes are #[ignore]'d out of
# the default suite for speed (~0.7s vs ~17s), but run here so the pre-PR
# gate still catches fitter regressions. Scoped to corpus_quality (~16s)
# rather than a blanket --include-ignored: the latter also pulls in the
# 17-set issue89 regression, whose debug-assert-heavy fits push the run
# past two minutes. Use `task test-slow` for the full ignored set.
- cargo test -p eunoia --lib fitter::corpus_quality -- --include-ignored
- cargo clippy --workspace --all-targets --all-features -- -D warnings
# Rustdoc warnings-as-errors (broken/private intra-doc links, etc.). CI
# enforces this in its doc job; mirror just the build here since the doc
# tests already ran under `cargo test --workspace` above. See `task doc`.
- RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
# JS/TS surface: compile the wrapper and run the pure svg-serializer tests.
- task: test-ts
build-wasm:
desc: Build WASM bindings and prepare npm/ as @jolars/eunoia
# The prepare step is part of `build-wasm` (not a separate task) so the
# `npm/` artifact is always self-consistent. Otherwise downstream tooling
# (notably pnpm resolving the `file:../npm` link from web/) can capture
# the raw wasm-pack output keyed as `eunoia-wasm` instead of
# `@jolars/eunoia`, silently breaking imports.
cmds:
- wasm-pack build crates/eunoia-wasm --target bundler --out-dir ../../npm
- node ts/prepare-package.mjs
pack-npm:
desc: Alias for build-wasm (kept for back-compat with publish workflows)
cmds:
- task: build-wasm
web-dev:
desc: Start Svelte development server
dir: web
cmds:
- npm run dev
flamegraph:
desc: "Flamegraph of the single-fit example. Args: CASE=3circle|4set|6set (default 6set)"
vars:
CASE: '{{.CASE | default "6set"}}'
cmds:
- RAYON_NUM_THREADS=1 cargo flamegraph --profile profiling --example fit_profile -- {{.CASE}}
perf-record:
desc: "perf record on the single-fit example. Args: CASE=3circle|4set|6set (default 6set)"
vars:
CASE: '{{.CASE | default "6set"}}'
cmds:
- cargo build --profile profiling --example fit_profile
- RAYON_NUM_THREADS=1 perf record --call-graph fp -F 999 -o perf.data -- ./target/profiling/examples/fit_profile {{.CASE}}
- 'echo "Inspect with: perf report -i perf.data (or: perf annotate -i perf.data)"'
samply:
desc: "samply record on the single-fit example (web UI). Args: CASE=3circle|4set|6set, ITERS=200"
vars:
CASE: '{{.CASE | default "6set"}}'
ITERS: "{{.ITERS | default 200}}"
cmds:
- cargo build --profile profiling --example fit_profile
- RAYON_NUM_THREADS=1 samply record ./target/profiling/examples/fit_profile {{.CASE}} {{.ITERS}}
asm:
desc: "Disassemble a function with cargo-show-asm. Args: FUNC=eunoia::geometry::shapes::ellipse::region_boundary_arcs_ellipse"
vars:
FUNC: '{{.FUNC | default ""}}'
cmds:
- cargo asm --profile profiling -p eunoia --lib {{.FUNC}}