|
| 1 | +name: test-onnxruntime-version |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - test-onnxruntime |
| 8 | + tags: |
| 9 | + - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 10 | + |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: test-onnxrntime-version-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + macos: |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + name: onnxruntime ${{ matrix.version }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + os: [macos-latest] |
| 25 | + version: ["1.11.0", "1.11.1", "1.12.0", "1.12.1", "1.13.1", "1.14.0", "1.14.1", "1.15.0", "1.15.1", "1.16.1", "1.16.2", "1.17.0", "1.17.1", "1.17.3", "1.18.0", "1.18.1", "1.19.0", "1.19.2", "1.20.0", "1.20.1", "1.20.2", "1.21.0", "1.21.1", "1.22.0", "1.22.1", "1.22.2", "1.23.0", "1.23.1", "1.23.2"] |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Update version |
| 33 | + shell: bash |
| 34 | + run: | |
| 35 | + ./new-release.sh |
| 36 | + git diff . |
| 37 | +
|
| 38 | + - name: ccache |
| 39 | + uses: hendrikmuhs/ccache-action@v1.2 |
| 40 | + with: |
| 41 | + key: ${{ matrix.os }}-onnxruntime-${{ matrix.version }} |
| 42 | + |
| 43 | + - name: Download onnxruntime ${{ matrix.version }} |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + version=${{ matrix.version }} |
| 47 | + curl -SL -O https://github.com/microsoft/onnxruntime/releases/download/v${version}/onnxruntime-osx-universal2-${version}.tgz |
| 48 | + tar xvf onnxruntime-osx-universal2-${version}.tgz |
| 49 | + ls -lh onnxruntime-osx-universal2-${version} |
| 50 | +
|
| 51 | + ls -lh onnxruntime-osx-universal2-${version} |
| 52 | + echo "---" |
| 53 | + ls -lh onnxruntime-osx-universal2-${version}/include |
| 54 | + echo "---" |
| 55 | + ls -lh onnxruntime-osx-universal2-${version}/lib |
| 56 | +
|
| 57 | + - name: Configure CMake |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + version=${{ matrix.version }} |
| 61 | + onnxruntime_dir=$PWD/onnxruntime-osx-universal2-${version} |
| 62 | + export SHERPA_ONNXRUNTIME_LIB_DIR=$onnxruntime_dir/lib/ |
| 63 | + export SHERPA_ONNXRUNTIME_INCLUDE_DIR=$onnxruntime_dir/include/ |
| 64 | +
|
| 65 | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 66 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" |
| 67 | + cmake --version |
| 68 | +
|
| 69 | + mkdir build |
| 70 | + cd build |
| 71 | +
|
| 72 | + cmake \ |
| 73 | + -D BUILD_SHARED_LIBS=ON \ |
| 74 | + -D CMAKE_OSX_ARCHITECTURES='arm64;x86_64' \ |
| 75 | + -D CMAKE_INSTALL_PREFIX=./install \ |
| 76 | + .. |
| 77 | +
|
| 78 | + - name: Build sherpa-onnx for macos |
| 79 | + shell: bash |
| 80 | + run: | |
| 81 | + version=${{ matrix.version }} |
| 82 | + onnxruntime_dir=$PWD/onnxruntime-osx-universal2-${version} |
| 83 | + export SHERPA_ONNXRUNTIME_LIB_DIR=$onnxruntime_dir/lib/ |
| 84 | + export SHERPA_ONNXRUNTIME_INCLUDE_DIR=$onnxruntime_dir/include/ |
| 85 | +
|
| 86 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" |
| 87 | +
|
| 88 | + cd build |
| 89 | + make -j2 |
| 90 | + make install |
| 91 | +
|
| 92 | + ls -lh lib |
| 93 | + ls -lh bin |
| 94 | +
|
| 95 | + file ./bin/sherpa-onnx |
| 96 | +
|
| 97 | + rm -fv ./install/include/cargs.h |
| 98 | + rm -fv ./install/lib/cargs.h |
| 99 | + rm -fv ./install/lib/libcargs.dylib |
| 100 | + rm -fv ./install/lib/libcargs.a |
| 101 | + rm -rfv ./install/lib/pkgconfig |
| 102 | +
|
| 103 | + - name: Display dependencies of sherpa-onnx for macos |
| 104 | + shell: bash |
| 105 | + run: | |
| 106 | + file bin/sherpa-onnx |
| 107 | + otool -L build/bin/sherpa-onnx |
| 108 | + otool -l build/bin/sherpa-onnx |
| 109 | +
|
| 110 | + - name: Copy files |
| 111 | + shell: bash |
| 112 | + run: | |
| 113 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| 114 | +
|
| 115 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-onnxruntime-${{ matrix.version }}-osx-universal2-shared |
| 116 | + mkdir $dst |
| 117 | +
|
| 118 | + cp -a build/install/bin $dst/ |
| 119 | + mkdir $dst/lib |
| 120 | + cp -a build/install/lib/*.dylib* $dst/lib/ |
| 121 | + cp -a build/install/include $dst/ |
| 122 | +
|
| 123 | + brew install tree |
| 124 | + tree $dst |
| 125 | +
|
| 126 | + tar cjvf ${dst}.tar.bz2 $dst |
| 127 | +
|
| 128 | + - name: Release pre-compiled binaries and libs for macOS |
| 129 | + if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 130 | + uses: svenstaro/upload-release-action@v2 |
| 131 | + with: |
| 132 | + file_glob: true |
| 133 | + overwrite: true |
| 134 | + file: sherpa-onnx-*osx-universal2*.tar.bz2 |
| 135 | + |
| 136 | + - name: Test offline CTC |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + export PATH=$PWD/build/bin:$PATH |
| 140 | + export EXE=sherpa-onnx-offline |
| 141 | +
|
| 142 | + .github/scripts/test-offline-ctc.sh |
| 143 | +
|
| 144 | + - name: Test offline speech denoiser |
| 145 | + shell: bash |
| 146 | + run: | |
| 147 | + du -h -d1 . |
| 148 | + export PATH=$PWD/build/bin:$PATH |
| 149 | + export EXE=sherpa-onnx-offline-denoiser |
| 150 | +
|
| 151 | + .github/scripts/test-offline-speech-denoiser.sh |
| 152 | +
|
| 153 | + - name: Test offline TTS |
| 154 | + shell: bash |
| 155 | + run: | |
| 156 | + export PATH=$PWD/build/bin:$PATH |
| 157 | + export EXE=sherpa-onnx-offline-tts |
| 158 | +
|
| 159 | + .github/scripts/test-offline-tts.sh |
| 160 | +
|
| 161 | + - name: Test offline Moonshine |
| 162 | + shell: bash |
| 163 | + run: | |
| 164 | + export PATH=$PWD/build/bin:$PATH |
| 165 | + export EXE=sherpa-onnx-offline |
| 166 | +
|
| 167 | + .github/scripts/test-offline-moonshine.sh |
| 168 | +
|
| 169 | + - name: Test C++ API |
| 170 | + shell: bash |
| 171 | + run: | |
| 172 | + du -h -d1 . |
| 173 | + export PATH=$PWD/build/bin:$PATH |
| 174 | + export CXX_STREAMING_ZIPFORMER_EXE=streaming-zipformer-cxx-api |
| 175 | + export CXX_WHISPER_EXE=whisper-cxx-api |
| 176 | + export CXX_SENSE_VOICE_EXE=sense-voice-cxx-api |
| 177 | +
|
| 178 | + .github/scripts/test-cxx-api.sh |
| 179 | + du -h -d1 . |
| 180 | +
|
| 181 | + - name: Test offline speaker diarization |
| 182 | + shell: bash |
| 183 | + run: | |
| 184 | + du -h -d1 . |
| 185 | + export PATH=$PWD/build/bin:$PATH |
| 186 | + export EXE=sherpa-onnx-offline-speaker-diarization |
| 187 | +
|
| 188 | + .github/scripts/test-speaker-diarization.sh |
| 189 | +
|
| 190 | + - name: Test offline transducer |
| 191 | + shell: bash |
| 192 | + run: | |
| 193 | + export PATH=$PWD/build/bin:$PATH |
| 194 | + export EXE=sherpa-onnx-offline |
| 195 | +
|
| 196 | + .github/scripts/test-offline-transducer.sh |
| 197 | +
|
| 198 | + - name: Test online punctuation |
| 199 | + shell: bash |
| 200 | + run: | |
| 201 | + export PATH=$PWD/build/bin:$PATH |
| 202 | + export EXE=sherpa-onnx-online-punctuation |
| 203 | +
|
| 204 | + .github/scripts/test-online-punctuation.sh |
| 205 | +
|
| 206 | + - name: Test online CTC |
| 207 | + shell: bash |
| 208 | + run: | |
| 209 | + export PATH=$PWD/build/bin:$PATH |
| 210 | + export EXE=sherpa-onnx |
| 211 | +
|
| 212 | + .github/scripts/test-online-ctc.sh |
| 213 | +
|
| 214 | + - name: Test offline punctuation |
| 215 | + shell: bash |
| 216 | + run: | |
| 217 | + export PATH=$PWD/build/bin:$PATH |
| 218 | + export EXE=sherpa-onnx-offline-punctuation |
| 219 | +
|
| 220 | + .github/scripts/test-offline-punctuation.sh |
| 221 | +
|
| 222 | + - name: Test C API |
| 223 | + shell: bash |
| 224 | + run: | |
| 225 | + export PATH=$PWD/build/bin:$PATH |
| 226 | + export SLID_EXE=spoken-language-identification-c-api |
| 227 | + export SID_EXE=speaker-identification-c-api |
| 228 | + export AT_EXE=audio-tagging-c-api |
| 229 | + export PUNCT_EXE=add-punctuation-c-api |
| 230 | +
|
| 231 | + .github/scripts/test-c-api.sh |
| 232 | +
|
| 233 | + - name: Test Audio tagging |
| 234 | + shell: bash |
| 235 | + run: | |
| 236 | + export PATH=$PWD/build/bin:$PATH |
| 237 | + export EXE=sherpa-onnx-offline-audio-tagging |
| 238 | +
|
| 239 | + .github/scripts/test-audio-tagging.sh |
| 240 | +
|
| 241 | + - name: Test spoken language identification (C++ API) |
| 242 | + shell: bash |
| 243 | + run: | |
| 244 | + export PATH=$PWD/build/bin:$PATH |
| 245 | + export EXE=sherpa-onnx-offline-language-identification |
| 246 | +
|
| 247 | + .github/scripts/test-spoken-language-identification.sh |
| 248 | +
|
| 249 | + - name: Test transducer kws |
| 250 | + shell: bash |
| 251 | + run: | |
| 252 | + export PATH=$PWD/build/bin:$PATH |
| 253 | + export EXE=sherpa-onnx-keyword-spotter |
| 254 | +
|
| 255 | + .github/scripts/test-kws.sh |
| 256 | +
|
| 257 | + - name: Test online paraformer |
| 258 | + shell: bash |
| 259 | + run: | |
| 260 | + export PATH=$PWD/build/bin:$PATH |
| 261 | + export EXE=sherpa-onnx |
| 262 | +
|
| 263 | + .github/scripts/test-online-paraformer.sh |
| 264 | +
|
| 265 | + - name: Test offline Whisper |
| 266 | + if: matrix.build_type != 'Debug' |
| 267 | + shell: bash |
| 268 | + run: | |
| 269 | + export PATH=$PWD/build/bin:$PATH |
| 270 | + export EXE=sherpa-onnx-offline |
| 271 | +
|
| 272 | + .github/scripts/test-offline-whisper.sh |
| 273 | +
|
| 274 | + - name: Test online transducer |
| 275 | + shell: bash |
| 276 | + run: | |
| 277 | + export PATH=$PWD/build/bin:$PATH |
| 278 | + export EXE=sherpa-onnx |
| 279 | +
|
| 280 | + .github/scripts/test-online-transducer.sh |
| 281 | +
|
| 282 | + - name: Test online transducer (C API) |
| 283 | + shell: bash |
| 284 | + run: | |
| 285 | + export PATH=$PWD/build/bin:$PATH |
| 286 | + export EXE=decode-file-c-api |
| 287 | +
|
| 288 | + .github/scripts/test-online-transducer.sh |
| 289 | +
|
| 290 | +
|
0 commit comments