-
Notifications
You must be signed in to change notification settings - Fork 424
256 lines (211 loc) · 7.16 KB
/
test-go.yaml
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
name: test-go
on:
push:
branches:
- master
paths:
- '.github/workflows/test-go.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'go-api-examples/**'
- 'scripts/go/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/test-go.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'go-api-examples/**'
- 'scripts/go/**'
workflow_dispatch:
concurrency:
group: test-go-${{ github.ref }}
cancel-in-progress: true
jobs:
test-go:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-13, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-go
- uses: actions/setup-go@v5
with:
go-version: '>=1.12'
- name: Display go version
shell: bash
run: |
go version
go env GOPATH
go env GOARCH
go env CGO_ENABLED
- name: Display go env
shell: bash
run: |
go env
- name: Build sherpa-onnx
shell: bash
run: |
upload_dir=$PWD/to-upload
mkdir -p $upload_dir
echo "upload_dir"
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_SHARED_LIBS=ON \
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
-DCMAKE_INSTALL_PREFIX=./install \
..
if [[ ${{ matrix.os }} == windows-latest ]]; then
cmake --build . --target install --config Release -- -m:2
else
make -j2 install
fi
if [[ ${{ matrix.os }} == ubuntu-latest ]]; then
cp -v ./lib/*.so $upload_dir
cp -v _deps/onnxruntime-src/lib/libonnxruntime*so* $upload_dir
cp -v _deps/onnxruntime-src/lib/libonnxruntime*so* ./lib/
rm -v ./lib/*.a
ls -h ./lib
elif [[ ${{ matrix.os }} == windows-latest ]]; then
cp -v ./install/lib/sherpa-onnx-c-api.dll ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/
cp -v ./install/lib/onnxruntime.dll ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/
ls -lh ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll ../scripts/go/_internal/speaker-identification/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll ../scripts/go/_internal/streaming-hlg-decoding/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll ../scripts/go/_internal/non-streaming-tts/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll ../scripts/go/_internal/non-streaming-decode-files/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll ../scripts/go/_internal/streaming-decode-files/
cp -v ../scripts/go/_internal/lib/x86_64-pc-windows-gnu/*.dll $upload_dir
else
cp -v _deps/onnxruntime-src/lib/libonnxruntime*dylib $upload_dir/
cp -v lib/*.dylib $upload_dir
cp -v _deps/onnxruntime-src/lib/libonnxruntime*dylib ./lib/
rm ./lib/*.a
rm ./lib/libonnxruntime.dylib
cd lib
ln -s libonnxruntime.1.17.1.dylib libonnxruntime.dylib
cd ..
fi
cd ../scripts/go/_internal/
ls -lh lib
echo "-----"
ls -lh lib/*/
echo "-----"
go mod tidy
go build
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-libs
path: to-upload/
- name: Test non-streaming speaker diarization
shell: bash
run: |
cd scripts/go/_internal/non-streaming-speaker-diarization/
./run.sh
- name: Test speaker identification
shell: bash
run: |
cd scripts/go/_internal/speaker-identification/
./run.sh
- name: Test streaming HLG decoding
shell: bash
run: |
cd scripts/go/_internal/streaming-hlg-decoding/
./run.sh
- name: Test non-streaming TTS
shell: bash
run: |
mkdir tts-waves
cd scripts/go/_internal/non-streaming-tts/
ls -lh
go mod tidy
cat go.mod
go build
ls -lh
echo "Test vits-ljs"
./run-vits-ljs.sh
rm -rf vits-ljs
echo "Test vits-vctk"
./run-vits-vctk.sh
rm -rf vits-vctk
echo "Test vits-zh-aishell3"
./run-vits-zh-aishell3.sh
rm -rf vits-icefall-zh-aishell3
echo "Test vits-piper-en_US-lessac-medium"
./run-vits-piper-en_US-lessac-medium.sh
rm -rf vits-piper-en_US-lessac-medium
cp *.wav ../../../../tts-waves/
- uses: actions/upload-artifact@v4
with:
name: tts-waves-${{ matrix.os }}
path: tts-waves
- name: Test non-streaming decoding files
shell: bash
run: |
cd scripts/go/_internal/non-streaming-decode-files/
ls -lh
go mod tidy
cat go.mod
go build
ls -lh
echo "Test SenseVoice ctc"
./run-sense-voice-small.sh
rm -rf sherpa-onnx-sense-*
echo "Test telespeech ctc"
./run-telespeech-ctc.sh
rm -rf sherpa-onnx-telespeech-ctc-*
echo "Test transducer"
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test transducer"
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test paraformer"
./run-paraformer.sh
./run-paraformer-itn.sh
rm -rf sherpa-onnx-paraformer-zh-2023-09-14
echo "Test NeMo CTC"
./run-nemo-ctc.sh
rm -rf sherpa-onnx-nemo-ctc-en-conformer-medium
echo "Test Whisper tiny.en"
./run-whisper.sh
rm -rf sherpa-onnx-whisper-tiny.en
echo "Test Tdnn yesno"
./run-tdnn-yesno.sh
rm -rf sherpa-onnx-tdnn-yesno
- name: Test streaming decoding files
shell: bash
run: |
cd scripts/go/_internal/streaming-decode-files
ls -lh
go mod tidy
cat go.mod
go build
ls -lh
echo "Test zipformer2 CTC"
./run-zipformer2-ctc.sh
rm -rf sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13
echo "Test transducer"
./run-transducer.sh
rm -rf sherpa-onnx-streaming-zipformer-en-2023-06-26
./run-transducer-itn.sh
rm -rf sherpa-onnx-streaming-*
echo "Test paraformer"
./run-paraformer.sh
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en