Setup Detox #429
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup Node.js | |
| uses: actions/[email protected] | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| fastlane-validate: | |
| name: Fastlane Metadata | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Validate | |
| uses: ashutoshgngwr/[email protected] | |
| with: | |
| usePlayStoreLocales: true | |
| ios-detox: | |
| name: iOS Detox | |
| runs-on: depot-macos-15 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup Xcode | |
| shell: bash | |
| run: | | |
| sudo xcode-select -s /Applications/Xcode_26.0.app/Contents/Developer | |
| xcodebuild -version | |
| - name: Boot device | |
| shell: bash | |
| run: xcrun simctl boot "iPhone 16" | |
| - name: Setup Node.js | |
| uses: actions/[email protected] | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup Expo | |
| run: npx expo install | |
| - name: Prebuild iOS | |
| run: npx expo prebuild --platform ios --clean | |
| - name: Install applesimutils | |
| run: brew tap wix/brew && brew install applesimutils | |
| - name: Xcode info & runtimes | |
| shell: bash | |
| run: | | |
| xcode-select -p | |
| xcodebuild -version | |
| xcodebuild -showsdks | |
| xcrun simctl list runtimes | |
| xcrun simctl list devices | |
| - name: Build | |
| run: npx detox build --configuration ios.sim.release | |
| - name: Test | |
| run: npx detox test --configuration ios.sim.release --cleanup --headless | |
| - name: Upload artifacts on failure | |
| if: failure() | |
| uses: actions/[email protected] | |
| with: | |
| name: ios-detox-artifacts | |
| path: e2e/artifacts/ | |
| retention-days: 7 | |
| android-build: | |
| name: "Android: Build app" | |
| runs-on: depot-ubuntu-24.04-8 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup Node.js | |
| uses: actions/[email protected] | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup Expo | |
| run: npx expo install | |
| - name: Prebuild Android | |
| run: npx expo prebuild --platform android --clean | |
| - name: Setup Java | |
| uses: actions/[email protected] | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Gradle cache | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Build | |
| run: npx detox build --configuration android.emu.release | |
| - name: Upload app apk | |
| uses: actions/[email protected] | |
| with: | |
| name: app-release.apk | |
| path: android/app/build/outputs/apk/release/app-release.apk | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload detox apk | |
| uses: actions/[email protected] | |
| with: | |
| name: app-release-androidTest.apk | |
| path: android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk | |
| if-no-files-found: error | |
| retention-days: 7 | |
| android-test: | |
| name: "Android: Test app with Detox" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: android-build | |
| strategy: | |
| matrix: | |
| api-level: [34] | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup Node.js | |
| uses: actions/[email protected] | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Setup Expo | |
| run: npx expo install | |
| - name: Prebuild Android | |
| run: npx expo prebuild --platform android --clean | |
| - name: Download app apk | |
| uses: actions/[email protected] | |
| with: | |
| name: app-release.apk | |
| path: android/app/build/outputs/apk/release | |
| - name: Download detox apk | |
| uses: actions/[email protected] | |
| with: | |
| name: app-release-androidTest.apk | |
| path: android/app/build/outputs/apk/androidTest/release | |
| - name: Install system dependencies for android emulator | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libpulse0 | |
| - 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: Test | |
| uses: reactivecircus/[email protected] | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| disk-size: 1G | |
| heap-size: 1G | |
| force-avd-creation: false | |
| target: google_apis | |
| arch: x86_64 | |
| disable-animations: true | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
| script: npx detox test --configuration android.emu.release --cleanup --headless | |
| - name: Upload artifacts on failure | |
| if: failure() | |
| uses: actions/[email protected] | |
| with: | |
| name: android-detox-artifacts-api-level-${{ matrix.api-level }} | |
| path: e2e/artifacts/ | |
| retention-days: 7 |