|
| 1 | +name: Test iOS e2e |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - .argent/flows/* |
| 7 | + - .github/workflows/ios-e2e.yml |
| 8 | + - packages/react-native-gesture-handler/RNGestureHandler.podspec |
| 9 | + - packages/react-native-gesture-handler/apple/** |
| 10 | + - apps/expo-example/ios/** |
| 11 | + - apps/expo-example/package.json |
| 12 | + - rnrepo.config.json |
| 13 | + - yarn.lock |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + if: github.repository == 'software-mansion/react-native-gesture-handler' |
| 22 | + |
| 23 | + runs-on: macos-26 |
| 24 | + timeout-minutes: 60 |
| 25 | + concurrency: |
| 26 | + group: ios-e2e-${{ github.ref }} |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Use latest stable Xcode |
| 34 | + uses: maxim-lobanov/setup-xcode@v1 |
| 35 | + with: |
| 36 | + xcode-version: '26.4.1' |
| 37 | + |
| 38 | + - name: Use Node.js 24 |
| 39 | + uses: actions/setup-node@v6 |
| 40 | + with: |
| 41 | + node-version: 24 |
| 42 | + cache: yarn |
| 43 | + |
| 44 | + - name: Install node dependencies |
| 45 | + working-directory: apps/expo-example |
| 46 | + run: yarn install --immutable |
| 47 | + |
| 48 | + - name: Build app in Release mode |
| 49 | + working-directory: apps/expo-example/ios |
| 50 | + run: | |
| 51 | + xcodebuild \ |
| 52 | + -workspace ExpoExample.xcworkspace \ |
| 53 | + -scheme ExpoExample \ |
| 54 | + -configuration Release \ |
| 55 | + -sdk iphonesimulator \ |
| 56 | + -destination 'generic/platform=iOS Simulator' \ |
| 57 | + -derivedDataPath build \ |
| 58 | + CODE_SIGNING_ALLOWED=NO \ |
| 59 | + build |
| 60 | +
|
| 61 | + - name: Set up iPhone 17 Pro simulator |
| 62 | + run: | |
| 63 | + UDID=$(xcrun simctl list devices available | grep -E "iPhone 17 Pro \(" | head -1 | grep -oE "[0-9A-Fa-f-]{36}" || true) |
| 64 | + if [ -z "$UDID" ]; then |
| 65 | + echo "iPhone 17 Pro not found, creating one" |
| 66 | + RUNTIME=$(xcrun simctl list runtimes ios -j | jq -r '.runtimes | map(select(.isAvailable)) | last | .identifier') |
| 67 | + UDID=$(xcrun simctl create "iPhone 17 Pro" "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro" "$RUNTIME") |
| 68 | + fi |
| 69 | + echo "Using simulator $UDID" |
| 70 | + xcrun simctl boot "$UDID" || true |
| 71 | + xcrun simctl bootstatus "$UDID" |
| 72 | + echo "SIMULATOR_UDID=$UDID" >> "$GITHUB_ENV" |
| 73 | +
|
| 74 | + - name: Install app on simulator |
| 75 | + working-directory: apps/expo-example/ios |
| 76 | + run: | |
| 77 | + APP_PATH=$(find build/Build/Products/Release-iphonesimulator -maxdepth 1 -name "*.app" -type d | head -1) |
| 78 | + if [ -z "$APP_PATH" ]; then |
| 79 | + echo "Could not find built .app" >&2 |
| 80 | + exit 1 |
| 81 | + fi |
| 82 | + echo "Installing $APP_PATH on $SIMULATOR_UDID" |
| 83 | + xcrun simctl install "$SIMULATOR_UDID" "$APP_PATH" |
| 84 | +
|
| 85 | + - name: Install Agent |
| 86 | + run: npx @swmansion/argent init --yes |
| 87 | + |
| 88 | + - name: Run tap E2E test |
| 89 | + run: argent flow run simple-tap-test --device $SIMULATOR_UDID |
0 commit comments