Fangjun Kuang
Committed by GitHub

Fix CI for pip install (#371)

@@ -21,6 +21,7 @@ on: @@ -21,6 +21,7 @@ on:
21 - 'java-api-examples/**' 21 - 'java-api-examples/**'
22 - 'sherpa-onnx/csrc/*' 22 - 'sherpa-onnx/csrc/*'
23 - 'sherpa-onnx/jni/*' 23 - 'sherpa-onnx/jni/*'
  24 + workflow_dispatch:
24 25
25 concurrency: 26 concurrency:
26 group: run-java-test-${{ github.ref }} 27 group: run-java-test-${{ github.ref }}
@@ -19,6 +19,7 @@ on: @@ -19,6 +19,7 @@ on:
19 - 'CMakeLists.txt' 19 - 'CMakeLists.txt'
20 - 'cmake/**' 20 - 'cmake/**'
21 - 'sherpa-onnx/csrc/*' 21 - 'sherpa-onnx/csrc/*'
  22 + workflow_dispatch:
22 23
23 concurrency: 24 concurrency:
24 group: run-python-test-${{ github.ref }} 25 group: run-python-test-${{ github.ref }}
@@ -29,6 +29,7 @@ on: @@ -29,6 +29,7 @@ on:
29 paths: 29 paths:
30 - '.github/workflows/style_check.yaml' 30 - '.github/workflows/style_check.yaml'
31 - 'sherpa-onnx/**' 31 - 'sherpa-onnx/**'
  32 + workflow_dispatch:
32 33
33 concurrency: 34 concurrency:
34 group: style_check-${{ github.ref }} 35 group: style_check-${{ github.ref }}
@@ -12,6 +12,7 @@ on: @@ -12,6 +12,7 @@ on:
12 # day of the week (0-6) 12 # day of the week (0-6)
13 # nightly build at 23:50 UTC time every day 13 # nightly build at 23:50 UTC time every day
14 - cron: "50 23 * * *" 14 - cron: "50 23 * * *"
  15 + workflow_dispatch:
15 16
16 concurrency: 17 concurrency:
17 group: test-pip-install-${{ github.ref }} 18 group: test-pip-install-${{ github.ref }}
@@ -29,9 +30,12 @@ jobs: @@ -29,9 +30,12 @@ jobs:
29 matrix: 30 matrix:
30 os: [ubuntu-latest, windows-latest, macos-latest] 31 os: [ubuntu-latest, windows-latest, macos-latest]
31 python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] 32 python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
  33 + exclude:
  34 + - os: macos-latest
  35 + python-version: "3.7"
32 36
33 steps: 37 steps:
34 - - uses: actions/checkout@v2 38 + - uses: actions/checkout@v3
35 with: 39 with:
36 fetch-depth: 0 40 fetch-depth: 0
37 41
@@ -51,8 +55,23 @@ jobs: @@ -51,8 +55,23 @@ jobs:
51 python3 -c "import sherpa_onnx; print(sherpa_onnx.__file__)" 55 python3 -c "import sherpa_onnx; print(sherpa_onnx.__file__)"
52 python3 -c "import sherpa_onnx; print(sherpa_onnx.__version__)" 56 python3 -c "import sherpa_onnx; print(sherpa_onnx.__version__)"
53 57
  58 + p=$(python3 -c "from pathlib import Path; import sys; print(Path(sys.executable).parent)")
  59 + echo $p
  60 + ls -lh $p
  61 + # ls -lh $p/bin
  62 + # export PATH=$p/bin:$PATH
  63 +
  64 + # For windows
  65 + export PATH=/c/hostedtoolcache/windows/Python/3.7.9/x64/bin:$PATH
  66 + export PATH=/c/hostedtoolcache/windows/Python/3.8.10/x64/bin:$PATH
  67 + export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
  68 + export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
  69 + export PATH=/c/hostedtoolcache/windows/Python/3.11.6/x64/bin:$PATH
  70 +
  71 +
54 sherpa-onnx --help 72 sherpa-onnx --help
55 sherpa-onnx-offline --help 73 sherpa-onnx-offline --help
  74 + sherpa-onnx-offline-tts --help
56 75
57 sherpa-onnx-microphone --help 76 sherpa-onnx-microphone --help
58 sherpa-onnx-microphone-offline --help 77 sherpa-onnx-microphone-offline --help
@@ -7,6 +7,7 @@ on: @@ -7,6 +7,7 @@ on:
7 pull_request: 7 pull_request:
8 branches: 8 branches:
9 - master 9 - master
  10 + workflow_dispatch:
