ci: add iOS build job for example app #10
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 example app | |
| build-ios: | |
| name: Build iOS | |
| 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: Install example dependencies | |
| run: cd example && npm install | |
| - name: Install CocoaPods | |
| run: gem install cocoapods | |
| - name: Pod install | |
| run: cd example/ios && pod install | |
| - name: Build iOS | |
| run: | | |
| xcodebuild \ | |
| -workspace example/ios/FluidAudioExample.xcworkspace \ | |
| -scheme FluidAudioExample \ | |
| -configuration Debug \ | |
| -sdk iphonesimulator \ | |
| -destination 'platform=iOS Simulator,name=iPhone 15 Pro' \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO | |
| # 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', 'cleanup']; | |
| const missing = expected.filter(e => !pkg[e]); | |
| if (missing.length) { | |
| console.error('Missing exports:', missing); | |
| process.exit(1); | |
| } | |
| console.log('All exports present'); | |
| " |