refactor: remove TurboModule/JSI legacy code #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # TypeScript type checking and Jest tests | |
| test-js: | |
| name: TypeScript & Jest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type check | |
| run: npm run typescript | |
| - name: Run tests | |
| run: npm run test -- --coverage --ci | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| if: always() | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| # Build iOS - Legacy Architecture | |
| build-ios-legacy: | |
| name: Build iOS (Legacy) | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install CocoaPods | |
| run: gem install cocoapods | |
| - name: Create test Podfile | |
| run: | | |
| mkdir -p test-app/ios | |
| cat > test-app/ios/Podfile << 'EOF' | |
| platform :ios, '17.0' | |
| target 'TestApp' do | |
| use_frameworks! | |
| pod 'React-Core', :path => '../../node_modules/react-native/' | |
| pod 'react-native-fluidaudio', :path => '../../' | |
| pod 'FluidAudio', :git => 'https://github.com/FluidInference/FluidAudio.git', :tag => 'v0.7.8' | |
| end | |
| EOF | |
| - name: Validate podspec | |
| run: pod lib lint --allow-warnings --skip-tests --no-clean | |
| continue-on-error: true | |
| - name: Check Xcode version | |
| run: | | |
| xcodebuild -version | |
| swift --version | |
| # Build iOS - New Architecture | |
| build-ios-new-arch: | |
| name: Build iOS (New Architecture) | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install CocoaPods | |
| run: gem install cocoapods | |
| - name: Validate podspec (New Arch) | |
| run: | | |
| RCT_NEW_ARCH_ENABLED=1 pod lib lint --allow-warnings --skip-tests --no-clean | |
| continue-on-error: true | |
| - name: Check C++ compilation | |
| run: | | |
| clang++ -std=c++17 -c cpp/FluidAudioTurboModule.cpp -o /dev/null \ | |
| -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include \ | |
| 2>&1 || echo "C++ syntax check (headers may be missing in CI)" | |
| # Lint check | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint | |
| continue-on-error: true | |
| # Package validation | |
| package: | |
| name: Package Validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run prepare | |
| - name: Check package contents | |
| run: npm pack --dry-run | |
| - name: Verify exports | |
| run: | | |
| node -e " | |
| const pkg = require('./lib/commonjs/index.js'); | |
| const expected = ['ASRManager', 'StreamingASRManager', 'VADManager', 'DiarizationManager', 'TTSManager', 'getSystemInfo', 'isAppleSilicon', 'isNewArchitecture', 'hasZeroCopySupport', 'cleanup']; | |
| const missing = expected.filter(e => !pkg[e]); | |
| if (missing.length) { | |
| console.error('Missing exports:', missing); | |
| process.exit(1); | |
| } | |
| console.log('All exports present'); | |
| " |