phostt 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. phostt-0.4.2/.cargo/audit.toml +4 -0
  2. phostt-0.4.2/.cargo/config.toml +17 -0
  3. phostt-0.4.2/.dockerignore +34 -0
  4. phostt-0.4.2/.github/ISSUE_TEMPLATE/bug_report.yml +88 -0
  5. phostt-0.4.2/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. phostt-0.4.2/.github/ISSUE_TEMPLATE/feature_request.yml +36 -0
  7. phostt-0.4.2/.github/dependabot.yml +59 -0
  8. phostt-0.4.2/.github/workflows/benchmark.yml +86 -0
  9. phostt-0.4.2/.github/workflows/check-ort-stable.yml +65 -0
  10. phostt-0.4.2/.github/workflows/ci.yml +218 -0
  11. phostt-0.4.2/.github/workflows/docs.yml +22 -0
  12. phostt-0.4.2/.github/workflows/homebrew.yml +136 -0
  13. phostt-0.4.2/.github/workflows/pypi.yml +91 -0
  14. phostt-0.4.2/.github/workflows/release.yml +275 -0
  15. phostt-0.4.2/.github/workflows/soak.yml +75 -0
  16. phostt-0.4.2/.gitignore +9 -0
  17. phostt-0.4.2/ANDROID.md +335 -0
  18. phostt-0.4.2/BENCHMARKS.md +156 -0
  19. phostt-0.4.2/CHANGELOG.md +303 -0
  20. phostt-0.4.2/CLAUDE.md +157 -0
  21. phostt-0.4.2/CONTRIBUTING.md +65 -0
  22. phostt-0.4.2/Cargo.lock +4020 -0
  23. phostt-0.4.2/Cargo.toml +126 -0
  24. phostt-0.4.2/Dockerfile +77 -0
  25. phostt-0.4.2/Dockerfile.cuda +82 -0
  26. phostt-0.4.2/Formula/phostt.rb +58 -0
  27. phostt-0.4.2/LICENSE +21 -0
  28. phostt-0.4.2/PKG-INFO +355 -0
  29. phostt-0.4.2/README.md +328 -0
  30. phostt-0.4.2/SECURITY.md +40 -0
  31. phostt-0.4.2/TODO.md +50 -0
  32. phostt-0.4.2/benches/latency.rs +52 -0
  33. phostt-0.4.2/deny.toml +34 -0
  34. phostt-0.4.2/docker-compose.yml +20 -0
  35. phostt-0.4.2/examples/KotlinClient.kt +76 -0
  36. phostt-0.4.2/examples/bun_client.ts +62 -0
  37. phostt-0.4.2/examples/go_client.go +111 -0
  38. phostt-0.4.2/examples/python_client.py +86 -0
  39. phostt-0.4.2/ffi/android/PhosttBridge.kt +138 -0
  40. phostt-0.4.2/pyproject.toml +39 -0
  41. phostt-0.4.2/python/phostt/__init__.py +52 -0
  42. phostt-0.4.2/rust-toolchain.toml +3 -0
  43. phostt-0.4.2/scripts/benchmark.sh +107 -0
  44. phostt-0.4.2/scripts/prepare_fleurs_benchmark.py +56 -0
  45. phostt-0.4.2/specs/001-pool-metrics-reliability.md +91 -0
  46. phostt-0.4.2/specs/002-rest-handler-unit-tests.md +49 -0
  47. phostt-0.4.2/specs/005-graceful-shutdown-unit-tests.md +81 -0
  48. phostt-0.4.2/src/error.rs +131 -0
  49. phostt-0.4.2/src/ffi.rs +467 -0
  50. phostt-0.4.2/src/inference/audio.rs +675 -0
  51. phostt-0.4.2/src/inference/decode.rs +291 -0
  52. phostt-0.4.2/src/inference/diarization.rs +66 -0
  53. phostt-0.4.2/src/inference/engine.rs +637 -0
  54. phostt-0.4.2/src/inference/features.rs +164 -0
  55. phostt-0.4.2/src/inference/mod.rs +763 -0
  56. phostt-0.4.2/src/inference/pool.rs +264 -0
  57. phostt-0.4.2/src/inference/streaming.rs +632 -0
  58. phostt-0.4.2/src/inference/tokenizer.rs +165 -0
  59. phostt-0.4.2/src/inspect.rs +60 -0
  60. phostt-0.4.2/src/lib.rs +40 -0
  61. phostt-0.4.2/src/main.rs +368 -0
  62. phostt-0.4.2/src/model/mod.rs +688 -0
  63. phostt-0.4.2/src/protocol/mod.rs +279 -0
  64. phostt-0.4.2/src/python.rs +87 -0
  65. phostt-0.4.2/src/server/http.rs +716 -0
  66. phostt-0.4.2/src/server/metrics.rs +450 -0
  67. phostt-0.4.2/src/server/mod.rs +1212 -0
  68. phostt-0.4.2/src/server/openapi.rs +33 -0
  69. phostt-0.4.2/src/server/rate_limit.rs +427 -0
  70. phostt-0.4.2/src/server/ws/mod.rs +789 -0
  71. phostt-0.4.2/tests/benchmark_report.rs +77 -0
  72. phostt-0.4.2/tests/common/mod.rs +259 -0
  73. phostt-0.4.2/tests/e2e_errors.rs +294 -0
  74. phostt-0.4.2/tests/e2e_rate_limit.rs +66 -0
  75. phostt-0.4.2/tests/e2e_rest.rs +386 -0
  76. phostt-0.4.2/tests/e2e_shutdown.rs +431 -0
  77. phostt-0.4.2/tests/e2e_ws.rs +407 -0
  78. phostt-0.4.2/tests/ep_smoke.rs +61 -0
  79. phostt-0.4.2/tests/ffi_streaming.rs +107 -0
  80. phostt-0.4.2/tests/ffi_stress.rs +135 -0
  81. phostt-0.4.2/tests/fixtures/golos_00.wav +0 -0
  82. phostt-0.4.2/tests/fixtures/golos_01.wav +0 -0
  83. phostt-0.4.2/tests/fixtures/golos_02.wav +0 -0
  84. phostt-0.4.2/tests/fixtures/golos_03.wav +0 -0
  85. phostt-0.4.2/tests/fixtures/golos_04.wav +0 -0
  86. phostt-0.4.2/tests/fixtures/golos_05.wav +0 -0
  87. phostt-0.4.2/tests/fixtures/golos_06.wav +0 -0
  88. phostt-0.4.2/tests/fixtures/golos_07.wav +0 -0
  89. phostt-0.4.2/tests/fixtures/golos_08.wav +0 -0
  90. phostt-0.4.2/tests/fixtures/golos_09.wav +0 -0
  91. phostt-0.4.2/tests/fixtures/golos_10.wav +0 -0
  92. phostt-0.4.2/tests/fixtures/golos_11.wav +0 -0
  93. phostt-0.4.2/tests/fixtures/golos_12.wav +0 -0
  94. phostt-0.4.2/tests/fixtures/golos_13.wav +0 -0
  95. phostt-0.4.2/tests/fixtures/golos_14.wav +0 -0
  96. phostt-0.4.2/tests/fixtures/manifest.json +62 -0
  97. phostt-0.4.2/tests/fleurs_wer.rs +146 -0
  98. phostt-0.4.2/tests/load_test.rs +226 -0
  99. phostt-0.4.2/tests/soak_test.rs +143 -0
  100. phostt-0.4.2/tests/wer.rs +82 -0
