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/**' - '!packages/expo/bin/**' - '!packages/expo/e2e/**' concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: web: runs-on: ubuntu-18.04 steps: - name: โฌข Setup Node uses: actions/setup-node@v2 with: node-version: '14.17' - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v2 with: submodules: true - name: โ™ป๏ธ Restore workspace node modules uses: actions/cache@v2 id: node-modules-cache with: path: | # See "workspaces" โ†’ "packages" in the root package.json for the source of truth of # which node_modules are affected by the root yarn.lock node_modules apps/*/node_modules home/node_modules packages/*/node_modules packages/@unimodules/*/node_modules react-native-lab/react-native/node_modules key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - name: ๐Ÿงถ Install node modules in root dir run: yarn install --frozen-lockfile - run: yarn global add expo-cli - run: yarn test:web working-directory: apps/bare-expo - 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-11 steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v2 with: submodules: true - name: ๐Ÿ”จ Switch to Xcode 13.0 run: sudo xcode-select --switch /Applications/Xcode_13.0.app - name: ๐Ÿบ Install required tools run: | brew tap wix/brew brew install applesimutils brew install watchman echo "$(pwd)/bin" >> $GITHUB_PATH - name: ๐Ÿ’Ž Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: โ™ป๏ธ Restore workspace node modules uses: actions/cache@v2 id: node-modules-cache with: path: | # See "workspaces" โ†’ "packages" in the root package.json for the source of truth of # which node_modules are affected by the root yarn.lock node_modules apps/*/node_modules home/node_modules packages/*/node_modules packages/@unimodules/*/node_modules react-native-lab/react-native/node_modules key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - name: ๐Ÿงถ Install node modules in root dir run: yarn install --frozen-lockfile - name: โ™ป๏ธ Restore apps/bare-expo/ios/Pods from cache uses: actions/cache@v2 id: pods-cache with: path: 'apps/bare-expo/ios/Pods' key: ${{ runner.os }}-bare-expo-pods-${{ hashFiles('apps/bare-expo/ios/Podfile.lock') }} # restore-keys: | # ${{ runner.os }}-bare-expo-pods- - 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 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@v2 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-11 env: NDK_ABI_FILTERS: x86_64 steps: - name: ๐Ÿ‘€ Checkout uses: actions/checkout@v2 with: submodules: true - name: ๐Ÿบ Install required tools run: | brew install watchman echo "$(pwd)/bin" >> $GITHUB_PATH - name: โ™ป๏ธ Restore workspace node modules uses: actions/cache@v2 id: node-modules-cache with: path: | # See "workspaces" โ†’ "packages" in the root package.json for the source of truth of # which node_modules are affected by the root yarn.lock node_modules apps/*/node_modules home/node_modules packages/*/node_modules packages/@unimodules/*/node_modules react-native-lab/react-native/node_modules key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - name: ๐Ÿงถ Install node modules in root dir run: yarn install --frozen-lockfile - uses: actions/cache@v2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-v20210625-${{ hashFiles('android/*.gradle*') }} restore-keys: | ${{ runner.os }}-gradle-v20210625 - 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: 29 arch: x86_64 avd-name: bare-expo script: yarn android:detox:test:release working-directory: ./apps/bare-expo - name: Store images of build failures if: always() uses: actions/upload-artifact@v2 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 }} with: channel: '#expo-android' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Test Suite (Android)