Add CI for Flutter punctuation examples - #3847
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe PR adds cross-platform Flutter punctuation packaging, expands Android builds to ABI matrices, updates hello-world artifact packaging, switches punctuation examples to ChangesFlutter CI packaging
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant NativeBuilds
participant FlutterDemos
participant ArtifactStorage
GitHubActions->>NativeBuilds: Build platform libraries and WASM modules
NativeBuilds->>FlutterDemos: Provide local plugins and model assets
FlutterDemos->>ArtifactStorage: Upload platform-specific packages
Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds GitHub Actions coverage for Flutter punctuation demos and aligns CI/build scripts to use published Flutter packages and multi-ABI Android builds.
Changes:
- Pin
sherpa_onnxdependency version for the punctuation demos (instead of local path deps). - Add a new
test-flutter-punctworkflow to build/package punctuation demos across macOS/Linux/Windows/Android/Web. - Refactor existing Flutter CI workflows to adjust triggers, artifacts naming, CocoaPods installs, and Android multi-ABI builds.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| flutter-examples/online-punctuation/pubspec.yaml | Switches sherpa_onnx dependency from local path to a pinned published version. |
| flutter-examples/offline-punctuation/pubspec.yaml | Same dependency change to support CI building without repo-local path deps. |
| cmake/simple-sentencepiece.cmake | Adjusts embedded C++ to be C++14-compatible and tweaks WASM C++14 compiler check behavior. |
| .github/workflows/test-flutter.yaml | Updates build steps (pod install), artifact naming, and Android builds to matrix-driven ABI builds. |
| .github/workflows/test-flutter-punct.yaml | New CI workflow to build punctuation demos across desktop/mobile/web with local plugin overrides. |
| .github/workflows/test-flutter-package.yaml | Adjusts triggers, Android artifact outputs to split-per-abi, and web artifact naming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cd flutter-examples/${{ matrix.demo }} | ||
|
|
||
| sed -i.bak 's|sherpa_onnx: ^1.13.4|sherpa_onnx:\n path: ../../flutter/sherpa_onnx|' pubspec.yaml | ||
| rm -f pubspec.yaml.bak |
| #include <functional> | ||
| #include <future> | ||
| #include <memory> | ||
| #include <type_traits> | ||
| #include <utility> | ||
| #include <vector> | ||
|
|
||
| class ThreadPool { | ||
| public: | ||
| ThreadPool(size_t) {} | ||
| // C++14 compatible: use auto return type with decltype. | ||
| template<class F, class... Args> | ||
| std::future<std::invoke_result_t<F, Args...>> | ||
| enqueue(F&& f, Args&&... args) { | ||
| auto enqueue(F&& f, Args&&... args) | ||
| -> std::future<decltype(f(args...))> { | ||
| // Run synchronously — no threading in WASM. | ||
| using return_type = std::invoke_result_t<F, Args...>; | ||
| using return_type = decltype(f(args...)); | ||
| auto task = std::make_shared<std::packaged_task<return_type()>>( | ||
| std::bind(std::forward<F>(f), std::forward<Args>(args)...)); |
| template<class F, class... Args> | ||
| std::future<std::invoke_result_t<F, Args...>> | ||
| enqueue(F&& f, Args&&... args) { | ||
| auto enqueue(F&& f, Args&&... args) | ||
| -> std::future<decltype(f(args...))> { | ||
| // Run synchronously — no threading in WASM. | ||
| using return_type = std::invoke_result_t<F, Args...>; | ||
| using return_type = decltype(f(args...)); |
| run: | | ||
| cd flutter-examples/hello_world | ||
| flutter pub get | ||
| flutter build apk | ||
| flutter build apk --split-per-abi --target-platform android-${{ matrix.abi }} |
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: hello-world-linux-${{ matrix.os }} | ||
| name: flutter-hello-world-linux-x64 | ||
| path: flutter-examples/hello_world/build/linux/*/release/bundle/ |
| push: | ||
| branches: | ||
| - master |
| on: | ||
| push: | ||
| branches: | ||
| - dart-xcframework-2 | ||
|
|
||
| schedule: | ||
| # nightly build at 16:50 UTC time every day | ||
| - cron: "50 16 * * *" | ||
| - flutter-ci-2 |
Summary by CodeRabbit
New Features
Bug Fixes
Chores
sherpa_onnx1.13.4 package.