-
Notifications
You must be signed in to change notification settings - Fork 445
247 lines (205 loc) · 6.39 KB
/
run-java-test.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
name: run-java-test
on:
push:
branches:
- master
paths:
- '.github/workflows/run-java-test.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'java-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/jni/*'
- 'sherpa-onnx/java-api/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/run-java-test.yaml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'java-api-examples/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/jni/*'
- 'sherpa-onnx/java-api/**'
workflow_dispatch:
concurrency:
group: run-java-test-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
run_java_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-java
- name: OS info
shell: bash
run: |
uname -a
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
- name: Display java version
shell: bash
run: |
java -version
java -help
echo "----"
javac -version
javac -help
echo "JAVA_HOME is: ${JAVA_HOME}"
cmake --version
- name: Build sherpa-onnx (jar)
shell: bash
run: |
cd sherpa-onnx/java-api/
make
ls -lh
- uses: actions/upload-artifact@v4
with:
name: sherpa-onnx-jar-${{ matrix.os }}
path: sherpa-onnx/java-api/build
- name: Build sherpa-onnx (C++)
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
mkdir build
cd build
cmake \
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
-DBUILD_SHARED_LIBS=ON \
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
-DBUILD_ESPEAK_NG_EXE=OFF \
-DSHERPA_ONNX_ENABLE_JNI=ON \
..
make -j4
ls -lh lib
- name: Run java test (speaker diarization)
shell: bash
run: |
cd ./java-api-examples
./run-offline-speaker-diarization.sh
rm -rfv *.onnx *.wav sherpa-onnx-pyannote-*
- name: Run java test (kws)
shell: bash
run: |
cd ./java-api-examples
./run-kws-from-file.sh
rm -rf sherpa-onnx-*
- name: Run java test (VAD + Non-streaming SenseVoice)
shell: bash
run: |
cd ./java-api-examples
./run-vad-non-streaming-sense-voice.sh
rm *.onnx
ls -lh *.wav
rm *.wav
rm -rf sherpa-onnx-*
- name: Run java test (VAD + Non-streaming Paraformer)
shell: bash
run: |
cd ./java-api-examples
./run-vad-non-streaming-paraformer.sh
rm *.onnx
ls -lh *.wav
rm *.wav
rm -rf sherpa-onnx-*
- name: Run java test (VAD remove silence)
shell: bash
run: |
cd ./java-api-examples
./run-vad-remove-slience.sh
rm *.onnx
ls -lh *.wav
rm *.wav
- name: Run java test (speaker identification)
shell: bash
run: |
cd ./java-api-examples
./run-speaker-identification.sh
# Delete model files to save space
rm -rf *.onnx
rm -rf sr-data
- name: Run java test (audio tagging)
shell: bash
run: |
cd ./java-api-examples
./run-audio-tagging-zipformer-from-file.sh
# Delete model files to save space
rm -rf sherpa-onnx-zipformer-*
./run-audio-tagging-ced-from-file.sh
rm -rf sherpa-onnx-ced-*
- name: Run java test (add punctuations)
shell: bash
run: |
cd ./java-api-examples
./run-add-punctuation-zh-en.sh
# Delete model files to save space
rm -rf sherpa-onnx-punct-*
- name: Run java test (Spoken language identification)
shell: bash
run: |
cd ./java-api-examples
./run-spoken-language-identification-whisper.sh
# Delete model files to save space
rm -rf sherpa-onnx-whisper-*
- name: Run java test (Streaming ASR)
shell: bash
run: |
cd ./java-api-examples
./run-inverse-text-normalization-transducer.sh
rm -rf sherpa-onnx-streaming-*
./run-streaming-decode-file-ctc.sh
# Delete model files to save space
rm -rf sherpa-onnx-streaming-*
./run-streaming-decode-file-ctc-hlg.sh
rm -rf sherpa-onnx-streaming-*
./run-streaming-decode-file-paraformer.sh
rm -rf sherpa-onnx-streaming-*
./run-streaming-decode-file-transducer.sh
rm -rf sherpa-onnx-streaming-*
- name: Run java test (Non-Streaming ASR)
shell: bash
run: |
cd ./java-api-examples
./run-non-streaming-decode-file-sense-voice.sh
rm -rf sherpa-onnx-sense-voice-*
./run-inverse-text-normalization-paraformer.sh
./run-non-streaming-decode-file-paraformer.sh
rm -rf sherpa-onnx-paraformer-zh-*
./run-non-streaming-decode-file-transducer.sh
rm -rf sherpa-onnx-zipformer-*
./run-non-streaming-decode-file-whisper.sh
rm -rf sherpa-onnx-whisper-*
./run-non-streaming-decode-file-nemo.sh
rm -rf sherpa-onnx-nemo-*
- name: Run java test (Non-Streaming TTS)
shell: bash
run: |
cd ./java-api-examples
./run-non-streaming-tts-piper-en.sh
rm -rf vits-piper-*
./run-non-streaming-tts-coqui-de.sh
rm -rf vits-coqui-*
./run-non-streaming-tts-vits-zh.sh
rm -rf vits-zh-*
- uses: actions/upload-artifact@v4
with:
name: tts-wav-files-${{ matrix.os }}
path: java-api-examples/*.wav