fix(android): Fix device filtering and update min device to API 24 #158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Fast Checks | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Fast test suite (lint + unit + integration) | |
| fast-tests: | |
| name: Fast Tests (Lint + Unit + Integration) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Devbox | |
| uses: jetify-com/devbox-install-action@v0.15.0 | |
| with: | |
| enable-cache: true | |
| - name: Run fast test suite | |
| run: devbox run test:fast | |
| - name: Upload reports and logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: fast-test-reports | |
| path: | | |
| reports/ | |
| retention-days: 7 | |
| # Android example E2E test (max device only on PRs) | |
| android-e2e: | |
| name: Android E2E - max | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| needs: fast-tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Setup Gradle cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \ | |
| /usr/local/share/powershell /usr/local/share/chromium \ | |
| /usr/local/share/boost /opt/hostedtoolcache | |
| sudo apt-get clean | |
| df -h / | |
| - name: Install Devbox | |
| uses: jetify-com/devbox-install-action@v0.15.0 | |
| with: | |
| enable-cache: true | |
| - name: Run Android E2E test | |
| working-directory: examples/android | |
| env: | |
| BOOT_TIMEOUT: 180 | |
| TEST_TIMEOUT: 300 | |
| ANDROID_DEFAULT_DEVICE: max | |
| ANDROID_DEVICES: max | |
| TEST_TUI: false | |
| run: devbox run --pure -e EMU_HEADLESS=1 -e ANDROID_DEVICES=max test:e2e | |
| - name: Upload reports and logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-max-reports | |
| path: | | |
| examples/android/reports/ | |
| examples/android/app/build/outputs/ | |
| retention-days: 7 | |
| # iOS example E2E test (max device only on PRs) | |
| ios-e2e: | |
| name: iOS E2E - max | |
| runs-on: macos-26 | |
| timeout-minutes: 25 | |
| needs: fast-tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Select pinned Xcode | |
| run: | | |
| XCODE_VERSION=$(jq -r '.env.IOS_XCODE_VERSION' plugins/ios/plugin.json) | |
| XCODE_APP=$(ls -d /Applications/Xcode_${XCODE_VERSION}*.app 2>/dev/null | head -1) | |
| if [ -z "$XCODE_APP" ]; then | |
| XCODE_APP="/Applications/Xcode.app" | |
| fi | |
| echo "Selecting: $XCODE_APP" | |
| sudo xcode-select -s "$XCODE_APP/Contents/Developer" | |
| xcodebuild -version | |
| xcrun simctl list runtimes | grep -i ios | |
| - name: Setup CocoaPods cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cocoapods/repos | |
| ~/Library/Caches/CocoaPods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Setup Xcode build cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/Library/Developer/Xcode/DerivedData | |
| key: ${{ runner.os }}-xcode-${{ hashFiles('**/*.xcodeproj/**', '**/*.xcworkspace/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-xcode- | |
| - name: Install Devbox | |
| uses: jetify-com/devbox-install-action@v0.15.0 | |
| with: | |
| enable-cache: true | |
| - name: Run iOS E2E test | |
| working-directory: examples/ios | |
| env: | |
| BOOT_TIMEOUT: 120 | |
| TEST_TIMEOUT: 300 | |
| IOS_DEFAULT_DEVICE: max | |
| TEST_TUI: false | |
| run: devbox run --pure -e SIM_HEADLESS=1 -e IOS_DEVICES=max test:e2e | |
| - name: Upload reports and logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ios-max-reports | |
| path: | | |
| examples/ios/reports/ | |
| ~/Library/Logs/CoreSimulator/ | |
| retention-days: 7 | |
| # React Native E2E tests (max device only on PRs, plus web) | |
| react-native-e2e: | |
| name: React Native E2E - ${{ matrix.platform }}-${{ matrix.device }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 45 | |
| needs: fast-tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: android | |
| device: max | |
| os: ubuntu-24.04 | |
| - platform: ios | |
| device: max | |
| os: macos-26 | |
| - platform: web | |
| device: none | |
| os: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js with cache | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: examples/react-native/package-lock.json | |
| - name: Enable KVM (Android only) | |
| if: matrix.platform == 'android' | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Setup Gradle cache (Android only) | |
| if: matrix.platform == 'android' | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Select pinned Xcode (iOS only) | |
| if: matrix.platform == 'ios' | |
| run: | | |
| XCODE_VERSION=$(jq -r '.env.IOS_XCODE_VERSION' plugins/ios/plugin.json) | |
| XCODE_APP=$(ls -d /Applications/Xcode_${XCODE_VERSION}*.app 2>/dev/null | head -1) | |
| if [ -z "$XCODE_APP" ]; then | |
| XCODE_APP="/Applications/Xcode.app" | |
| fi | |
| echo "Selecting: $XCODE_APP" | |
| sudo xcode-select -s "$XCODE_APP/Contents/Developer" | |
| xcodebuild -version | |
| xcrun simctl list runtimes | grep -i ios | |
| - name: Setup CocoaPods cache (iOS only) | |
| if: matrix.platform == 'ios' | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cocoapods/repos | |
| ~/Library/Caches/CocoaPods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Setup Xcode build cache (iOS only) | |
| if: matrix.platform == 'ios' | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/Library/Developer/Xcode/DerivedData | |
| key: ${{ runner.os }}-xcode-${{ hashFiles('**/*.xcodeproj/**', '**/*.xcworkspace/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-xcode- | |
| - name: Free disk space (Android only) | |
| if: matrix.platform == 'android' | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \ | |
| /usr/local/share/powershell /usr/local/share/chromium \ | |
| /usr/local/share/boost /opt/hostedtoolcache | |
| sudo apt-get clean | |
| df -h / | |
| - name: Install Devbox | |
| uses: jetify-com/devbox-install-action@v0.15.0 | |
| with: | |
| enable-cache: true | |
| - name: Run React Native E2E test | |
| working-directory: examples/react-native | |
| run: | | |
| if [ "${{ matrix.platform }}" = "android" ]; then | |
| devbox run --pure -e IOS_SKIP_SETUP=1 -e EMU_HEADLESS=1 -e ANDROID_DEVICES=max test:e2e:android | |
| elif [ "${{ matrix.platform }}" = "ios" ]; then | |
| devbox run --pure -e ANDROID_SKIP_SETUP=1 -e SIM_HEADLESS=1 -e IOS_DEVICES=max test:e2e:ios | |
| elif [ "${{ matrix.platform }}" = "web" ]; then | |
| devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web | |
| fi | |
| - name: Upload reports and logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: react-native-${{ matrix.platform }}-${{ matrix.device }}-reports | |
| path: | | |
| examples/react-native/reports/ | |
| examples/react-native/android/app/build/outputs/ | |
| examples/react-native/ios/build/ | |
| ~/Library/Logs/CoreSimulator/ | |
| retention-days: 7 | |
| # Summary status check | |
| status-check: | |
| name: All PR Checks Passed | |
| runs-on: ubuntu-latest | |
| needs: [fast-tests, android-e2e, ios-e2e, react-native-e2e] | |
| if: always() | |
| steps: | |
| - name: Check job results | |
| run: | | |
| echo "PR Check Results:" | |
| echo " Fast Tests: ${{ needs.fast-tests.result }}" | |
| echo " Android E2E: ${{ needs.android-e2e.result }}" | |
| echo " iOS E2E: ${{ needs.ios-e2e.result }}" | |
| echo " React Native E2E: ${{ needs.react-native-e2e.result }}" | |
| echo "" | |
| if [[ "${{ needs.fast-tests.result }}" != "success" ]] || \ | |
| [[ "${{ needs.android-e2e.result }}" != "success" ]] || \ | |
| [[ "${{ needs.ios-e2e.result }}" != "success" ]] || \ | |
| [[ "${{ needs.react-native-e2e.result }}" != "success" ]]; then | |
| echo "::error::One or more PR checks failed" | |
| exit 1 | |
| fi | |
| echo "::notice::All PR checks passed!" |