Skip to content

Add CI for Flutter punctuation examples - #3847

Merged
csukuangfj merged 4 commits into
k2-fsa:masterfrom
csukuangfj:flutter-ci
Aug 7, 2026
Merged

csukuangfj merged 4 commits into
k2-fsa:masterfrom
csukuangfj:flutter-ci

Conversation

@csukuangfj

@csukuangfj csukuangfj commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added automated packaging for Flutter punctuation demos across macOS, Linux, Windows, Android, and Web.
    • Added Android builds for multiple device architectures with architecture-specific downloadable packages.
    • Added split APK generation and platform-specific artifact packaging.
  • Bug Fixes

    • Improved WebAssembly compatibility for supported builds.
  • Chores

    • Updated punctuation examples to use the published sherpa_onnx 1.13.4 package.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 7, 2026
@csukuangfj
csukuangfj requested a lite review from Copilot August 7, 2026 09:48
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 443ad61a-23b8-4ae1-871d-3ee66d433272

📥 Commits

Reviewing files that changed from the base of the PR and between 5b2ec1d and 65d2be8.

📒 Files selected for processing (6)
  • .github/workflows/test-flutter-package.yaml
  • .github/workflows/test-flutter-punct.yaml
  • .github/workflows/test-flutter.yaml
  • cmake/simple-sentencepiece.cmake
  • flutter-examples/offline-punctuation/pubspec.yaml
  • flutter-examples/online-punctuation/pubspec.yaml

📝 Walkthrough

Walkthrough

The PR adds cross-platform Flutter punctuation packaging, expands Android builds to ABI matrices, updates hello-world artifact packaging, switches punctuation examples to sherpa_onnx 1.13.4, and adjusts the WASM ThreadPool stub for C++14 compatibility.

Changes

Flutter CI packaging

Layer / File(s) Summary
Punctuation demo builds
.github/workflows/test-flutter-punct.yaml, cmake/simple-sentencepiece.cmake, flutter-examples/*-punctuation/pubspec.yaml
Adds macOS, Linux, Windows, Android, and Web builds for both punctuation demos. The workflow builds native and WASM dependencies, downloads models, packages platform artifacts, and uses sherpa_onnx 1.13.4.
Hello-world CI matrix and packaging
.github/workflows/test-flutter.yaml, .github/workflows/test-flutter-package.yaml
Updates dependency setup, triggers, artifact names, web packaging, and Android builds. Android jobs now build split APKs for ABI matrices and upload ABI-specific artifacts.

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
Loading

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@csukuangfj
csukuangfj merged commit 6897144 into k2-fsa:master Aug 7, 2026
48 of 50 checks passed
@csukuangfj
csukuangfj deleted the flutter-ci branch August 7, 2026 09:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_onnx dependency version for the punctuation demos (instead of local path deps).
  • Add a new test-flutter-punct workflow 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.

Comment on lines +103 to +106
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
Comment on lines 55 to 69
#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)...));
Comment on lines 63 to +67
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...));
Comment on lines 341 to +344
run: |
cd flutter-examples/hello_world
flutter pub get
flutter build apk
flutter build apk --split-per-abi --target-platform android-${{ matrix.abi }}
Comment on lines 429 to 433
- 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/
Comment on lines 4 to 6
push:
branches:
- master
Comment on lines 3 to +6
on:
push:
branches:
- dart-xcframework-2

schedule:
# nightly build at 16:50 UTC time every day
- cron: "50 16 * * *"
- flutter-ci-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants