Add non-streaming ASR examples for Dart API (#1007)
This commit is contained in:
52
.github/workflows/test-dart-package.yaml
vendored
Normal file
52
.github/workflows/test-dart-package.yaml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: test-dart-package
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
# day of the month (1-31)
|
||||
# month (1-12)
|
||||
# day of the week (0-6)
|
||||
# nightly build at 15:50 UTC time every day
|
||||
- cron: "50 15 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-dart-package-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test_dart_package:
|
||||
name: ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest] #, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v3
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
.github/scripts/test-dart.sh
|
||||
45
.github/workflows/test-dart.yaml
vendored
45
.github/workflows/test-dart.yaml
vendored
@@ -21,19 +21,24 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
dart:
|
||||
test_dart:
|
||||
name: ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest] #, windows-latest]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ matrix.os }}-dart
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v3
|
||||
with:
|
||||
@@ -50,11 +55,39 @@ jobs:
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build sherpa-onnx
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake --version
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
|
||||
cmake \
|
||||
-D BUILD_SHARED_LIBS=ON \
|
||||
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF \
|
||||
-DBUILD_ESPEAK_NG_EXE=OFF \
|
||||
-DSHERPA_ONNX_ENABLE_BINARY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
..
|
||||
make -j install
|
||||
|
||||
- name: Copy libs
|
||||
shell: bash
|
||||
run: |
|
||||
cp -v build/install/lib/lib* ./sherpa-onnx/flutter/linux/
|
||||
|
||||
echo "--------------------"
|
||||
|
||||
ls -lh ./sherpa-onnx/flutter/linux/
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd dart-api-examples
|
||||
cp scripts/dart/vad-pubspec.yaml dart-api-examples/vad/pubspec.yaml
|
||||
cp scripts/dart/non-streaming-asr-pubspec.yaml dart-api-examples/non-streaming-asr/pubspec.yaml
|
||||
|
||||
pushd vad
|
||||
./run.sh
|
||||
popd
|
||||
.github/scripts/test-dart.sh
|
||||
|
||||
Reference in New Issue
Block a user