Skip to content

Enable multi-threaded LiteRT CPU inference (#581) #1561

Enable multi-threaded LiteRT CPU inference (#581)

Enable multi-threaded LiteRT CPU inference (#581) #1561

Workflow file for this run

# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Continuous Integration (CI) GitHub Actions tests
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
pull-requests: write
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: flutter pub get
- name: Run tests with coverage
run: flutter test --coverage
- name: Test native depth colorizer
run: g++ -std=c++17 android/src/test/cpp/depth-colorizer-test.cpp -o /tmp/depth-colorizer-test && /tmp/depth-colorizer-test
- name: Filter unit coverage scope
run: |
awk '/^SF:/ { skip = ($0 ~ /^SF:lib\/(platform\/|yolo_view\.dart|widgets\/yolo_showcase\.dart)/) } !skip { print } /^end_of_record$/ { skip = 0 }' coverage/lcov.info > coverage/lcov.filtered.info
mv coverage/lcov.filtered.info coverage/lcov.info
- name: Dart publish dry-run
run: dart pub publish --dry-run
- name: Upload Coverage Reports to CodeCov
continue-on-error: true
uses: codecov/codecov-action@v7
with:
use_oidc: true
fail_ci_if_error: false
files: coverage/lcov.info
disable_search: true
plugins: noop
name: flutter-codecov
verbose: false
example-android:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Build example Android app
working-directory: example
run: flutter build apk --debug
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Launch smoke test (Android emulator)
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
target: default
working-directory: example
script: |
set -eux
adb install -r -t build/app/outputs/flutter-apk/app-debug.apk
adb shell pm grant com.ultralytics.yolo android.permission.CAMERA || true
adb shell am start -n com.ultralytics.yolo/.MainActivity
sleep 10
adb shell pidof com.ultralytics.yolo
adb shell dumpsys activity activities | grep com.ultralytics.yolo
- name: Build example Android release bundle
working-directory: example
run: flutter build appbundle --release
- name: Verify example Android release bundle
run: scripts/build_play_store_assets.sh --verify-aab example/build/app/outputs/bundle/release/app-release.aab
example-ios:
runs-on: macos-26
timeout-minutes: 35
steps:
- uses: actions/checkout@v7
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Boot iOS Simulator
run: |
UDID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/{print $2; exit}')
echo "Booting simulator $UDID"
xcrun simctl boot "$UDID"
xcrun simctl bootstatus "$UDID" -b
echo "SIMULATOR_UDID=$UDID" >> "$GITHUB_ENV"
# Primary path: the example ships SPM-migrated, so build it the way it's published — the plugin's Package.swift
# resolves the shared UltralyticsYOLO core from yolo-ios-app over Swift Package Manager.
- name: Build example iOS app (Swift Package Manager)
working-directory: example
run: |
flutter config --enable-swift-package-manager
flutter build ios --simulator --no-codesign
- name: Launch smoke test (iOS Simulator)
working-directory: example
run: |
set -eux
APP_ID=com.ultralytics.yoloExample
xcrun simctl install "$SIMULATOR_UDID" build/ios/iphonesimulator/Runner.app
xcrun simctl privacy "$SIMULATOR_UDID" grant camera "$APP_ID"
xcrun simctl launch --terminate-running-process "$SIMULATOR_UDID" "$APP_ID"
sleep 10
xcrun simctl terminate "$SIMULATOR_UDID" "$APP_ID"
# Regression guard for pub.dev's CocoaPods consumers: the same sources must still compile through the podspec.
- name: Build example iOS app (CocoaPods regression)
working-directory: example
run: |
flutter config --no-enable-swift-package-manager
flutter clean
flutter build ios --simulator --no-codesign