forked from streamer45/streamkit
-
Notifications
You must be signed in to change notification settings - Fork 0
243 lines (215 loc) · 9.29 KB
/
Copy pathplugins.yml
File metadata and controls
243 lines (215 loc) · 9.29 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
# SPDX-FileCopyrightText: © 2025 StreamKit Contributors
#
# SPDX-License-Identifier: MPL-2.0
name: Plugins CI
on:
workflow_call:
# Allow standalone runs for debugging plugin builds without a full CI cycle.
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTC_WRAPPER: sccache
SHERPA_ONNX_VERSION: "1.12.17"
ONNXRUNTIME_VERSION: "1.22.0"
jobs:
registry-check:
name: Registry Version Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- name: Install Python dependencies
run: pip install pyyaml
- name: Verify official plugins metadata is current
run: |
python3 scripts/marketplace/generate_official_plugins.py
git diff --exit-code -- marketplace/official-plugins.json
- name: Check plugin versions against committed registry
run: python3 scripts/marketplace/check_registry_versions.py
lint:
name: Lint (${{ matrix.group }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
# Plugins with no heavy native dependencies
- group: simple
plugins: "slint supertonic whisper helsinki pocket-tts aac-encoder"
apt_extra: "libfontconfig1-dev libfdk-aac-dev"
# Plugins that link against sherpa-onnx
- group: sherpa
plugins: "vad kokoro piper matcha sensevoice parakeet"
apt_extra: "wget"
# NLLB requires CTranslate2
- group: nllb
plugins: "nllb"
apt_extra: "libopenblas-dev"
# Servo embeds a full browser engine with heavy system deps
- group: servo
plugins: "servo"
apt_extra: >-
build-essential g++
libfontconfig1-dev libharfbuzz-dev libfreetype6-dev
libegl1-mesa-dev libgl1-mesa-dev libgbm-dev libdrm-dev
libunwind-dev
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
libdbus-1-dev libpulse-dev libxkbcommon-dev
nasm
steps:
- uses: actions/checkout@v5
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake pkg-config libclang-dev ${{ matrix.apt_extra }}
# --- ONNX Runtime (ort-dependent plugins: whisper, sensevoice, parakeet) ---
# Download from Microsoft's official GitHub releases instead of relying on
# the pyke.io CDN used by the ort-sys build script, which is intermittently
# unreliable (see https://github.com/pykeio/ort/issues/395).
- name: Cache ONNX Runtime
if: matrix.group == 'simple' || matrix.group == 'sherpa'
id: cache-ort
uses: actions/cache@v4
with:
path: /tmp/onnxruntime
key: onnxruntime-${{ env.ONNXRUNTIME_VERSION }}-linux-x64
- name: Download ONNX Runtime
if: (matrix.group == 'simple' || matrix.group == 'sherpa') && steps.cache-ort.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/onnxruntime
curl -sSL "https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz" \
| tar xz -C /tmp/onnxruntime --strip-components=1
- name: Configure ONNX Runtime paths
if: matrix.group == 'simple' || matrix.group == 'sherpa'
run: |
echo "ORT_LIB_LOCATION=/tmp/onnxruntime" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=/tmp/onnxruntime/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
# --- sherpa-onnx (sherpa group only) ---
- name: Cache sherpa-onnx
if: matrix.group == 'sherpa'
id: cache-sherpa
uses: actions/cache@v4
with:
path: |
/usr/local/lib/libsherpa*
/usr/local/include/sherpa-onnx
key: sherpa-onnx-v2-${{ env.SHERPA_ONNX_VERSION }}-${{ runner.os }}
- name: Install sherpa-onnx
if: matrix.group == 'sherpa' && steps.cache-sherpa.outputs.cache-hit != 'true'
run: |
cd /tmp
wget https://github.com/k2-fsa/sherpa-onnx/releases/download/v${SHERPA_ONNX_VERSION}/sherpa-onnx-v${SHERPA_ONNX_VERSION}-linux-x64-shared.tar.bz2
tar xf sherpa-onnx-v${SHERPA_ONNX_VERSION}-linux-x64-shared.tar.bz2
sudo cp -r sherpa-onnx-v${SHERPA_ONNX_VERSION}-linux-x64-shared/lib/* /usr/local/lib/
sudo cp -r sherpa-onnx-v${SHERPA_ONNX_VERSION}-linux-x64-shared/include/* /usr/local/include/
sudo ldconfig
- name: Refresh linker cache (sherpa-onnx from cache)
if: matrix.group == 'sherpa' && steps.cache-sherpa.outputs.cache-hit == 'true'
run: sudo ldconfig
# --- CTranslate2 (nllb group only) ---
- name: Cache CTranslate2
if: matrix.group == 'nllb'
id: cache-ct2
uses: actions/cache@v4
with:
path: |
/usr/local/lib/libctranslate2*
/usr/local/include/ctranslate2
key: ctranslate2-v2-4.5.0-openmp-comp-${{ runner.os }}
- name: Build CTranslate2
if: matrix.group == 'nllb' && steps.cache-ct2.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --recurse-submodules --branch v4.5.0 https://github.com/OpenNMT/CTranslate2.git
cd CTranslate2
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DWITH_CUDA=OFF \
-DWITH_MKL=OFF \
-DWITH_OPENBLAS=ON \
-DOPENMP_RUNTIME=COMP \
-DBUILD_CLI=OFF \
..
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Refresh linker cache (CTranslate2 from cache)
if: matrix.group == 'nllb' && steps.cache-ct2.outputs.cache-hit == 'true'
run: sudo ldconfig
# --- Rust toolchain & caches ---
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
components: rustfmt, clippy
- name: Restore sccache cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/sccache
key: sccache-plugins-lint-${{ runner.os }}-${{ hashFiles('plugins/**/Cargo.lock') }}
restore-keys: |
sccache-plugins-lint-${{ runner.os }}-
- uses: mozilla-actions/[email protected]
- name: Build workspace list for cache
id: cache-ws
run: |
{
echo "list<<EOF"
for plugin in ${{ matrix.plugins }}; do
echo "plugins/native/${plugin} -> ../../../target/plugins"
done
echo "EOF"
} >> "$GITHUB_OUTPUT"
- uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ steps.cache-ws.outputs.list }}
cache-on-failure: true
# --- Servo clang + bindgen (servo group only) ---
# mozangle requires clang >= 15 for SSE/AVX intrinsic builtins;
# ubuntu-22.04 ships clang-14 by default which is too old.
- name: Install LLVM 18 and configure bindgen
if: matrix.group == 'servo'
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm.asc > /dev/null
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | sudo tee /etc/apt/sources.list.d/llvm-18.list
sudo apt-get update -qq
sudo apt-get install -y -qq clang-18 libclang-18-dev
echo "CC=clang-18" >> "$GITHUB_ENV"
echo "CXX=clang++-18" >> "$GITHUB_ENV"
echo "CLANG_PATH=/usr/bin/clang-18" >> "$GITHUB_ENV"
echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib/" >> "$GITHUB_ENV"
gcc_ver=$(ls /usr/include/c++/ 2>/dev/null | sort -V | tail -1 || true)
if [ -n "$gcc_ver" ]; then
echo "BINDGEN_EXTRA_CLANG_ARGS=-I/usr/include/c++/${gcc_ver} -I/usr/include/x86_64-linux-gnu/c++/${gcc_ver}" >> "$GITHUB_ENV"
fi
# --- Lint ---
- name: Format check
run: |
for plugin in ${{ matrix.plugins }}; do
echo "::group::fmt — ${plugin}"
(cd "plugins/native/${plugin}" && cargo fmt -- --check)
echo "::endgroup::"
done
- name: Clippy
run: |
for plugin in ${{ matrix.plugins }}; do
echo "::group::clippy — ${plugin}"
# Shared target dir deduplicates common crate compilation across plugins in the group.
# If flaky clippy results appear, conflicting feature flags between plugins could be the cause.
(cd "plugins/native/${plugin}" && CARGO_TARGET_DIR="${{ github.workspace }}/target/plugins" cargo clippy -- -D warnings)
echo "::endgroup::"
done
# --- Test ---
- name: Test
run: |
for plugin in ${{ matrix.plugins }}; do
echo "::group::test — ${plugin}"
(cd "plugins/native/${plugin}" && CARGO_TARGET_DIR="${{ github.workspace }}/target/plugins" cargo test)
echo "::endgroup::"
done
- name: Save sccache cache
if: always() && github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: ~/.cache/sccache
key: sccache-plugins-lint-${{ runner.os }}-${{ hashFiles('plugins/**/Cargo.lock') }}