@@ -0,0 +1,4 @@
1
+ [advisories]
2
+ # (no ignores — RUSTSEC-2021-0073 was retired when we migrated the ONNX
3
+ # protobuf pipeline from `onnx-pb 0.1.4 + prost 0.6` to vendored
4
+ # `proto/onnx.proto` + `prost 0.13` via `build.rs`. See `src/onnx_proto.rs`.)
@@ -0,0 +1,17 @@
1
+ # Android NDK linker configuration for cargo-ndk builds.
2
+ #
3
+ # Adjust the API level (35) to match your installed NDK version.
4
+ # Common values: 28 (Android 9), 30 (Android 11), 33 (Android 13), 35 (Android 15).
5
+ # The NDK toolchain binaries live inside $NDK_HOME/toolchains/llvm/prebuilt/<host>/bin/.
6
+
7
+ [target.aarch64-linux-android]
8
+ linker = "aarch64-linux-android35-clang"
9
+
10
+ [target.armv7-linux-androideabi]
11
+ linker = "armv7a-linux-androideabi35-clang"
12
+
13
+ [target.x86_64-linux-android]
14
+ linker = "x86_64-linux-android35-clang"
15
+
16
+ [target.i686-linux-android]
17
+ linker = "i686-linux-android35-clang"
@@ -0,0 +1,34 @@
1
+ # Keep the build context small: only files the Dockerfile actually COPYs
2
+ # should reach the daemon. Everything else here either bloats the upload
3
+ # or is a source of unnecessary cache invalidations on edits.
4
+
5
+ # Build artefacts
6
+ target/
7
+ *.tar.gz
8
+
9
+ # IDE / editor / OS noise
10
+ .git/
11
+ .github/
12
+ .idea/
13
+ .vscode/
14
+ .DS_Store
15
+
16
+ # OMC workspace state
17
+ .omc/
18
+ .omx/
19
+ .claude/
20
+
21
+ # Tests never compiled in --release
22
+ tests/
23
+ benches/
24
+ missions/
25
+
26
+ # Docs & specs
27
+ docs/
28
+ specs/
29
+ CHANGELOG.md
30
+ CONTRIBUTING.md
31
+ README.md
32
+ README_RU.md
33
+ CLAUDE.md
34
+ AGENTS.md
@@ -0,0 +1,88 @@
1
+ name: Bug Report
2
+ description: File a bug report to help improve phostt.
3
+ labels: ["bug", "triage"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for taking the time to fill out this bug report.
9
+ Please check the [Troubleshooting section of the README](https://github.com/ekhodzitsky/phostt#troubleshooting) first.
10
+
11
+ - type: input
12
+ id: version
13
+ attributes:
14
+ label: Version
15
+ description: What version of phostt are you running?
16
+ placeholder: "e.g., 0.4.1"
17
+ validations:
18
+ required: true
19
+
20
+ - type: dropdown
21
+ id: platform
22
+ attributes:
23
+ label: Platform
24
+ description: What platform are you running on?
25
+ options:
26
+ - macOS (Apple Silicon)
27
+ - macOS (Intel)
28
+ - Linux (x86_64)
29
+ - Linux (ARM64)
30
+ - Android
31
+ - Windows
32
+ - Other
33
+ validations:
34
+ required: true
35
+
36
+ - type: dropdown
37
+ id: backend
38
+ attributes:
39
+ label: Backend
40
+ description: Which inference backend are you using?
41
+ options:
42
+ - CPU (default)
43
+ - CoreML
44
+ - CUDA
45
+ - Other
46
+ validations:
47
+ required: true
48
+
49
+ - type: textarea
50
+ id: description
51
+ attributes:
52
+ label: Bug description
53
+ description: Describe the bug clearly and concisely.
54
+ validations:
55
+ required: true
56
+
57
+ - type: textarea
58
+ id: reproduce
59
+ attributes:
60
+ label: Steps to reproduce
61
+ description: Provide a minimal set of steps that consistently reproduces the issue.
62
+ placeholder: |
63
+ 1. Run `phostt serve ...`
64
+ 2. Send request `curl ...`
65
+ 3. Observe error ...
66
+ validations:
67
+ required: true
68
+
69
+ - type: textarea
70
+ id: expected
71
+ attributes:
72
+ label: Expected behavior
73
+ description: What did you expect to happen?
74
+ validations:
75
+ required: true
76
+
77
+ - type: textarea
78
+ id: logs
79
+ attributes:
80
+ label: Logs / Output
81
+ description: Paste relevant log output or error messages (redact sensitive info).
82
+ render: text
83
+
84
+ - type: textarea
85
+ id: extra
86
+ attributes:
87
+ label: Additional context
88
+ description: Anything else that might help diagnose the issue (audio file format, model source, etc.).
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Question or Discussion
4
+ url: https://github.com/ekhodzitsky/phostt/discussions
5
+ about: Please use GitHub Discussions for questions, usage help, or general conversation.
@@ -0,0 +1,36 @@
1
+ name: Feature Request
2
+ description: Suggest an idea for phostt.
3
+ labels: ["enhancement", "triage"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for sharing your idea. Please check the [Roadmap](https://github.com/ekhodzitsky/phostt#roadmap) first to see if it is already planned.
9
+
10
+ - type: textarea
11
+ id: problem
12
+ attributes:
13
+ label: Problem / Motivation
14
+ description: What problem are you trying to solve? What is missing?
15
+ validations:
16
+ required: true
17
+
18
+ - type: textarea
19
+ id: solution
20
+ attributes:
21
+ label: Proposed solution
22
+ description: Describe the feature or change you would like to see.
23
+ validations:
24
+ required: true
25
+
26
+ - type: textarea
27
+ id: alternatives
28
+ attributes:
29
+ label: Alternatives considered
30
+ description: Have you considered other approaches or workarounds?
31
+
32
+ - type: textarea
33
+ id: context
34
+ attributes:
35
+ label: Additional context
36
+ description: Any other context, mockups, or references.
@@ -0,0 +1,59 @@
1
+ # SUS-04: weekly Dependabot scan. We pin Rust deps in `Cargo.lock` and
2
+ # several direct deps (`ort = "2.0.0-rc.12"`, `prost = "0.13"`, …) that
3
+ # would otherwise drift silently — Dependabot keeps the supply chain
4
+ # honest by surfacing new RUSTSEC advisories and minor-version bumps as
5
+ # PRs the maintainer can triage on a predictable cadence.
6
+
7
+ version: 2
8
+ updates:
9
+ - package-ecosystem: cargo
10
+ directory: /
11
+ schedule:
12
+ interval: weekly
13
+ day: monday
14
+ time: '05:00'
15
+ timezone: Europe/Moscow
16
+ open-pull-requests-limit: 5
17
+ labels:
18
+ - dependencies
19
+ - rust
20
+ commit-message:
21
+ prefix: deps
22
+ include: scope
23
+ groups:
24
+ # Group tokio ecosystem bumps together so we don't merge tokio
25
+ # 1.49 while tokio-util still expects 1.48 — they release close
26
+ # enough that grouping cuts noise without hiding real churn.
27
+ tokio-ecosystem:
28
+ patterns:
29
+ - 'tokio'
30
+ - 'tokio-*'
31
+ # axum + tower + hyper move together for the same reason.
32
+ axum-ecosystem:
33
+ patterns:
34
+ - 'axum'
35
+ - 'axum-*'
36
+ - 'tower'
37
+ - 'tower-*'
38
+ - 'hyper'
39
+ - 'hyper-*'
40
+ # symphonia-* releases are always co-ordinated (bundle versions).
41
+ symphonia:
42
+ patterns:
43
+ - 'symphonia'
44
+ - 'symphonia-*'
45
+
46
+ - package-ecosystem: github-actions
47
+ directory: /
48
+ schedule:
49
+ interval: weekly
50
+ day: monday
51
+ time: '05:00'
52
+ timezone: Europe/Moscow
53
+ open-pull-requests-limit: 3
54
+ labels:
55
+ - dependencies
56
+ - github-actions
57
+ commit-message:
58
+ prefix: ci
59
+ include: scope
@@ -0,0 +1,86 @@
1
+ name: Benchmark
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ schedule:
7
+ # Run every Sunday at 03:00 UTC
8
+ - cron: '0 3 * * 0'
9
+
10
+ env:
11
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
12
+
13
+ jobs:
14
+ benchmark-macos:
15
+ runs-on: macos-14
16
+ name: Benchmark (macOS)
17
+ permissions:
18
+ contents: write
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+ with:
22
+ token: ${{ secrets.GITHUB_TOKEN }}
23
+
24
+ - uses: dtolnay/rust-toolchain@stable
25
+
26
+ - uses: actions/cache@v5
27
+ with:
28
+ path: |
29
+ ~/.cargo/registry
30
+ ~/.cargo/git
31
+ target
32
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
33
+
34
+ - name: Cache model
35
+ id: cache-model
36
+ uses: actions/cache@v5
37
+ with:
38
+ path: ~/.phostt/models
39
+ key: phostt-model-v3-onnx-${{ hashFiles('src/model/mod.rs') }}
40
+
41
+ - name: Download model
42
+ if: steps.cache-model.outputs.cache-hit != 'true'
43
+ run: cargo run --release -- download
44
+
45
+ - name: Run CPU benchmark
46
+ id: cpu
47
+ run: |
48
+ /usr/bin/time -l cargo test --release --test benchmark_report -- --ignored --nocapture 2>&1 | tee /tmp/cpu_benchmark.txt
49
+
50
+ - name: Run CoreML benchmark
51
+ id: coreml
52
+ run: |
53
+ /usr/bin/time -l cargo test --release --test benchmark_report --features coreml -- --ignored --nocapture 2>&1 | tee /tmp/coreml_benchmark.txt
54
+
55
+ - name: Parse results and update BENCHMARKS.md
56
+ run: |
57
+ COMMIT=$(git rev-parse --short HEAD)
58
+ DATE=$(date -u +%Y-%m-%d)
59
+
60
+ CPU_LATENCY=$(grep "Mean latency" /tmp/cpu_benchmark.txt | sed 's/.*| \([0-9.]*\) ms.*/\1/')
61
+ CPU_RTF=$(grep "RTF" /tmp/cpu_benchmark.txt | sed 's/.*| \([0-9.]*\)×.*/\1/')
62
+ CPU_RSS=$(grep "maximum resident set size" /tmp/cpu_benchmark.txt | awk '{print $1}')
63
+ CPU_RSS_MB=$(echo "scale=1; $CPU_RSS / 1024 / 1024" | bc)
64
+
65
+ COREML_LATENCY=$(grep "Mean latency" /tmp/coreml_benchmark.txt | sed 's/.*| \([0-9.]*\) ms.*/\1/')
66
+ COREML_RTF=$(grep "RTF" /tmp/coreml_benchmark.txt | sed 's/.*| \([0-9.]*\)×.*/\1/')
67
+ COREML_RSS=$(grep "maximum resident set size" /tmp/coreml_benchmark.txt | awk '{print $1}')
68
+ COREML_RSS_MB=$(echo "scale=1; $COREML_RSS / 1024 / 1024" | bc)
69
+
70
+ {
71
+ echo ""
72
+ echo "## ${DATE} (commit ${COMMIT})"
73
+ echo ""
74
+ echo "### macOS-14 (Apple Silicon)"
75
+ echo ""
76
+ echo "| Backend | Mean Latency | RTF | Peak RSS |"
77
+ echo "|---|---|---|---|"
78
+ echo "| CPU | ${CPU_LATENCY} ms | ${CPU_RTF} | ${CPU_RSS_MB} MB |"
79
+ echo "| CoreML | ${COREML_LATENCY} ms | ${COREML_RTF} | ${COREML_RSS_MB} MB |"
80
+ } >> BENCHMARKS.md
81
+
82
+ - name: Commit benchmark results
83
+ uses: stefanzweifel/git-auto-commit-action@v5
84
+ with:
85
+ commit_message: "benchmark: auto-update BENCHMARKS.md [skip ci]"
86
+ file_pattern: BENCHMARKS.md
@@ -0,0 +1,65 @@
1
+ name: Check ort stable release
2
+
3
+ on:
4
+ schedule:
5
+ # Every Monday at 09:00 UTC
6
+ - cron: '0 9 * * 1'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ issues: write
11
+
12
+ jobs:
13
+ check-ort:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+
18
+ - name: Check crates.io for ort stable
19
+ id: check
20
+ run: |
21
+ LATEST=$(curl -s https://crates.io/api/v1/crates/ort | jq -r '.crate.max_version')
22
+ echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
23
+
24
+ CURRENT=$(grep -E '^ort\s*=' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
25
+ echo "current=$CURRENT" >> "$GITHUB_OUTPUT"
26
+
27
+ # Detect if latest is a stable 2.0.0+ release (no rc/beta/alpha/pre)
28
+ if echo "$LATEST" | grep -qiE '(rc|beta|alpha|pre|dev)'; then
29
+ echo "stable=false" >> "$GITHUB_OUTPUT"
30
+ echo "ort $LATEST is still pre-release (current: $CURRENT)"
31
+ else
32
+ echo "stable=true" >> "$GITHUB_OUTPUT"
33
+ echo "ort $LATEST looks stable (current: $CURRENT)"
34
+ fi
35
+
36
+ - name: Open issue if stable ort is available
37
+ if: steps.check.outputs.stable == 'true' && steps.check.outputs.latest != steps.check.outputs.current
38
+ env:
39
+ GH_TOKEN: ${{ github.token }}
40
+ run: |
41
+ LATEST="${{ steps.check.outputs.latest }}"
42
+ CURRENT="${{ steps.check.outputs.current }}"
43
+
44
+ # Check if an open issue already exists
45
+ EXISTING=$(gh issue list --repo "${{ github.repository }}" \
46
+ --search "ort stable $LATEST" --state open --json number | jq length)
47
+
48
+ if [ "$EXISTING" -gt 0 ]; then
49
+ echo "Issue already exists for ort $LATEST"
50
+ exit 0
51
+ fi
52
+
53
+ gh issue create \
54
+ --repo "${{ github.repository }}" \
55
+ --title "deps: ort $LATEST stable is available (current: $CURRENT)" \
56
+ --body "crates.io now has \`ort $LATEST\` which appears to be a stable (non-pre-release) version.
57
+
58
+ Current pin: \`$CURRENT\`
59
+
60
+ **Migration notes:**
61
+ - Check [pykeio/ort CHANGELOG](https://github.com/pykeio/ort/releases/tag/v$LATEST) for breaking changes.
62
+ - Update \`Cargo.toml\` and run full test suite (unit + E2E + benchmark).
63
+ - Verify CoreML and CUDA feature builds still pass.
64
+
65
+ This issue was auto-generated by the [check-ort-stable workflow](.github/workflows/check-ort-stable.yml)."
@@ -0,0 +1,218 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ env:
10
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
11
+
12
+ jobs:
13
+ fmt:
14
+ runs-on: ubuntu-latest
15
+ name: Format
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+ - uses: dtolnay/rust-toolchain@stable
19
+ with:
20
+ components: rustfmt
21
+ - run: cargo fmt --check
22
+
23
+ clippy:
24
+ runs-on: ubuntu-latest
25
+ name: Clippy
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ - uses: dtolnay/rust-toolchain@stable
29
+ with:
30
+ components: clippy
31
+ - uses: actions/cache@v5
32
+ with:
33
+ path: |
34
+ ~/.cargo/registry
35
+ ~/.cargo/git
36
+ target
37
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
38
+ - run: cargo clippy -- -D warnings -A dead_code
39
+
40
+ unit-tests:
41
+ runs-on: ubuntu-latest
42
+ name: Unit Tests
43
+ steps:
44
+ - uses: actions/checkout@v6
45
+ - uses: dtolnay/rust-toolchain@stable
46
+ - uses: actions/cache@v5
47
+ with:
48
+ path: |
49
+ ~/.cargo/registry
50
+ ~/.cargo/git
51
+ target
52
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
53
+ - run: cargo test
54
+
55
+ build-coreml:
56
+ runs-on: macos-14
57
+ name: Build (CoreML)
58
+ steps:
59
+ - uses: actions/checkout@v6
60
+ - uses: dtolnay/rust-toolchain@stable
61
+ - uses: actions/cache@v5
62
+ with:
63
+ path: |
64
+ ~/.cargo/registry
65
+ ~/.cargo/git
66
+ target
67
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68
+ - run: cargo build --release --features coreml
69
+
70
+ build-cuda:
71
+ runs-on: ubuntu-latest
72
+ name: Build (CUDA)
73
+ steps:
74
+ - uses: actions/checkout@v6
75
+ - uses: dtolnay/rust-toolchain@stable
76
+ - uses: actions/cache@v5
77
+ with:
78
+ path: |
79
+ ~/.cargo/registry
80
+ ~/.cargo/git
81
+ target
82
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
83
+ - run: cargo build --release --features cuda
84
+
85
+ build-diarization:
86
+ runs-on: ubuntu-latest
87
+ name: Build (Diarization)
88
+ steps:
89
+ - uses: actions/checkout@v6
90
+ - uses: dtolnay/rust-toolchain@stable
91
+ - uses: actions/cache@v5
92
+ with:
93
+ path: |
94
+ ~/.cargo/registry
95
+ ~/.cargo/git
96
+ target
97
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
98
+ - run: cargo build --release --features diarization
99
+
100
+ build-arm-linux:
101
+ runs-on: ubuntu-latest
102
+ name: Build (ARM Linux)
103
+ steps:
104
+ - uses: actions/checkout@v6
105
+ - uses: dtolnay/rust-toolchain@stable
106
+ with:
107
+ targets: aarch64-unknown-linux-gnu
108
+ - uses: actions/cache@v5
109
+ with:
110
+ path: |
111
+ ~/.cargo/registry
112
+ ~/.cargo/git
113
+ target
114
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
115
+ - name: Install cross-compiler
116
+ run: |
117
+ sudo apt-get update
118
+ sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross
119
+ echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
120
+ echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_AR=aarch64-linux-gnu-ar" >> "$GITHUB_ENV"
121
+ - run: cargo check --target aarch64-unknown-linux-gnu --release
122
+
123
+ e2e-tests:
124
+ # Only run on main push — PRs get fast feedback from unit tests + clippy
125
+ if: github.ref == 'refs/heads/master' && github.event_name == 'push'
126
+ runs-on: ubuntu-latest
127
+ name: E2E Tests
128
+ steps:
129
+ - uses: actions/checkout@v6
130
+ - uses: dtolnay/rust-toolchain@stable
131
+ - uses: actions/cache@v5
132
+ with:
133
+ path: |
134
+ ~/.cargo/registry
135
+ ~/.cargo/git
136
+ target
137
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
138
+
139
+ - name: Cache model
140
+ id: cache-model
141
+ uses: actions/cache@v5
142
+ with:
143
+ path: ~/.phostt/models
144
+ key: phostt-model-v3-onnx-${{ hashFiles('src/model/mod.rs') }}
145
+
146
+ - name: Download model
147
+ if: steps.cache-model.outputs.cache-hit != 'true'
148
+ run: cargo run -- download
149
+
150
+ - name: Run e2e tests
151
+ run: cargo test --test e2e_rest --test e2e_ws --test e2e_errors --test e2e_shutdown -- --ignored --test-threads=1
152
+ timeout-minutes: 30
153
+
154
+ - name: Run quality tests (bundled Vietnamese WAVs)
155
+ run: cargo test --test wer -- --ignored
156
+ timeout-minutes: 10
157
+
158
+ - name: Run load tests
159
+ run: cargo test --test load_test -- --ignored --test-threads=1
160
+ timeout-minutes: 10
161
+
162
+ e2e-pr:
163
+ if: github.event_name == 'pull_request'
164
+ runs-on: ubuntu-latest
165
+ name: E2E Tests (PR)
166
+ steps:
167
+ - uses: actions/checkout@v6
168
+ - uses: dtolnay/rust-toolchain@stable
169
+ - uses: actions/cache@v5
170
+ with:
171
+ path: |
172
+ ~/.cargo/registry
173
+ ~/.cargo/git
174
+ target
175
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
176
+
177
+ - name: Cache model
178
+ id: cache-model
179
+ uses: actions/cache@v5
180
+ with:
181
+ path: ~/.phostt/models
182
+ key: phostt-model-v3-onnx-${{ hashFiles('src/model/mod.rs') }}
183
+
184
+ - name: Download model
185
+ if: steps.cache-model.outputs.cache-hit != 'true'
186
+ run: cargo run -- download
187
+
188
+ - name: Run e2e tests
189
+ run: cargo test --test e2e_rest --test e2e_ws --test e2e_errors --test e2e_shutdown -- --ignored --test-threads=1
190
+ timeout-minutes: 30
191
+
192
+ - name: Run quality tests (bundled Vietnamese WAVs)
193
+ run: cargo test --test wer -- --ignored
194
+ timeout-minutes: 10
195
+
196
+ audit:
197
+ runs-on: ubuntu-latest
198
+ name: Security Audit
199
+ steps:
200
+ - uses: actions/checkout@v6
201
+ # `rustsec/audit-check` ships a prebuilt cargo-audit, saving the ~90 s
202
+ # `cargo install --locked` rebuild on every PR run.
203
+ - uses: rustsec/audit-check@v2
204
+ with:
205
+ token: ${{ secrets.GITHUB_TOKEN }}
206
+
207
+ deny:
208
+ runs-on: ubuntu-latest
209
+ name: Cargo Deny
210
+ steps:
211
+ - uses: actions/checkout@v6
212
+ - uses: EmbarkStudios/cargo-deny-action@v2
213
+ with:
214
+ # Default `check` covers licenses + advisories + bans + sources.
215
+ # An earlier attempt passed them as `arguments: licenses advisories …`,
216
+ # but the stable-musl `cargo-deny` refused the trailing positional
217
+ # args as subcommands (`unrecognized subcommand 'licenses'`).
218
+ command: check
@@ -0,0 +1,22 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ docs:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: write
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: dtolnay/rust-toolchain@stable
15
+ - run: cargo doc --no-deps --document-private-items
16
+ - name: Add index redirect
17
+ run: echo '<meta http-equiv="refresh" content="0;url=phostt/index.html">' > target/doc/index.html
18
+ - name: Deploy to GitHub Pages
19
+ uses: peaceiris/actions-gh-pages@v4
20
+ with:
21
+ github_token: ${{ secrets.GITHUB_TOKEN }}
22
+ publish_dir: ./target/doc