diff --git a/.github/workflows/windows-x86.yaml b/.github/workflows/windows-x86.yaml new file mode 100644 index 00000000..5f648d81 --- /dev/null +++ b/.github/workflows/windows-x86.yaml @@ -0,0 +1,88 @@ +name: windows-x86 + +on: + push: + branches: + - master + paths: + - '.github/workflows/windows-x86.yaml' + - '.github/scripts/test-online-transducer.sh' + - 'CMakeLists.txt' + - 'cmake/**' + - 'sherpa-onnx/csrc/*' + pull_request: + branches: + - master + paths: + - '.github/workflows/windows-x86.yaml' + - '.github/scripts/test-online-transducer.sh' + - 'CMakeLists.txt' + - 'cmake/**' + - 'sherpa-onnx/csrc/*' + +concurrency: + group: windows-x86-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + windows_x86: + runs-on: ${{ matrix.os }} + name: ${{ matrix.vs-version }} + strategy: + fail-fast: false + matrix: + include: + - vs-version: vs2015 + toolset-version: v140 + os: windows-2019 + + - vs-version: vs2017 + toolset-version: v141 + os: windows-2019 + + - vs-version: vs2019 + toolset-version: v142 + os: windows-2022 + + - vs-version: vs2022 + toolset-version: v143 + os: windows-2022 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure CMake + shell: bash + run: | + mkdir build + cd build + cmake -T ${{ matrix.toolset-version}},host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release .. + + - name: Build sherpa-onnx for windows + shell: bash + run: | + cd build + cmake --build . --config Release -- -m:2 + + ls -lh ./bin/Release/sherpa-onnx.exe + + - name: Test sherpa-onnx for Windows x86 + shell: bash + run: | + export PATH=$PWD/build/bin/Release:$PATH + export EXE=sherpa-onnx.exe + + .github/scripts/test-online-transducer.sh + + - name: Test online transducer (C API) + shell: bash + run: | + export PATH=$PWD/build/bin/Release:$PATH + export EXE=decode-file-c-api.exe + + .github/scripts/test-online-transducer.sh diff --git a/cmake/asio.cmake b/cmake/asio.cmake index 221e10b6..68ab97f8 100644 --- a/cmake/asio.cmake +++ b/cmake/asio.cmake @@ -17,7 +17,7 @@ function(download_asio) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(asio_URL "file://${f}") + set(asio_URL "${f}") set(asio_URL2) break() endif() diff --git a/cmake/googletest.cmake b/cmake/googletest.cmake index 4d20c258..2907f7c7 100644 --- a/cmake/googletest.cmake +++ b/cmake/googletest.cmake @@ -17,7 +17,7 @@ function(download_googltest) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(googletest_URL "file://${f}") + set(googletest_URL "${f}") set(googletest_URL2) break() endif() diff --git a/cmake/kaldi-native-fbank.cmake b/cmake/kaldi-native-fbank.cmake index f70b9625..240aae98 100644 --- a/cmake/kaldi-native-fbank.cmake +++ b/cmake/kaldi-native-fbank.cmake @@ -21,7 +21,7 @@ function(download_kaldi_native_fbank) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(kaldi_native_fbank_URL "file://${f}") + set(kaldi_native_fbank_URL "${f}") set(kaldi_native_fbank_URL2 ) break() endif() diff --git a/cmake/onnxruntime.cmake b/cmake/onnxruntime.cmake index 104ca8af..b250d513 100644 --- a/cmake/onnxruntime.cmake +++ b/cmake/onnxruntime.cmake @@ -52,10 +52,12 @@ function(download_onnxruntime) # ./include # It contains all the needed header files elseif(WIN32) - # If you don't have access to the Internet, - # please pre-download onnxruntime + message(STATUS "CMAKE_VS_PLATFORM_NAME: ${CMAKE_VS_PLATFORM_NAME}") if(CMAKE_VS_PLATFORM_NAME STREQUAL Win32) + # If you don't have access to the Internet, + # please pre-download onnxruntime + # # for 32-bit windows set(possible_file_locations $ENV{HOME}/Downloads/onnxruntime-win-x86-1.14.0.zip @@ -68,6 +70,9 @@ function(download_onnxruntime) set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x86-1.14.0.zip") set(onnxruntime_HASH "SHA256=4214b130db602cbf31a6f26f25377ab077af0cf03c4ddd4651283e1fb68f56cf") else() + # If you don't have access to the Internet, + # please pre-download onnxruntime + # # for 64-bit windows set(possible_file_locations $ENV{HOME}/Downloads/onnxruntime-win-x64-1.14.0.zip @@ -94,7 +99,7 @@ function(download_onnxruntime) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(onnxruntime_URL "file://${f}") + set(onnxruntime_URL "${f}") set(onnxruntime_URL2) break() endif() diff --git a/cmake/portaudio.cmake b/cmake/portaudio.cmake index 01cb73a6..2b842921 100644 --- a/cmake/portaudio.cmake +++ b/cmake/portaudio.cmake @@ -18,7 +18,7 @@ function(download_portaudio) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(portaudio_URL "file://${f}") + set(portaudio_URL "${f}") set(portaudio_URL2) break() endif() diff --git a/cmake/pybind11.cmake b/cmake/pybind11.cmake index b32941de..30e141ad 100644 --- a/cmake/pybind11.cmake +++ b/cmake/pybind11.cmake @@ -17,7 +17,7 @@ function(download_pybind11) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(pybind11_URL "file://${f}") + set(pybind11_URL "${f}") set(pybind11_URL2) break() endif() diff --git a/cmake/websocketpp.cmake b/cmake/websocketpp.cmake index 35eddc90..f0e6b3dd 100644 --- a/cmake/websocketpp.cmake +++ b/cmake/websocketpp.cmake @@ -18,7 +18,7 @@ function(download_websocketpp) foreach(f IN LISTS possible_file_locations) if(EXISTS ${f}) - set(websocketpp_URL "file://${f}") + set(websocketpp_URL "${f}") set(websocketpp_URL2) break() endif()