ci: consolidate workflows from 5 jobs to 2 #26
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: | |
| # All JS checks in one job (fast, cheap ubuntu runner) | |
| test: | |
| name: Test & Validate | |
| 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: Lint | |
| run: npm run lint | |
| - name: Type check | |
| run: npm run typescript | |
| - name: Run tests | |
| run: npm run test -- --coverage --ci | |
| - name: Build package | |
| run: npm run prepare | |
| - name: Verify package contents | |
| run: npm pack --dry-run | |
| - name: Verify exports | |
| run: | | |
| node -e " | |
| const fs = require('fs'); | |
| const indexContent = fs.readFileSync('./lib/commonjs/index.js', 'utf8'); | |
| const expected = ['ASRManager', 'StreamingASRManager', 'VADManager', 'DiarizationManager', 'TTSManager', 'getSystemInfo', 'isAppleSilicon', 'cleanup']; | |
| const missing = expected.filter(e => !indexContent.includes(e)); | |
| if (missing.length) { | |
| console.error('Missing exports:', missing); | |
| process.exit(1); | |
| } | |
| console.log('All exports found'); | |
| " | |
| # iOS build (expensive macos runner - only Expo) | |
| build-ios: | |
| name: Build iOS | |
| runs-on: macos-15 | |
| 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: Install expo-test dependencies | |
| run: cd expo-test && npm install | |
| - name: Sync FluidAudio package | |
| run: cd expo-test && npm run sync-fluidaudio | |
| - name: Generate native project | |
| run: cd expo-test && npx expo prebuild --platform ios --no-install | |
| - name: Install CocoaPods | |
| run: cd expo-test/ios && pod install | |
| - name: Build iOS | |
| run: | | |
| xcodebuild \ | |
| -workspace expo-test/ios/expotest.xcworkspace \ | |
| -scheme expotest \ | |
| -configuration Debug \ | |
| -sdk iphonesimulator \ | |
| -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO |