YPE-1178 Add IOS CI build test #17
Workflow file for this run
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: Test Example App Build | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-ios-build: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Use latest stable Xcode; consider pinning to specific version (e.g. '16.2') if team needs consistency | |
| - name: Select Xcode version | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: 'latest-stable' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies (root) | |
| run: npm ci | |
| - name: Install dependencies (example app) | |
| working-directory: example | |
| run: npm ci | |
| - name: Generate native iOS project | |
| working-directory: example | |
| run: npx expo prebuild --platform ios | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| id: pods-cache | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile', 'example/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install CocoaPods dependencies | |
| working-directory: example/ios | |
| run: pod install | |
| - name: Build iOS app (no simulator launch) | |
| working-directory: example/ios | |
| run: | | |
| WORKSPACE=$(ls -d *.xcworkspace | head -1) | |
| SCHEME=$(xcodebuild -list -workspace "$WORKSPACE" -json | jq -r '.workspace.schemes[0]') | |
| xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" \ | |
| -configuration Debug \ | |
| -sdk iphonesimulator \ | |
| -destination 'generic/platform=iOS Simulator' \ | |
| -derivedDataPath build \ | |
| build | |
| - name: Verify build output | |
| working-directory: example/ios | |
| run: | | |
| APP=$(find build -name '*.app' -type d | head -1) | |
| if [ -z "$APP" ]; then | |
| echo "::error::No .app bundle found — build may have failed to produce output" | |
| exit 1 | |
| fi | |
| echo "✅ iOS build verified: $(basename "$APP") produced successfully" |