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-20.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-12 steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v3 with: submodules: true - name: ๐Ÿ”จ Switch to Xcode 14.1 run: sudo xcode-select --switch /Applications/Xcode_14.1.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 - 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 - name: Run tests run: yarn ios:detox:test:release working-directory: apps/bare-expo - 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: runs-on: macos-12 env: ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64 GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m strategy: matrix: api-level: [31] 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: ๐Ÿบ Install required tools run: brew install watchman - name: โž• Add `bin` to GITHUB_PATH run: echo "$(pwd)/bin" >> $GITHUB_PATH - name: โ™ป๏ธ Restore caches uses: ./.github/actions/expo-caches id: expo-caches with: yarn-workspace: 'true' yarn-tools: 'true' avd: 'true' avd-api: ${{ matrix.api-level }} 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: ๐Ÿงน Clean Detox run: yarn detox:clean working-directory: apps/bare-expo - name: ๐Ÿ—๏ธ Build Android project for Detox run: yarn android:detox:build:release working-directory: apps/bare-expo timeout-minutes: 35 env: GRADLE_OPTS: '-Dorg.gradle.internal.http.connectionTimeout=180000 -Dorg.gradle.internal.http.socketTimeout=180000 -Dorg.gradle.internal.network.retry.max.attempts=18 -Dorg.gradle.internal.network.retry.initial.backOff=2000' - name: ๐Ÿงช Run tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} avd-name: avd-${{ matrix.api-level }} arch: x86_64 force-avd-creation: false script: yarn android:detox:test:release working-directory: ./apps/bare-expo - 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_android }} MATRIX_CONTEXT: ${{ toJson(matrix) }} with: channel: '#expo-android' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (Android)