Fangjun Kuang
Committed by GitHub

Test Windows CUDA support in CI (#222)

  1 +name: windows-x64-cuda
  2 +
  3 +on:
  4 + push:
  5 + branches:
  6 + - master
  7 + tags:
  8 + - '*'
  9 + paths:
  10 + - '.github/workflows/windows-x64-cuda.yaml'
  11 + - '.github/scripts/test-online-transducer.sh'
  12 + - '.github/scripts/test-offline-transducer.sh'
  13 + - '.github/scripts/test-offline-ctc.sh'
  14 + - 'CMakeLists.txt'
  15 + - 'cmake/**'
  16 + - 'sherpa-onnx/csrc/*'
  17 + pull_request:
  18 + branches:
  19 + - master
  20 + paths:
  21 + - '.github/workflows/windows-x64-cuda.yaml'
  22 + - '.github/scripts/test-online-transducer.sh'
  23 + - '.github/scripts/test-offline-transducer.sh'
  24 + - '.github/scripts/test-offline-ctc.sh'
  25 + - 'CMakeLists.txt'
  26 + - 'cmake/**'
  27 + - 'sherpa-onnx/csrc/*'
  28 + release:
  29 + types:
  30 + - published
  31 +
  32 + workflow_dispatch:
  33 + inputs:
  34 + release:
  35 + description: "Whether to release"
  36 + type: boolean
  37 +
  38 +env:
  39 + RELEASE:
  40 + |- # Release if there is a release tag name or a release flag in workflow_dispatch
  41 + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
  42 +
  43 +concurrency:
  44 + group: windows-x64-cuda-${{ github.ref }}
  45 + cancel-in-progress: true
  46 +
  47 +jobs:
  48 + windows_x64:_cuda
  49 + name: Windows x64 CUDA
  50 + runs-on: ${{ matrix.os }}
  51 + strategy:
  52 + fail-fast: false
  53 + matrix:
  54 + os: [windows-latest]
  55 +
  56 + steps:
  57 + - uses: actions/checkout@v2
  58 + with:
  59 + fetch-depth: 0
  60 +
  61 + - name: Configure CMake
  62 + shell: bash
  63 + run: |
  64 + mkdir build
  65 + cd build
  66 + cmake -A x64 -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./install -DSHERPA_ONNX_ENABLE_GPU=ON ..
  67 +
  68 + - name: Build sherpa-onnx for windows
  69 + shell: bash
  70 + run: |
  71 + cd build
  72 + cmake --build . --config Release -- -m:2
  73 + cmake --build . --config Release --target install -- -m:2
  74 +
  75 + ls -lh ./bin/Release/sherpa-onnx.exe
  76 +
  77 + - name: Test offline CTC for windows x64
  78 + shell: bash
  79 + run: |
  80 + export PATH=$PWD/build/bin/Release:$PATH
  81 + export EXE=sherpa-onnx-offline.exe
  82 +
  83 + .github/scripts/test-offline-ctc.sh
  84 +
  85 + - name: Test offline transducer for Windows x64
  86 + shell: bash
  87 + run: |
  88 + export PATH=$PWD/build/bin/Release:$PATH
  89 + export EXE=sherpa-onnx-offline.exe
  90 +
  91 + .github/scripts/test-offline-transducer.sh
  92 +
  93 + - name: Test online transducer for Windows x64
  94 + shell: bash
  95 + run: |
  96 + export PATH=$PWD/build/bin/Release:$PATH
  97 + export EXE=sherpa-onnx.exe
  98 +
  99 + .github/scripts/test-online-transducer.sh
  100 +
  101 + - name: Test online transducer (C API)
  102 + shell: bash
  103 + run: |
  104 + export PATH=$PWD/build/bin/Release:$PATH
  105 + export EXE=decode-file-c-api.exe
  106 +
  107 + .github/scripts/test-online-transducer.sh
  108 +
  109 + - name: Copy files
  110 + if: env.RELEASE == 'true'
  111 + shell: bash
  112 + run: |
  113 + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
  114 +
  115 + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-cuda
  116 + mkdir $dst
  117 +
  118 + cp -a build/install/bin $dst/
  119 + cp -a build/install/lib $dst/
  120 + cp -a build/install/include $dst/
  121 +
  122 + tar cjvf ${dst}.tar.bz2 $dst
  123 +
  124 + - name: Release pre-compiled binaries and libs for Windows x64 CUDA
  125 + if: env.RELEASE == 'true'
  126 + uses: svenstaro/upload-release-action@v2
  127 + with:
  128 + file_glob: true
  129 + overwrite: true
  130 + file: sherpa-onnx-*-win-x64-cuda.tar.bz2
@@ -122,7 +122,7 @@ jobs: @@ -122,7 +122,7 @@ jobs:
122 122
123 tar cjvf ${dst}.tar.bz2 $dst 123 tar cjvf ${dst}.tar.bz2 $dst
124 124
125 - - name: Release pre-compiled binaries and libs for macOS 125 + - name: Release pre-compiled binaries and libs for Windows x64
126 if: env.RELEASE == 'true' 126 if: env.RELEASE == 'true'
127 uses: svenstaro/upload-release-action@v2 127 uses: svenstaro/upload-release-action@v2
128 with: 128 with:
@@ -120,7 +120,7 @@ jobs: @@ -120,7 +120,7 @@ jobs:
120 120
121 tar cjvf ${dst}.tar.bz2 $dst 121 tar cjvf ${dst}.tar.bz2 $dst
122 122
123 - - name: Release pre-compiled binaries and libs for macOS 123 + - name: Release pre-compiled binaries and libs for Windows x86
124 if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' 124 if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015'
125 uses: svenstaro/upload-release-action@v2 125 uses: svenstaro/upload-release-action@v2
126 with: 126 with: