name: Android Unit Tests on: workflow_dispatch: {} push: branches: [main] paths: - .github/workflows/android-unit-tests.yml - android/** - fastlane/** - packages/**/android/** - tools/** - yarn.lock - '!packages/@expo/cli/**' pull_request: paths: - .github/workflows/android-unit-tests.yml - android/** - fastlane/** - packages/**/android/** - tools/** - yarn.lock - '!packages/@expo/cli/**' concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: test: runs-on: ubuntu-22.04 timeout-minutes: 100 env: ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64 GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx3072m -XX:MaxMetaspaceSize=1024m steps: - name: โฌข Setup Node uses: actions/setup-node@v3 with: node-version: 16 - name: ๐Ÿ‘€ Check out repository uses: actions/checkout@v3 with: submodules: true - name: ๐Ÿงน Cleanup GitHub Linux runner disk space uses: ./.github/actions/cleanup-linux-disk-space - name: ๐Ÿ”จ Use JDK 11 uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' - name: โ™ป๏ธ Restore caches uses: ./.github/actions/expo-caches id: expo-caches with: yarn-workspace: 'true' yarn-tools: 'true' hermes-engine-aar: 'true' react-native-gradle-downloads: 'true' - name: โž• Add `bin` to GITHUB_PATH run: echo "$(pwd)/bin" >> $GITHUB_PATH - name: ๐Ÿงถ Install node modules in root dir if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' run: yarn install --frozen-lockfile - name: ๐Ÿšจ Run Spotless lint check working-directory: android run: ./gradlew spotlessCheck || { echo '::error Spotless lint failed. Run `./gradlew spotlessApply` to automatically fix formatting.' && exit 1; } - name: ๐ŸŽธ Run native Android unit tests timeout-minutes: 30 run: expotools native-unit-tests --platform android - name: ๐Ÿ’พ Save test results if: always() uses: actions/upload-artifact@v3 with: name: test-results path: packages/**/build/test-results/**/*xml