-
-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (108 loc) · 4.96 KB
/
Copy pathengine.yml
File metadata and controls
119 lines (108 loc) · 4.96 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
# AudioBud transcription engine build. This is the only place outside the
# signed release where the real TranscriptionManager compiles.
#
# The two Rust jobs in ci.yml overwrite src/managers/transcription.rs with a
# 130-line mock and delete transcribe-rs from Cargo.toml so cargo test does not
# have to build whisper, Vulkan, and ONNX on every push. That keeps the fast
# checks fast, but it also means the 957 lines that actually do the work are
# never compiled by CI -- release.yml was the first build that touched them,
# and it runs no tests. A regression in the core product could reach a signed
# installer without any automated check having seen it (issue #146).
#
# So this workflow builds what ships: real transcription.rs, real transcribe-rs,
# the same whisper-vulkan + ort-directml features and the same GGML flags the
# release uses. It is slow, so it runs only when Rust or its build inputs
# change.
name: Engine
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "src-tauri/**"
- ".github/workflows/engine.yml"
pull_request:
paths:
- "src-tauri/**"
- ".github/workflows/engine.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MODEL_ASSET_BASE_URL: https://github.com/jamditis/audiobud/releases/download/model-assets-v1
SILERO_VAD_BYTES: 1807522
SILERO_VAD_SHA256: a35ebf52fd3ce5f1469b2a36158dba761bc47b973ea3382b3186ca15b1f5af28
jobs:
real-engine:
name: Rust tests (real transcription engine, Windows)
# Windows is the platform AudioBud ships, and the only one whose feature set
# (whisper-vulkan + ort-directml) is exercised by a real user. Building the
# engine anywhere else would prove less than it appears to.
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
# Deliberately no mock swap and no `sed -i '/^transcribe-rs/d'`. The whole
# point of this job is that src/managers/transcription.rs reaches the
# compiler unmodified.
# The Windows build links whisper-vulkan. The SDK provides glslc and the
# Vulkan headers and libraries the native build needs. Pinned to the same
# commit and version as release.yml so this job cannot pass against an SDK
# the release build never sees.
- name: Install Vulkan SDK
uses: humbletim/install-vulkan-sdk@30ba978f977e81b72d091fc8888feb1fb26f9aff # v1.2
with:
version: 1.4.309.0
cache: true
- name: Download the VAD model
working-directory: src-tauri
shell: bash
run: |
# silero_vad_loads_from_unicode_directory fails when the model is
# absent rather than skipping, so keep this ahead of cargo test.
mkdir -p resources/models
model="resources/models/silero_vad_v4.onnx"
curl --fail --location --retry 3 -o "$model" "$MODEL_ASSET_BASE_URL/silero_vad_v4.onnx"
test "$(wc -c < "$model")" -eq "$SILERO_VAD_BYTES"
echo "$SILERO_VAD_SHA256 $model" | sha256sum -c -
# whisper-rs-sys drives cmake, which builds paths deep enough to cross
# MAX_PATH under the default target directory. release.yml solves this the
# same way; without it the native build fails with unhelpful cmake errors.
- name: Shorten build path
shell: pwsh
run: |
$drive = Split-Path -Qualifier $env:GITHUB_WORKSPACE
$targetDirectory = "$drive\t"
New-Item -ItemType Directory -Force -Path $targetDirectory | Out-Null
"CARGO_TARGET_DIR=$targetDirectory" |
Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
# No rust-cache here. It keys on a workspace-relative target directory, so
# pointing it at the shortened absolute path above would cache an empty
# directory and report a hit that saved nothing -- which is what happens
# in release.yml today. A cold build is honest; a cache that silently does
# nothing is worse than none. Speeding this up is follow-up work.
# Match the release build's SIMD posture so this job fails on the same
# code the release compiles, not a more permissive variant.
- name: Run Rust tests against the real engine
working-directory: src-tauri
shell: pwsh
env:
GGML_NATIVE: "OFF"
GGML_AVX: "OFF"
GGML_AVX2: "OFF"
GGML_FMA: "OFF"
GGML_F16C: "OFF"
run: cargo test
# Keep the warning budget at zero against the same real engine and
# Windows-only code that ships. Running after cargo test reuses the
# native build products instead of paying for a second cold compile.
- name: Run Clippy against the real engine
working-directory: src-tauri
shell: pwsh
env:
GGML_NATIVE: "OFF"
GGML_AVX: "OFF"
GGML_AVX2: "OFF"
GGML_FMA: "OFF"
GGML_F16C: "OFF"
run: cargo clippy --lib --tests -- -D warnings