1name: Android Unit Tests 2 3on: 4 workflow_dispatch: {} 5 push: 6 branches: [main] 7 paths: 8 - .github/workflows/android-unit-tests.yml 9 - android/** 10 - fastlane/** 11 - packages/**/android/** 12 - tools/** 13 - yarn.lock 14 - '!packages/@expo/cli/**' 15 pull_request: 16 paths: 17 - .github/workflows/android-unit-tests.yml 18 - android/** 19 - fastlane/** 20 - packages/**/android/** 21 - tools/** 22 - yarn.lock 23 - '!packages/@expo/cli/**' 24 25concurrency: 26 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 27 cancel-in-progress: true 28 29jobs: 30 test: 31 runs-on: ubuntu-20.04 32 timeout-minutes: 60 33 env: 34 ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64 35 GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1024m 36 steps: 37 - name: ⬢ Setup Node 38 uses: actions/setup-node@v3 39 with: 40 node-version: '14.17' 41 - name: Check out repository 42 uses: actions/checkout@v3 43 with: 44 submodules: true 45 - name: Use JDK 11 46 uses: actions/setup-java@v3 47 with: 48 distribution: 'temurin' 49 java-version: '11' 50 - name: ♻️ Restore caches 51 uses: ./.github/actions/expo-caches 52 id: expo-caches 53 with: 54 yarn-workspace: 'true' 55 yarn-tools: 'true' 56 hermes-engine-aar: 'true' 57 - name: ➕ Add `bin` to GITHUB_PATH 58 run: echo "$(pwd)/bin" >> $GITHUB_PATH 59 - name: Install node modules in root dir 60 if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' 61 run: yarn install --frozen-lockfile 62 - name: Run Spotless lint check 63 working-directory: android 64 run: ./gradlew spotlessCheck || { echo '::error Spotless lint failed. Run `./gradlew spotlessApply` to automatically fix formatting.' && exit 1; } 65 - name: Run native Android unit tests 66 timeout-minutes: 30 67 run: expotools native-unit-tests --platform android 68 - name: Save test results 69 if: always() 70 uses: actions/upload-artifact@v3 71 with: 72 name: test-results 73 path: packages/**/build/test-results/**/*xml 74