10 11
11 concurrency: 12 concurrency:
12 group: python-offline-websocket-server-${{ github.ref }} 13 group: python-offline-websocket-server-${{ github.ref }}
@@ -7,6 +7,7 @@ on: @@ -7,6 +7,7 @@ on:
7 pull_request: 7 pull_request:
8 branches: 8 branches:
9 - master 9 - master
  10 + workflow_dispatch:
10 11
11 concurrency: 12 concurrency:
12 group: python-online-websocket-server-${{ github.ref }} 13 group: python-online-websocket-server-${{ github.ref }}
@@ -22,6 +22,11 @@ extern "C" { @@ -22,6 +22,11 @@ extern "C" {
22 // We will set SHERPA_ONNX_BUILD_SHARED_LIBS and SHERPA_ONNX_BUILD_MAIN_LIB in 22 // We will set SHERPA_ONNX_BUILD_SHARED_LIBS and SHERPA_ONNX_BUILD_MAIN_LIB in
23 // CMakeLists.txt 23 // CMakeLists.txt
24 24
  25 +#if defined(__GNUC__)
  26 +#pragma GCC diagnostic push
  27 +#pragma GCC diagnostic ignored "-Wattributes"
  28 +#endif
  29 +
25 #if defined(_WIN32) 30 #if defined(_WIN32)
26 #if defined(SHERPA_ONNX_BUILD_SHARED_LIBS) 31 #if defined(SHERPA_ONNX_BUILD_SHARED_LIBS)
27 #define SHERPA_ONNX_EXPORT __declspec(dllexport) 32 #define SHERPA_ONNX_EXPORT __declspec(dllexport)
@@ -31,15 +36,7 @@ extern "C" { @@ -31,15 +36,7 @@ extern "C" {
31 #define SHERPA_ONNX_IMPORT 36 #define SHERPA_ONNX_IMPORT
32 #endif 37 #endif
33 #else // WIN32 38 #else // WIN32
34 -#if __APPLE__  
35 -// it throws a warning on macOS when using  
36 -// __attribute__((visibility("default")))  
37 -//  
38 -// warning: 'visibility' attribute ignored [-Wignored-attributes]  
39 -#define SHERPA_ONNX_EXPORT  
40 -#else  
41 #define SHERPA_ONNX_EXPORT __attribute__((visibility("default"))) 39 #define SHERPA_ONNX_EXPORT __attribute__((visibility("default")))
42 -#endif // __APPLE__  
43 40
44 #define SHERPA_ONNX_IMPORT SHERPA_ONNX_EXPORT 41 #define SHERPA_ONNX_IMPORT SHERPA_ONNX_EXPORT
45 #endif // WIN32 42 #endif // WIN32
@@ -598,6 +595,10 @@ SHERPA_ONNX_API void SherpaOnnxDestroySpeechSegment( @@ -598,6 +595,10 @@ SHERPA_ONNX_API void SherpaOnnxDestroySpeechSegment(
598 SHERPA_ONNX_API void SherpaOnnxVoiceActivityDetectorReset( 595 SHERPA_ONNX_API void SherpaOnnxVoiceActivityDetectorReset(
599 SherpaOnnxVoiceActivityDetector *p); 596 SherpaOnnxVoiceActivityDetector *p);
600 597
  598 +#if defined(__GNUC__)
  599 +#pragma GCC diagnostic pop
  600 +#endif
  601 +
601 #ifdef __cplusplus 602 #ifdef __cplusplus
602 } /* extern "C" */ 603 } /* extern "C" */
603 #endif 604 #endif
@@ -30,7 +30,7 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { @@ -30,7 +30,7 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl {
30 SHERPA_ONNX_LOGE( 30 SHERPA_ONNX_LOGE(
31 "This is a single-speaker model and supports only sid 0. Given sid: " 31 "This is a single-speaker model and supports only sid 0. Given sid: "
32 "%d", 32 "%d",
33 - sid); 33 + static_cast<int32_t>(sid));
34 return {}; 34 return {};
35 } 35 }
36 36
@@ -38,7 +38,7 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl { @@ -38,7 +38,7 @@ class OfflineTtsVitsImpl : public OfflineTtsImpl {
38 SHERPA_ONNX_LOGE( 38 SHERPA_ONNX_LOGE(
39 "This model contains only %d speakers. sid should be in the range " 39 "This model contains only %d speakers. sid should be in the range "
40 "[%d, %d]. Given: %d", 40 "[%d, %d]. Given: %d",
41 - num_speakers, 0, num_speakers - 1, sid); 41 + num_speakers, 0, num_speakers - 1, static_cast<int32_t>(sid));
42 return {}; 42 return {};
43 } 43 }
44 44