1name: Updates e2e 2 3on: 4 workflow_dispatch: {} 5 pull_request: 6 paths: 7 - .github/workflows/updates-e2e.yml 8 - packages/expo-json-utils/** 9 - packages/expo-manifests/** 10 - packages/expo-modules-core/** 11 - packages/expo-structured-headers/** 12 - packages/expo-updates-interface/** 13 - packages/expo-updates/** 14 - packages/expo/android/** 15 - packages/expo/ios/** 16 - templates/expo-template-bare-minimum/** 17 push: 18 branches: [main, 'sdk-*'] 19 paths: 20 - .github/workflows/updates-e2e.yml 21 - packages/expo-json-utils/** 22 - packages/expo-manifests/** 23 - packages/expo-modules-core/** 24 - packages/expo-structured-headers/** 25 - packages/expo-updates-interface/** 26 - packages/expo-updates/** 27 - packages/expo/android/** 28 - packages/expo/ios/** 29 - templates/expo-template-bare-minimum/** 30 31concurrency: 32 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 33 cancel-in-progress: true 34 35jobs: 36 # (2022-05): we run both iOS and Android tests in a single job in order to avoid taking up 2 macOS 37 # runners each time this workflow runs 38 build: 39 runs-on: macos-11 40 timeout-minutes: 120 41 env: 42 UPDATES_PORT: 4747 43 strategy: 44 matrix: 45 api-level: [31] 46 steps: 47 - name: Checkout 48 uses: actions/checkout@v3 49 - name: ⬢ Setup Node 50 uses: actions/setup-node@v3 51 with: 52 node-version: '16' 53 - name: Switch to Xcode 13.2.1 54 run: sudo xcode-select --switch /Applications/Xcode_13.2.1.app 55 - name: Use JDK 11 56 uses: actions/setup-java@v3 57 with: 58 distribution: 'temurin' 59 java-version: '11' 60 - name: ➕ Add `bin` to GITHUB_PATH 61 run: echo "$(yarn global bin)" >> $GITHUB_PATH 62 - name: ♻️ Restore caches 63 uses: ./.github/actions/expo-caches 64 id: expo-caches 65 with: 66 yarn-workspace: 'true' 67 avd: 'true' 68 avd-api: ${{ matrix.api-level }} 69 - name: Yarn install 70 if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' 71 run: yarn install --frozen-lockfile 72 - name: Build local Expo CLI 73 working-directory: packages/@expo/cli 74 run: yarn prepare 75 - name: Build expo-updates CLI 76 working-directory: packages/expo-updates 77 run: yarn build:cli 78 - name: Install Expo CLI 79 run: yarn global add expo-cli 80 - name: Add EXPO_REPO_ROOT to environment 81 run: echo "EXPO_REPO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV 82 - name: Get local IP address 83 run: echo "UPDATES_HOST=$(ifconfig -l | xargs -n1 ipconfig getifaddr)" >> $GITHUB_ENV 84 - name: Get artifacts path 85 run: mkdir -p artifact && echo "ARTIFACTS_DEST=$(pwd)/artifact" >> $GITHUB_ENV 86 - name: Setup test project and build 87 run: node packages/expo-updates/e2e/__tests__/setup/index.js 88 - name: Upload test project artifacts 89 uses: actions/upload-artifact@v3 90 with: 91 name: updates-e2e-artifacts 92 path: artifact 93 - name: Start iOS simulator 94 run: | 95 xcrun simctl list devices -j \ 96 | jq -rc '[ .[] | .[] | .[] | select( .name | contains( "iPhone" ) ) | select( .isAvailable == true ) ] | last.udid ' \ 97 | xargs open -a Simulator --args -CurrentDeviceUDID 98 - name: Run iOS tests 99 timeout-minutes: 30 100 working-directory: packages/expo-updates 101 run: yarn test --config e2e/jest.config.ios.js --runInBand 102 - name: Start Android emulator and run tests 103 timeout-minutes: 30 104 uses: reactivecircus/android-emulator-runner@v2 105 with: 106 api-level: ${{ matrix.api-level }} 107 avd-name: avd-${{ matrix.api-level }} 108 arch: x86_64 109 force-avd-creation: false 110 script: yarn test --config e2e/jest.config.android.js --runInBand 111 working-directory: packages/expo-updates 112