1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- name: swift-api-test
- on:
- push:
- branches:
- - master
- - csharp-api
- paths:
- - '.github/workflows/csharp-api-test.yaml'
- - '.github/scripts/csharp-api-test.sh'
- - 'CMakeLists.txt'
- - 'cmake/**'
- - 'sherpa-ncnn/csrc/*'
- - 'sherpa-ncnn/csharp-api/*'
- - 'sherpa-ncnn/c-api/*'
- - 'sherpa-ncnn/csharp-api-examples/*'
- pull_request:
- branches:
- - master
- paths:
- - '.github/workflows/swift-api-test.yaml'
- - '.github/scripts/swift-api-test.sh'
- - 'CMakeLists.txt'
- - 'cmake/**'
- - 'sherpa-ncnn/csrc/*'
- - 'sherpa-ncnn/csharp-api/*'
- - 'sherpa-ncnn/c-api/*'
- - 'sherpa-ncnn/csharp-api-examples/*'
- concurrency:
- group: csharp-api-test-${{ github.ref }}
- cancel-in-progress: true
- permissions:
- contents: read
- jobs:
- csharp-api-test:
- 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: Set up .NET Core
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: '6.0.x'
- include-prerelease: true
- - name: Configure CMake
- shell: bash
- run: |
- mkdir build
- cd build
- cmake \
- -T ${{ matrix.toolset-version}},host=x64 \
- -A x64 \
- -D CMAKE_BUILD_TYPE=Release \
- -D BUILD_SHARED_LIBS=ON \
- ..
- - name: Build sherpa-ncnn for windows
- shell: bash
- run: |
- cd build
- cmake --build . --config Release --target sherpa-ncnn-c-api -v
- - name: Build C# exe
- shell: bash
- run: |
- export PATH=$PWD/build/bin/Release:$PATH
- csc ./csharp-api-examples/WaveReader.cs ./csharp-api-examples/DecodeFile.cs ./sherpa-ncnn/csharp-api/SherpaNcnn.cs
- ls -lh ./DecodeFile.exe
- ./DecodeFile.exe
|