-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (128 loc) · 4.93 KB
/
plugins.yml
File metadata and controls
145 lines (128 loc) · 4.93 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
# 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"
jobs:
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"
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 }}
# --- 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.92.0"
components: rustfmt, clippy
- uses: mozilla-actions/sccache-action@v0.0.9
- 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
# --- 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