-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
623 lines (530 loc) · 14.9 KB
/
Copy pathTaskfile.yaml
File metadata and controls
623 lines (530 loc) · 14.9 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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
version: "3"
# ============================================================================
# ============================================================================
includes:
rust:
taskfile: ./.task/languages/rust.yml
python:
taskfile: ./.task/languages/python.yml
node:
taskfile: ./.task/languages/node.yml
ruby:
taskfile: ./.task/languages/ruby.yml
php:
taskfile: ./.task/languages/php.yml
go:
taskfile: ./.task/languages/go.yml
java:
taskfile: ./.task/languages/java.yml
csharp:
taskfile: ./.task/languages/csharp.yml
elixir:
taskfile: ./.task/languages/elixir.yml
dart:
taskfile: ./.task/languages/dart.yml
swift:
taskfile: ./.task/languages/swift.yml
kotlin-android:
taskfile: ./.task/languages/kotlin_android.yml
zig:
taskfile: ./.task/languages/zig.yml
bench:
taskfile: ./.task/workflows/benchmark.yml
version:
taskfile: ./.task/tools/version-sync.yml
docs:
taskfile: ./.task/tools/docs.yml
readme:
taskfile: ./.task/tools/generate.yml
_tools:
taskfile: ./.task/tools/general.yml
flatten: true
tasks:
setup:
desc: "Install all dependencies and dev tools"
cmds:
- task: rust:install
- alef setup
- command -v poly >/dev/null 2>&1 || brew install goldziher/tap/poly
- poly hooks install
build:
desc: "Build Rust core library only"
cmds:
- task: build:core
build:dev:
desc: "Build all in debug mode"
cmds:
- task: rust:build:dev
build:release:
desc: "Build Rust core in release mode"
cmds:
- task: rust:build:release
build:ci:
desc: "Build Rust core in CI mode"
cmds:
- task: rust:build:ci
build:core:
desc: "Build Rust core library only"
cmds:
- task: rust:build
build:bindings:
desc: "Build all language bindings"
cmds:
- task: alef:build
build:all:
desc: "Build Rust core library and all language bindings"
cmds:
- task: build:core
- task: build:bindings
build:cli:
desc: "Build the html-to-markdown CLI binary"
cmds:
- task: rust:build:release
test:
desc: "Run Rust core test suite only"
cmds:
- task: rust:test
test:bindings:
desc: "Run binding test suites only (skip Rust core)"
cmds:
- alef test
test:all:
desc: "Run all test suites across all languages"
cmds:
- task: test
- task: test:bindings
test:ci:
desc: "Run all tests with coverage (CI mode)"
cmds:
- task: rust:test:ci
- alef test --coverage
lint:
desc: "Lint all code via poly"
cmds:
- poly lint .
lint:check:
desc: "Lint all code WITHOUT auto-fix (check-only)"
cmds:
- poly lint .
go:lint:
desc: "Lint Go bindings with golangci-lint"
cmds:
- golangci-lint run ./... --config .golangci.yml
dir: packages/go
ruby:lint:
desc: "Lint Ruby bindings with rubocop and steep"
cmds:
- alef lint --lang ruby
csharp:lint:
desc: "Lint C# bindings with dotnet format"
cmds:
- alef lint --lang csharp
format:
desc: "Format all code via poly"
cmds:
- poly fmt --fix .
format:check:
desc: "Check code formatting without modifications"
cmds:
- poly fmt --check .
check:
desc: "Run all checks (format + lint, no modifications)"
cmds:
- task: format:check
- task: lint:check
update:
desc: "Update all dependencies (within major versions)"
cmds:
- alef update
- cmd: gau --update .
ignore_error: false
- task: rust:update
- task: python:update
- task: node:update
- task: ruby:update
- task: php:update
- task: go:update
- task: java:update
- task: csharp:update
- task: elixir:update
- task: dart:update
- task: swift:update
- task: kotlin-android:update
- task: zig:update
upgrade:
desc: "Upgrade all dependencies to latest (including breaking changes)"
cmds:
- alef update --latest
- cmd: gau --update .
ignore_error: false
- task: rust:upgrade
- task: python:upgrade
- task: node:upgrade
- task: ruby:upgrade
- task: php:upgrade
- task: go:upgrade
- task: java:upgrade
- task: csharp:upgrade
- task: elixir:upgrade
- task: dart:upgrade
- task: swift:upgrade
- task: kotlin-android:upgrade
- task: zig:upgrade
cov:rust:
desc: "Generate Rust coverage report"
cmds:
- task: rust:coverage
cov:all:
desc: "Generate coverage for all languages"
cmds:
- task: rust:test:ci
- alef test --coverage
versions:sync:
desc: "Synchronize version from Cargo.toml to all package manifests"
cmds:
- task: version:sync
publish:validate:
desc: "Validate publish manifests are consistent"
cmds:
- alef publish validate
publish:prepare:
desc: "Prepare packages for publishing (vendor deps, stage FFI)"
cmds:
- alef publish prepare
publish:build:
desc: "Build release artifacts for all languages"
cmds:
- alef publish build
publish:package:
desc: "Package built artifacts into distributable archives"
cmds:
- alef publish package -o dist/
alef:generate:
desc: "Regenerate all Alef-managed outputs without building"
cmds:
- alef all --clean
alef:verify:
desc: "Check Alef-generated files are up to date"
cmds:
- alef verify --exit-code
alef:build:
desc: "Build all language bindings"
cmds:
- alef build
alef:sync:
desc: "Sync version from Cargo.toml to all manifests"
cmds:
- alef sync-versions
alef:docs:
desc: "Generate API reference documentation"
cmds:
- alef docs
node:e2e:
desc: "Build Node binding and run e2e/node fixture tests"
cmds:
- alef test --e2e --lang node
ruby:e2e:
desc: "Build Ruby binding and run e2e/ruby fixture tests"
cmds:
- alef test --e2e --lang ruby
php:e2e:
desc: "Build PHP extension and run e2e/php fixture tests"
cmds:
- alef test --e2e --lang php
go:e2e:
desc: "Build FFI and run e2e/go fixture tests"
cmds:
- alef test --e2e --lang go
java:e2e:
desc: "Build FFI and run e2e/java fixture tests"
cmds:
- alef test --e2e --lang java
csharp:e2e:
desc: "Build FFI and run e2e/csharp fixture tests"
cmds:
- alef test --e2e --lang csharp
elixir:e2e:
desc: "Build Elixir NIF and run e2e/elixir fixture tests"
cmds:
- alef test --e2e --lang elixir
wasm:e2e:
desc: "Build WASM and run e2e/wasm fixture tests"
cmds:
- alef test --e2e --lang wasm
r:e2e:
desc: "Run e2e/r fixture tests"
cmds:
- alef test --e2e --lang r
c:e2e:
desc: "Build FFI and run e2e/c fixture tests"
cmds:
- alef test --e2e --lang c
dart:e2e:
desc: "Build Dart binding and run e2e/dart fixture tests"
cmds:
- alef test --e2e --lang dart
swift:e2e:
desc: "Build Swift bridge and run e2e/swift_e2e fixture tests"
cmds:
- alef test --e2e --lang swift
zig:e2e:
desc: "Build FFI and run e2e/zig fixture tests"
cmds:
- alef test --e2e --lang zig
kotlin-android:e2e:
desc: "Build JNI and run e2e/kotlin_android fixture tests (host JVM)"
cmds:
- alef test --e2e --lang kotlin_android
e2e:all:
desc: "Build all bindings and run all local e2e fixture tests"
cmds:
- task: e2e:build
- task: e2e:test
e2e:quick:
desc: "Run quick E2E tests (Rust only)"
cmds:
- task: rust:e2e:test
e2e:generate:
desc: "Generate E2E tests for all languages from fixtures"
cmds:
- alef e2e generate
e2e:build:
desc: "Build all language bindings for E2E tests"
cmds:
- task: alef:build
e2e:test:
desc: "Run E2E tests for all languages"
cmds:
- alef test --e2e
e2e:lint:
desc: "Lint generated E2E test code"
cmds:
- alef lint
e2e:verify:
desc: "Full E2E pipeline - generate, lint, and test all suites"
cmds:
- task: e2e:generate
- task: e2e:lint
- task: e2e:test
test-apps:smoke:
desc: "Run smoke tests for all published packages (fast validation)"
cmds:
- task: test-apps:smoke:python
- task: test-apps:smoke:node
- task: test-apps:smoke:bun
- task: test-apps:smoke:wasm
- task: test-apps:smoke:ruby
- task: test-apps:smoke:php
- task: test-apps:smoke:php_ext
- task: test-apps:smoke:go
- task: test-apps:smoke:java
- task: test-apps:smoke:csharp
- task: test-apps:smoke:elixir
- task: test-apps:smoke:r
- task: test-apps:smoke:rust
- task: test-apps:smoke:c
- task: test-apps:smoke:homebrew
test-apps:smoke:python:
desc: "Smoke test Python package from PyPI"
dir: test_apps/python
cmds:
- uv sync --no-install-project --no-install-workspace
- uv run --no-sync pytest tests/test_smoke.py -v
test-apps:smoke:node:
desc: "Smoke test Node package from npm"
dir: test_apps/node
cmds:
- pnpm install
- pnpm exec vitest run tests/smoke.test.ts
test-apps:smoke:ruby:
desc: "Smoke test Ruby gem from RubyGems"
dir: test_apps/ruby
cmds:
- bundle install
- bundle exec rspec spec/smoke_spec.rb
test-apps:smoke:php:
desc: "Smoke test PHP package from Packagist"
dir: test_apps/php
cmds:
- bash install.sh
- composer install
- vendor/bin/phpunit tests/SmokeTest.php
test-apps:smoke:go:
desc: "Smoke test Go package from pkg.go.dev"
dir: test_apps/go
cmds:
- go mod download github.com/xberg-io/html-to-markdown/packages/go/v3
- bash ./download_ffi.sh
- go test -v -run Smoke
test-apps:smoke:java:
desc: "Smoke test Java package from Maven Central"
dir: test_apps/java
cmds:
- ./mvnw{{if eq .OS "windows"}}.cmd{{end}} clean install -DskipTests
- ./mvnw{{if eq .OS "windows"}}.cmd{{end}} test -Dtest=SmokeTest
test-apps:smoke:csharp:
desc: "Smoke test C# package from NuGet"
dir: test_apps/csharp
cmds:
- dotnet restore
- dotnet test --filter FullyQualifiedName~SmokeTest
test-apps:smoke:elixir:
desc: "Smoke test Elixir package from Hex.pm"
dir: test_apps/elixir
cmds:
- mix deps.get
- mix test test/smoke_test.exs
test-apps:smoke:r:
desc: "Smoke test R package"
dir: test_apps/r
cmds:
- Rscript install.R
- Rscript -e "library(testthat); library(htmltomarkdown); test_file('tests/test_smoke.R')"
test-apps:smoke:bun:
desc: "Smoke test Node package from npm under Bun"
dir: test_apps/bun
cmds:
- bun install
- bun test smoke.test.ts
test-apps:smoke:wasm:
desc: "Smoke test WASM package from npm"
dir: test_apps/wasm
cmds:
- pnpm install
- pnpm exec vitest run tests/smoke.test.ts
test-apps:smoke:rust:
desc: "Smoke test Rust crate from crates.io"
dir: test_apps/rust
cmds:
- cargo test --test smoke_test
test-apps:smoke:c:
desc: "Smoke test C FFI from GitHub release tarballs"
dir: test_apps/c
cmds:
- make test
test-apps:smoke:php_ext:
desc: "Smoke test PHP native extension installed via PIE"
dir: test_apps/php_ext
cmds:
- ./run_tests.sh
test-apps:smoke:homebrew:
desc: "Smoke test the Homebrew CLI + FFI formulae"
dir: test_apps/homebrew
cmds:
- ./run_tests.sh
test-apps:test:
desc: "Run comprehensive tests for all published packages"
cmds:
- task: test-apps:test:python
- task: test-apps:test:node
- task: test-apps:test:ruby
- task: test-apps:test:php
- task: test-apps:test:go
- task: test-apps:test:java
- task: test-apps:test:csharp
- task: test-apps:test:elixir
- task: test-apps:test:r
- task: test-apps:test:swift
- task: test-apps:test:dart
- task: test-apps:test:zig
- task: test-apps:test:kotlin-android
test-apps:test:python:
desc: "Comprehensive tests for Python package"
dir: test_apps/python
cmds:
- uv sync --no-install-project --no-install-workspace
- uv run --no-sync pytest tests/test_conversion.py -v
test-apps:test:node:
desc: "Comprehensive tests for Node package"
dir: test_apps/node
cmds:
- pnpm install
- pnpm test
test-apps:test:ruby:
desc: "Comprehensive tests for Ruby gem"
dir: test_apps/ruby
cmds:
- bundle install
- bundle exec rspec spec/conversion_spec.rb
test-apps:test:php:
desc: "Comprehensive tests for PHP package"
dir: test_apps/php
cmds:
- bash install.sh
- composer install
- vendor/bin/phpunit tests
test-apps:test:go:
desc: "Comprehensive tests for Go package"
dir: test_apps/go
cmds:
- go mod tidy
- go test -v -run Test_
test-apps:test:java:
desc: "Comprehensive tests for Java package"
dir: test_apps/java
cmds:
- ./mvnw{{if eq .OS "windows"}}.cmd{{end}} test -Dtest=ConversionTest
test-apps:test:csharp:
desc: "Comprehensive tests for C# package"
dir: test_apps/csharp
cmds:
- dotnet test --filter FullyQualifiedName~ConversionTests
test-apps:test:elixir:
desc: "Comprehensive tests for Elixir package"
dir: test_apps/elixir
cmds:
- mix deps.get
- mix test test/conversion_test.exs
test-apps:test:r:
desc: "Comprehensive tests for R package"
dir: test_apps/r
cmds:
- Rscript install.R
- Rscript run_tests.R
test-apps:test:swift:
desc: "Comprehensive tests for Swift package"
dir: test_apps/swift_e2e
cmds:
- swift test
test-apps:test:dart:
desc: "Comprehensive tests for Dart package"
dir: test_apps/dart
cmds:
- dart pub get
- dart test
test-apps:test:zig:
desc: "Comprehensive tests for Zig package"
dir: test_apps/zig
vars:
H2M_VERSION:
sh: cd ../.. && grep -m1 '^version = ' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/'
cmds:
- zig fetch --save=html_to_markdown "https://github.com/xberg-io/html-to-markdown/releases/download/v{{.H2M_VERSION}}/html-to-markdown-rs-zig-v{{.H2M_VERSION}}.tar.gz"
- zig build test
test-apps:test:kotlin-android:
desc: "Comprehensive tests for Kotlin/Android AAR (host JVM tests)"
dir: test_apps/kotlin_android
cmds:
- ./gradlew test
test-apps:comprehensive:
desc: "Run all test_app comprehensive tests (alias for test-apps:test)"
cmds:
- task: test-apps:test
build:demo:
desc: "Build the GitHub Pages demo"
cmds:
- ./scripts/build-demo.sh
serve:demo:
desc: "Serve the GitHub Pages demo locally on port 8000"
dir: docs
cmds:
- python3 -m http.server 8000
clean:
desc: "Remove build artifacts across all languages"
cmds:
- task: rust:clean
- alef clean
default:
desc: "List available tasks"
cmds:
- task --list