From 3089e91b5d6ac3dbc751bfe2967603d1c2a28dfa Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 23 Oct 2023 14:46:16 +0800 Subject: [PATCH 1/3] add CI tests for kotlin api examples --- .github/workflows/pkg-config.yaml | 2 +- .github/workflows/test-kotlin.yaml | 47 ++++++++++++++++++++++++++++++ kotlin-api-examples/run.sh | 7 ++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-kotlin.yaml diff --git a/.github/workflows/pkg-config.yaml b/.github/workflows/pkg-config.yaml index 6a15f06f4..35ede5a77 100644 --- a/.github/workflows/pkg-config.yaml +++ b/.github/workflows/pkg-config.yaml @@ -33,7 +33,7 @@ concurrency: cancel-in-progress: true jobs: - linux: + pkg_config: runs-on: ${{ matrix.os }} name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.lib_type }} strategy: diff --git a/.github/workflows/test-kotlin.yaml b/.github/workflows/test-kotlin.yaml new file mode 100644 index 000000000..b09ab23b1 --- /dev/null +++ b/.github/workflows/test-kotlin.yaml @@ -0,0 +1,47 @@ +name: kotlin + +on: + push: + branches: + - master + - kotlin + + pull_request: + branches: + - master + + workflow_dispatch: + +concurrency: + group: kotlin-${{ github.ref }} + cancel-in-progress: true + +jobs: + kotlin: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.os }} + + - name: Test + shell: bash + run: | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + cmake --version + + cd ./kotlin-api-examples + + ./build.sh diff --git a/kotlin-api-examples/run.sh b/kotlin-api-examples/run.sh index a4c368b18..21e36430a 100755 --- a/kotlin-api-examples/run.sh +++ b/kotlin-api-examples/run.sh @@ -11,7 +11,7 @@ cd .. mkdir -p build cd build -if [ ! -f ../build/lib/libsherpa-onnx-jni.dylib ]; then +if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa-onnx-jni.so ]]; then cmake \ -DSHERPA_ONNX_ENABLE_PYTHON=OFF \ -DSHERPA_ONNX_ENABLE_TESTS=OFF \ @@ -34,6 +34,11 @@ if [ ! -f ./sherpa-onnx-streaming-zipformer-en-2023-02-21/tokens.txt ]; then git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-02-21 fi +if [ ! -f ./vits-zh-aishell3/tokens.txt ]; then + git lfs install + git clone https://huggingface.co/csukuangfj/vits-zh-aishell3 +fi + kotlinc-jvm -include-runtime -d main.jar Main.kt WaveReader.kt SherpaOnnx.kt faked-asset-manager.kt Tts.kt ls -lh main.jar From d06122e6ca1097ee89292d188b80bbb2f0fa8fb2 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 23 Oct 2023 15:16:08 +0800 Subject: [PATCH 2/3] small fixes --- .github/workflows/test-kotlin.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-kotlin.yaml b/.github/workflows/test-kotlin.yaml index b09ab23b1..cb3416d56 100644 --- a/.github/workflows/test-kotlin.yaml +++ b/.github/workflows/test-kotlin.yaml @@ -4,7 +4,6 @@ on: push: branches: - master - - kotlin pull_request: branches: From de094c8c76874bbea132b9332483d8c61f18fc46 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 23 Oct 2023 15:17:57 +0800 Subject: [PATCH 3/3] remove unused files --- .github/workflows/test-kotlin.yaml | 46 ------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/test-kotlin.yaml diff --git a/.github/workflows/test-kotlin.yaml b/.github/workflows/test-kotlin.yaml deleted file mode 100644 index cb3416d56..000000000 --- a/.github/workflows/test-kotlin.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: kotlin - -on: - push: - branches: - - master - - pull_request: - branches: - - master - - workflow_dispatch: - -concurrency: - group: kotlin-${{ github.ref }} - cancel-in-progress: true - -jobs: - kotlin: - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ matrix.os }} - - - name: Test - shell: bash - run: | - export CMAKE_CXX_COMPILER_LAUNCHER=ccache - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - cmake --version - - cd ./kotlin-api-examples - - ./build.sh