name: Test Suite on: workflow_dispatch: {} push: branches: [main, 'sdk-*'] paths: - .github/workflows/test-suite.yml - apps/bare-expo/** - apps/test-suite/** - packages/** - yarn.lock pull_request: paths: - .github/workflows/test-suite.yml - apps/bare-expo/** - apps/test-suite/** - packages/** - yarn.lock # Ignore Expo CLI for now... - '!packages/@expo/cli/**' concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: web: runs-on: ubuntu-22.04 steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v3 with: submodules: true - name: โฌข Setup Node uses: actions/setup-node@v3 with: node-version: 16 - name: โ™ป๏ธ Restore caches uses: ./.github/actions/expo-caches id: expo-caches with: yarn-workspace: 'true' - name: ๐Ÿงถ Install node modules in root dir if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' run: yarn install --frozen-lockfile - name: ๐Ÿงช Run Web tests run: yarn test:web working-directory: apps/bare-expo env: EXPO_NO_TYPESCRIPT_SETUP: 1 - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_web }} with: channel: '#expo-web' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (Web) ios: runs-on: macos-13 steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v3 with: submodules: true - name: ๐Ÿ”จ Switch to Xcode 14.3 run: sudo xcode-select --switch /Applications/Xcode_14.3.app - name: ๐Ÿบ Install required tools run: | brew tap wix/brew brew install applesimutils brew install watchman - name: โž• Add `bin` to GITHUB_PATH run: echo "$(pwd)/bin" >> $GITHUB_PATH - name: ๐Ÿ’Ž Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: bundler-cache: true ruby-version: 3.2.2 - name: โ™ป๏ธ Restore caches uses: ./.github/actions/expo-caches id: expo-caches with: yarn-workspace: 'true' yarn-tools: 'true' bare-expo-pods: 'true' - name: ๐Ÿงถ Install node modules in root dir if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' run: yarn install --frozen-lockfile - name: ๐Ÿ•ต๏ธ Debug CocoaPods lockfiles run: git diff Podfile.lock Pods/Manifest.lock working-directory: apps/bare-expo/ios continue-on-error: true - name: โš›๏ธ Display React Native config run: yarn react-native config working-directory: apps/bare-expo - name: ๐ŸŒณ Display pod environment run: pod env working-directory: apps/bare-expo/ios - name: ๐Ÿฅฅ Install pods in apps/bare-expo/ios if: steps.expo-caches.outputs.ios-pods-hit != 'true' run: pod install working-directory: apps/bare-expo/ios - name: ๐Ÿงน Clean Detox run: yarn detox:clean working-directory: apps/bare-expo - name: ๐Ÿ—๏ธ Build iOS project for Detox run: yarn ios:detox:build:release working-directory: apps/bare-expo timeout-minutes: 30 env: EXPO_DEBUG: 1 NODE_ENV: production - name: Run tests run: yarn ios:detox:test:release working-directory: apps/bare-expo env: EXPO_DEBUG: 1 NODE_ENV: production - name: Store images of build failures if: always() uses: actions/upload-artifact@v3 with: name: bare-expo-artifacts path: apps/bare-expo/artifacts - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }} with: channel: '#expo-ios' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (iOS) android-build: runs-on: ubuntu-22.04 env: ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64 GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:MaxMetaspaceSize=4096m" steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v3 with: submodules: true - name: โฌข Setup Node uses: actions/setup-node@v3 with: node-version: 16 - name: ๐Ÿ”จ Use JDK 11 uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' - name: โž• Add `bin` to GITHUB_PATH run: echo "$(pwd)/bin" >> $GITHUB_PATH - name: โ™ป๏ธ Restore caches uses: ./.github/actions/expo-caches id: expo-caches with: gradle: 'true' yarn-workspace: 'true' yarn-tools: 'true' react-native-gradle-downloads: 'true' - name: ๐Ÿงถ Install workspace node modules if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' run: yarn install --frozen-lockfile - name: โš›๏ธ Display React Native config run: yarn react-native config working-directory: apps/bare-expo - name: ๐Ÿ› ๏ธ Generate dynamic macros run: expotools android-generate-dynamic-macros --configuration release --bare - name: ๐Ÿ—๏ธ Build Android project run: ./gradlew -DtestBuildType=release :app:assembleRelease :app:assembleAndroidTest --no-daemon working-directory: apps/bare-expo/android timeout-minutes: 35 env: EXPO_DEBUG: 1 NODE_ENV: production - name: ๐Ÿ“ธ Upload builds uses: actions/upload-artifact@v3 with: name: bare-expo-android-builds path: apps/bare-expo/android/app/build/outputs/apk - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_android }} MATRIX_CONTEXT: ${{ toJson(matrix) }} with: channel: '#expo-android' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (Android) android-test: needs: android-build runs-on: macos-13 strategy: matrix: api-level: [33] steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v3 - name: ๐ŸŒ  Download builds uses: actions/download-artifact@v3 with: name: bare-expo-android-builds path: apps/bare-expo/android/app/build/outputs/apk - name: ๐Ÿงช Run tests uses: ./.github/actions/use-android-emulator with: avd-api: ${{ matrix.api-level }} avd-name: avd-${{ matrix.api-level }} script: | mkdir artifacts || true adb logcat -d > artifacts/emulator.log adb logcat -c || true adb shell screencap -p /data/local/tmp/bareexpo.png && adb pull /data/local/tmp/bareexpo.png artifacts/beforeTests.png ./scripts/start-android-e2e-test.sh adb shell screencap -p /data/local/tmp/bareexpo.png && adb pull /data/local/tmp/bareexpo.png artifacts/afterTests.png adb logcat -d > artifacts/adb.log working-directory: ./apps/bare-expo - name: ๐Ÿ“ธ Store images of test failures if: always() uses: actions/upload-artifact@v3 with: name: bare-expo-artifacts path: apps/bare-expo/artifacts - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_android }} MATRIX_CONTEXT: ${{ toJson(matrix) }} with: channel: '#expo-android' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (Android)