|
| 1 | +name: sanitizer |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + schedule: |
| 7 | + # minute (0-59) |
| 8 | + # hour (0-23) |
| 9 | + # day of the month (1-31) |
| 10 | + # month (1-12) |
| 11 | + # day of the week (0-6) |
| 12 | + # nightly build at 22:50 UTC time every day |
| 13 | + - cron: "50 22 * * *" |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: sanitizer-${{ github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + sanitizer: |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + name: sanitizer |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: [macos-latest] |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - name: ccache |
| 34 | + uses: hendrikmuhs/ccache-action@v1.2 |
| 35 | + with: |
| 36 | + key: ${{ matrix.os }}-sanitizer |
| 37 | + |
| 38 | + - name: Configure CMake |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 42 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" |
| 43 | + cmake --version |
| 44 | +
|
| 45 | + mkdir build |
| 46 | + cd build |
| 47 | +
|
| 48 | + cmake \ |
| 49 | + -DSHERPA_ONNX_ENABLE_PYTHON=ON \ |
| 50 | + -DSHERPA_ONNX_ENABLE_TESTS=ON \ |
| 51 | + -DSHERPA_ONNX_ENABLE_JNI=ON \ |
| 52 | + -DSHERPA_ONNX_ENABLE_SANITIZER=ON \ |
| 53 | + -D BUILD_SHARED_LIBS=ON \ |
| 54 | + -D CMAKE_BUILD_TYPE=Release \ |
| 55 | + -DCMAKE_INSTALL_PREFIX=./install \ |
| 56 | + .. |
| 57 | +
|
| 58 | + - name: Build sherpa-onnx |
| 59 | + shell: bash |
| 60 | + run: | |
| 61 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" |
| 62 | +
|
| 63 | + cd build |
| 64 | + make -j2 |
| 65 | + make install |
| 66 | +
|
| 67 | + ls -lh lib |
| 68 | + ls -lh bin |
| 69 | +
|
| 70 | + file ./bin/sherpa-onnx |
| 71 | +
|
| 72 | + - name: Display dependencies of sherpa-onnx for macos |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + file bin/sherpa-onnx |
| 76 | + otool -L build/bin/sherpa-onnx |
| 77 | + otool -l build/bin/sherpa-onnx |
| 78 | +
|
| 79 | + - name: Test offline transducer |
| 80 | + shell: bash |
| 81 | + run: | |
| 82 | + export PATH=$PWD/build/bin:$PATH |
| 83 | + export EXE=sherpa-onnx-offline |
| 84 | +
|
| 85 | + .github/scripts/test-offline-transducer.sh |
| 86 | +
|
| 87 | + - name: Test online CTC |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + export PATH=$PWD/build/bin:$PATH |
| 91 | + export EXE=sherpa-onnx |
| 92 | +
|
| 93 | + .github/scripts/test-online-ctc.sh |
| 94 | +
|
| 95 | + - name: Test offline punctuation |
| 96 | + shell: bash |
| 97 | + run: | |
| 98 | + export PATH=$PWD/build/bin:$PATH |
| 99 | + export EXE=sherpa-onnx-offline-punctuation |
| 100 | +
|
| 101 | + .github/scripts/test-offline-punctuation.sh |
| 102 | +
|
| 103 | + - name: Test C API |
| 104 | + shell: bash |
| 105 | + run: | |
| 106 | + export PATH=$PWD/build/bin:$PATH |
| 107 | + export SLID_EXE=spoken-language-identification-c-api |
| 108 | + export SID_EXE=speaker-identification-c-api |
| 109 | + export AT_EXE=audio-tagging-c-api |
| 110 | + export PUNCT_EXE=add-punctuation-c-api |
| 111 | +
|
| 112 | + .github/scripts/test-c-api.sh |
| 113 | +
|
| 114 | + - name: Test Audio tagging |
| 115 | + shell: bash |
| 116 | + run: | |
| 117 | + export PATH=$PWD/build/bin:$PATH |
| 118 | + export EXE=sherpa-onnx-offline-audio-tagging |
| 119 | +
|
| 120 | + .github/scripts/test-audio-tagging.sh |
| 121 | +
|
| 122 | + - name: Test spoken language identification (C++ API) |
| 123 | + shell: bash |
| 124 | + run: | |
| 125 | + export PATH=$PWD/build/bin:$PATH |
| 126 | + export EXE=sherpa-onnx-offline-language-identification |
| 127 | +
|
| 128 | + .github/scripts/test-spoken-language-identification.sh |
| 129 | +
|
| 130 | + - name: Test transducer kws |
| 131 | + shell: bash |
| 132 | + run: | |
| 133 | + export PATH=$PWD/build/bin:$PATH |
| 134 | + export EXE=sherpa-onnx-keyword-spotter |
| 135 | +
|
| 136 | + .github/scripts/test-kws.sh |
| 137 | +
|
| 138 | + - name: Test offline TTS |
| 139 | + if: matrix.with_tts == 'ON' |
| 140 | + shell: bash |
| 141 | + run: | |
| 142 | + export PATH=$PWD/build/bin:$PATH |
| 143 | + export EXE=sherpa-onnx-offline-tts |
| 144 | +
|
| 145 | + .github/scripts/test-offline-tts.sh |
| 146 | +
|
| 147 | + - name: Test online paraformer |
| 148 | + shell: bash |
| 149 | + run: | |
| 150 | + export PATH=$PWD/build/bin:$PATH |
| 151 | + export EXE=sherpa-onnx |
| 152 | +
|
| 153 | + .github/scripts/test-online-paraformer.sh |
| 154 | +
|
| 155 | + - name: Test offline Whisper |
| 156 | + if: matrix.build_type != 'Debug' |
| 157 | + shell: bash |
| 158 | + run: | |
| 159 | + export PATH=$PWD/build/bin:$PATH |
| 160 | + export EXE=sherpa-onnx-offline |
| 161 | +
|
| 162 | + .github/scripts/test-offline-whisper.sh |
| 163 | +
|
| 164 | + - name: Test offline CTC |
| 165 | + shell: bash |
| 166 | + run: | |
| 167 | + export PATH=$PWD/build/bin:$PATH |
| 168 | + export EXE=sherpa-onnx-offline |
| 169 | +
|
| 170 | + .github/scripts/test-offline-ctc.sh |
| 171 | +
|
| 172 | + - name: Test online transducer |
| 173 | + shell: bash |
| 174 | + run: | |
| 175 | + export PATH=$PWD/build/bin:$PATH |
| 176 | + export EXE=sherpa-onnx |
| 177 | +
|
| 178 | + .github/scripts/test-online-transducer.sh |
| 179 | +
|
| 180 | + - name: Test online transducer (C API) |
| 181 | + shell: bash |
| 182 | + run: | |
| 183 | + export PATH=$PWD/build/bin:$PATH |
| 184 | + export EXE=decode-file-c-api |
| 185 | +
|
| 186 | + .github/scripts/test-online-transducer.sh |
0 commit comments