Fangjun Kuang
Committed by GitHub

Ci windows x86 (#87)

* CI for 32-bit windows

* small fixes
  1 +name: windows-x86
  2 +
  3 +on:
  4 + push:
  5 + branches:
  6 + - master
  7 + paths:
  8 + - '.github/workflows/windows-x86.yaml'
  9 + - '.github/scripts/test-online-transducer.sh'
  10 + - 'CMakeLists.txt'
  11 + - 'cmake/**'
  12 + - 'sherpa-onnx/csrc/*'
  13 + pull_request:
  14 + branches:
  15 + - master
  16 + paths:
  17 + - '.github/workflows/windows-x86.yaml'
  18 + - '.github/scripts/test-online-transducer.sh'
  19 + - 'CMakeLists.txt'
  20 + - 'cmake/**'
  21 + - 'sherpa-onnx/csrc/*'
  22 +
  23 +concurrency:
  24 + group: windows-x86-${{ github.ref }}
  25 + cancel-in-progress: true
  26 +
  27 +permissions:
  28 + contents: read
  29 +
  30 +jobs:
  31 + windows_x86:
  32 + runs-on: ${{ matrix.os }}
  33 + name: ${{ matrix.vs-version }}
  34 + strategy:
  35 + fail-fast: false
  36 + matrix:
  37 + include:
  38 + - vs-version: vs2015
  39 + toolset-version: v140
  40 + os: windows-2019
  41 +
  42 + - vs-version: vs2017
  43 + toolset-version: v141
  44 + os: windows-2019
  45 +
  46 + - vs-version: vs2019
  47 + toolset-version: v142
  48 + os: windows-2022
  49 +
  50 + - vs-version: vs2022
  51 + toolset-version: v143
  52 + os: windows-2022
  53 +
  54 + steps:
  55 + - uses: actions/checkout@v2
  56 + with:
  57 + fetch-depth: 0
  58 +
  59 + - name: Configure CMake
  60 + shell: bash
  61 + run: |
  62 + mkdir build
  63 + cd build
  64 + cmake -T ${{ matrix.toolset-version}},host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release ..
  65 +
  66 + - name: Build sherpa-onnx for windows
  67 + shell: bash
  68 + run: |
  69 + cd build
  70 + cmake --build . --config Release -- -m:2
  71 +
  72 + ls -lh ./bin/Release/sherpa-onnx.exe
  73 +
  74 + - name: Test sherpa-onnx for Windows x86
  75 + shell: bash
  76 + run: |
  77 + export PATH=$PWD/build/bin/Release:$PATH
  78 + export EXE=sherpa-onnx.exe
  79 +
  80 + .github/scripts/test-online-transducer.sh
  81 +
  82 + - name: Test online transducer (C API)
  83 + shell: bash
  84 + run: |
  85 + export PATH=$PWD/build/bin/Release:$PATH
  86 + export EXE=decode-file-c-api.exe
  87 +
  88 + .github/scripts/test-online-transducer.sh
@@ -17,7 +17,7 @@ function(download_asio) @@ -17,7 +17,7 @@ function(download_asio)
17 17
18 foreach(f IN LISTS possible_file_locations) 18 foreach(f IN LISTS possible_file_locations)
19 if(EXISTS ${f}) 19 if(EXISTS ${f})
20 - set(asio_URL "file://${f}") 20 + set(asio_URL "${f}")
21 set(asio_URL2) 21 set(asio_URL2)
22 break() 22 break()
23 endif() 23 endif()
@@ -17,7 +17,7 @@ function(download_googltest) @@ -17,7 +17,7 @@ function(download_googltest)
17 17
18 foreach(f IN LISTS possible_file_locations) 18 foreach(f IN LISTS possible_file_locations)
19 if(EXISTS ${f}) 19 if(EXISTS ${f})
20 - set(googletest_URL "file://${f}") 20 + set(googletest_URL "${f}")
21 set(googletest_URL2) 21 set(googletest_URL2)
22 break() 22 break()
23 endif() 23 endif()
@@ -21,7 +21,7 @@ function(download_kaldi_native_fbank) @@ -21,7 +21,7 @@ function(download_kaldi_native_fbank)
21 21
22 foreach(f IN LISTS possible_file_locations) 22 foreach(f IN LISTS possible_file_locations)
23 if(EXISTS ${f}) 23 if(EXISTS ${f})
24 - set(kaldi_native_fbank_URL "file://${f}") 24 + set(kaldi_native_fbank_URL "${f}")
25 set(kaldi_native_fbank_URL2 ) 25 set(kaldi_native_fbank_URL2 )
26 break() 26 break()
27 endif() 27 endif()
@@ -52,10 +52,12 @@ function(download_onnxruntime) @@ -52,10 +52,12 @@ function(download_onnxruntime)
52 # ./include 52 # ./include
53 # It contains all the needed header files 53 # It contains all the needed header files
54 elseif(WIN32) 54 elseif(WIN32)
55 - # If you don't have access to the Internet,  
56 - # please pre-download onnxruntime 55 + message(STATUS "CMAKE_VS_PLATFORM_NAME: ${CMAKE_VS_PLATFORM_NAME}")
57 56
58 if(CMAKE_VS_PLATFORM_NAME STREQUAL Win32) 57 if(CMAKE_VS_PLATFORM_NAME STREQUAL Win32)
  58 + # If you don't have access to the Internet,
  59 + # please pre-download onnxruntime
  60 + #
59 # for 32-bit windows 61 # for 32-bit windows
60 set(possible_file_locations 62 set(possible_file_locations
61 $ENV{HOME}/Downloads/onnxruntime-win-x86-1.14.0.zip 63 $ENV{HOME}/Downloads/onnxruntime-win-x86-1.14.0.zip
@@ -68,6 +70,9 @@ function(download_onnxruntime) @@ -68,6 +70,9 @@ function(download_onnxruntime)
68 set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x86-1.14.0.zip") 70 set(onnxruntime_URL2 "https://huggingface.co/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/onnxruntime-win-x86-1.14.0.zip")
69 set(onnxruntime_HASH "SHA256=4214b130db602cbf31a6f26f25377ab077af0cf03c4ddd4651283e1fb68f56cf") 71 set(onnxruntime_HASH "SHA256=4214b130db602cbf31a6f26f25377ab077af0cf03c4ddd4651283e1fb68f56cf")
70 else() 72 else()
  73 + # If you don't have access to the Internet,
  74 + # please pre-download onnxruntime
  75 + #
71 # for 64-bit windows 76 # for 64-bit windows
72 set(possible_file_locations 77 set(possible_file_locations
73 $ENV{HOME}/Downloads/onnxruntime-win-x64-1.14.0.zip 78 $ENV{HOME}/Downloads/onnxruntime-win-x64-1.14.0.zip
@@ -94,7 +99,7 @@ function(download_onnxruntime) @@ -94,7 +99,7 @@ function(download_onnxruntime)
94 99
95 foreach(f IN LISTS possible_file_locations) 100 foreach(f IN LISTS possible_file_locations)
96 if(EXISTS ${f}) 101 if(EXISTS ${f})
97 - set(onnxruntime_URL "file://${f}") 102 + set(onnxruntime_URL "${f}")
98 set(onnxruntime_URL2) 103 set(onnxruntime_URL2)
99 break() 104 break()
100 endif() 105 endif()
@@ -18,7 +18,7 @@ function(download_portaudio) @@ -18,7 +18,7 @@ function(download_portaudio)
18 18
19 foreach(f IN LISTS possible_file_locations) 19 foreach(f IN LISTS possible_file_locations)
20 if(EXISTS ${f}) 20 if(EXISTS ${f})
21 - set(portaudio_URL "file://${f}") 21 + set(portaudio_URL "${f}")
22 set(portaudio_URL2) 22 set(portaudio_URL2)
23 break() 23 break()
24 endif() 24 endif()
@@ -17,7 +17,7 @@ function(download_pybind11) @@ -17,7 +17,7 @@ function(download_pybind11)
17 17
18 foreach(f IN LISTS possible_file_locations) 18 foreach(f IN LISTS possible_file_locations)
19 if(EXISTS ${f}) 19 if(EXISTS ${f})
20 - set(pybind11_URL "file://${f}") 20 + set(pybind11_URL "${f}")
21 set(pybind11_URL2) 21 set(pybind11_URL2)
22 break() 22 break()
23 endif() 23 endif()
@@ -18,7 +18,7 @@ function(download_websocketpp) @@ -18,7 +18,7 @@ function(download_websocketpp)
18 18
19 foreach(f IN LISTS possible_file_locations) 19 foreach(f IN LISTS possible_file_locations)
20 if(EXISTS ${f}) 20 if(EXISTS ${f})
21 - set(websocketpp_URL "file://${f}") 21 + set(websocketpp_URL "${f}")
22 set(websocketpp_URL2) 22 set(websocketpp_URL2)
23 break() 23 break()
24 endif() 24 endif()