@@ -419,6 +419,111 @@ jobs:
419419 fi
420420 done
421421
422+ # ---------------------------------------------------------------------------
423+ # Lint jobs — fast, parallel, symmetric across all 5 SDKs.
424+ # Each runs independently of the native builds and can fail a PR on its own.
425+ # Path-filtered so a Swift-only PR doesn't run Kotlin/Web/Flutter/RN lints.
426+ # ---------------------------------------------------------------------------
427+
428+ lint_swift :
429+ needs : detect
430+ if : needs.detect.outputs.sdk_swift == 'true' || needs.detect.outputs.workflows == 'true'
431+ runs-on : macos-14
432+ timeout-minutes : 10
433+ steps :
434+ - uses : actions/checkout@v4
435+ - name : Install SwiftLint
436+ run : brew install swiftlint
437+ - name : Lint SDK
438+ working-directory : sdk/runanywhere-swift
439+ run : swiftlint --quiet --reporter github-actions-logging
440+ - name : Lint iOS example app
441+ working-directory : examples/ios/RunAnywhereAI
442+ run : swiftlint --quiet --reporter github-actions-logging
443+
444+ lint_kotlin :
445+ needs : detect
446+ if : needs.detect.outputs.sdk_kotlin == 'true' || needs.detect.outputs.workflows == 'true'
447+ runs-on : ubuntu-latest
448+ timeout-minutes : 15
449+ steps :
450+ - uses : actions/checkout@v4
451+ - uses : ./.github/actions/setup-toolchain
452+ with :
453+ platform : sdk-only
454+ - name : Lint Kotlin SDK (detekt + ktlint)
455+ working-directory : sdk/runanywhere-kotlin
456+ run : ./gradlew detekt ktlintCheck --no-daemon
457+ - name : Lint Android example (detekt + ktlint)
458+ working-directory : examples/android/RunAnywhereAI
459+ run : ./gradlew detekt ktlintCheck --no-daemon
460+
461+ lint_web :
462+ needs : detect
463+ if : needs.detect.outputs.sdk_web == 'true' || needs.detect.outputs.workflows == 'true'
464+ runs-on : ubuntu-latest
465+ timeout-minutes : 10
466+ steps :
467+ - uses : actions/checkout@v4
468+ - uses : ./.github/actions/setup-toolchain
469+ with :
470+ platform : sdk-only
471+ - name : Install deps
472+ working-directory : sdk/runanywhere-web
473+ run : npm install
474+ - name : Build core (so llamacpp/onnx can resolve types)
475+ working-directory : sdk/runanywhere-web
476+ run : npm run build -w packages/core
477+ - name : Lint
478+ working-directory : sdk/runanywhere-web
479+ run : npm run lint
480+
481+ lint_rn :
482+ needs : detect
483+ if : needs.detect.outputs.sdk_react_native == 'true' || needs.detect.outputs.workflows == 'true'
484+ runs-on : ubuntu-latest
485+ timeout-minutes : 15
486+ steps :
487+ - uses : actions/checkout@v4
488+ - uses : ./.github/actions/setup-toolchain
489+ with :
490+ platform : sdk-only
491+ - name : Enable Corepack (yarn@3.6.1)
492+ run : corepack enable
493+ - name : Install RN SDK deps
494+ working-directory : sdk/runanywhere-react-native
495+ run : yarn install --immutable || yarn install
496+ - name : Prepare core (nitrogen + build for llamacpp/onnx)
497+ working-directory : sdk/runanywhere-react-native
498+ run : yarn core:prepare || true
499+ - name : Lint RN SDK
500+ working-directory : sdk/runanywhere-react-native
501+ run : yarn lint
502+
503+ lint_flutter :
504+ needs : detect
505+ if : needs.detect.outputs.sdk_flutter == 'true' || needs.detect.outputs.workflows == 'true'
506+ runs-on : ubuntu-latest
507+ timeout-minutes : 15
508+ steps :
509+ - uses : actions/checkout@v4
510+ - uses : subosito/flutter-action@v2
511+ with :
512+ channel : stable
513+ - name : Flutter analyze — SDK packages
514+ working-directory : sdk/runanywhere-flutter
515+ run : |
516+ set -e
517+ for pkg in packages/runanywhere packages/runanywhere_genie packages/runanywhere_llamacpp packages/runanywhere_onnx; do
518+ if [ -f "$pkg/pubspec.yaml" ]; then
519+ echo "=== Analyzing $pkg ==="
520+ (cd "$pkg" && flutter pub get && flutter analyze)
521+ fi
522+ done
523+ - name : Flutter analyze — example app
524+ working-directory : examples/flutter/RunAnywhereAI
525+ run : flutter pub get && flutter analyze
526+
422527 # ---------------------------------------------------------------------------
423528 # summary: depends on every other job so the PR check shows an aggregate result
424529 # ---------------------------------------------------------------------------
@@ -436,6 +541,11 @@ jobs:
436541 - sdk_web
437542 - sdk_flutter
438543 - sdk_react_native
544+ - lint_swift
545+ - lint_kotlin
546+ - lint_web
547+ - lint_rn
548+ - lint_flutter
439549 runs-on : ubuntu-latest
440550 steps :
441551 - name : Print job results
@@ -451,6 +561,11 @@ jobs:
451561 echo "sdk_web = ${{ needs.sdk_web.result }}"
452562 echo "sdk_flutter = ${{ needs.sdk_flutter.result }}"
453563 echo "sdk_react_native = ${{ needs.sdk_react_native.result }}"
564+ echo "lint_swift = ${{ needs.lint_swift.result }}"
565+ echo "lint_kotlin = ${{ needs.lint_kotlin.result }}"
566+ echo "lint_web = ${{ needs.lint_web.result }}"
567+ echo "lint_rn = ${{ needs.lint_rn.result }}"
568+ echo "lint_flutter = ${{ needs.lint_flutter.result }}"
454569 echo "::endgroup::"
455570 - name : Fail on hard failures
456571 run : |
@@ -460,9 +575,14 @@ jobs:
460575 "${{ needs.native_android.result }}" \
461576 "${{ needs.native_linux.result }}" \
462577 "${{ needs.native_windows.result }}" \
463- "${{ needs.native_web.result }}"; do
578+ "${{ needs.native_web.result }}" \
579+ "${{ needs.lint_swift.result }}" \
580+ "${{ needs.lint_kotlin.result }}" \
581+ "${{ needs.lint_web.result }}" \
582+ "${{ needs.lint_rn.result }}" \
583+ "${{ needs.lint_flutter.result }}"; do
464584 if [ "$r" = "failure" ]; then
465- echo "::error::A native build job failed."
585+ echo "::error::A build or lint job failed."
466586 exit 1
467587 fi
468588 done
0 commit comments