feat: align with @percy/detox 1.0.0 + add iOS + improve CI - #2
Open
pranavz28 wants to merge 1 commit into
Open
Conversation
- Add iOS Detox configuration (ios.debug app, simulator device, ios.sim.debug configuration) plus ios + build:ios + test:ios scripts; add `pod 'Detox'` to Podfile. - Rewrite README to match Percy's standard 8-step example-repo tutorial template (matches example-percy-cypress, example-percy-java-selenium, example-percy-webdriverio). - Add detox-android-emulator.yml — real Detox runtime on a Linux runner via reactivecircus/android-emulator-runner. Manual dispatch + nightly cron. Produces actual Percy builds. - Improve test.yml to run install + lint + tsc + parse checks (was parse-only). - Lint pass: prettier-style auto-fixes across detox.config.js, e2e/*, scripts/*.
Comment on lines
+16
to
+84
| name: Build APK + run Detox + capture Percy | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node 20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'npm' | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
|
|
||
| # AVD creation is expensive — cache the snapshot so subsequent runs boot in seconds. | ||
| - name: Cache AVD | ||
| uses: actions/cache@v4 | ||
| id: avd-cache | ||
| with: | ||
| path: | | ||
| ~/.android/avd/* | ||
| ~/.android/adb* | ||
| key: avd-${{ inputs.avd-api-level || '34' }} | ||
|
|
||
| - name: Create AVD and generate snapshot for caching | ||
| if: steps.avd-cache.outputs.cache-hit != 'true' | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: ${{ inputs.avd-api-level || '34' }} | ||
| arch: x86_64 | ||
| target: google_apis | ||
| avd-name: Pixel_7_API_34 | ||
| force-avd-creation: false | ||
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
| disable-animations: false | ||
| script: echo "Generated AVD snapshot for caching." | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install --legacy-peer-deps | ||
|
|
||
| - name: Build Android APKs (debug + androidTest) | ||
| run: npm run build:android | ||
|
|
||
| - name: Run Detox tests under Percy | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| env: | ||
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
| with: | ||
| api-level: ${{ inputs.avd-api-level || '34' }} | ||
| arch: x86_64 | ||
| target: google_apis | ||
| avd-name: Pixel_7_API_34 | ||
| force-avd-creation: false | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
| disable-animations: true | ||
| script: npx percy app:exec -- npm run test:android | ||
|
|
||
| - name: Upload Detox artifacts on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: detox-artifacts | ||
| path: | | ||
| artifacts | ||
| android/app/build/outputs/logs |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings
example-percy-detoxto a production-ready state aligned with@percy/detox1.0.0. Adds iOS support, improves CI to actually exercise real Detox runtime, and matches Percy's standard example-repo conventions.What's in this PR
iOS support (Task #9)
detox.config.js— newios.debugapp,simulatordevice (defaultiPhone 14 Pro),ios.sim.debugconfiguration.package.json—ios,build:ios,test:iosscripts.ios/Podfile—pod 'Detox', :path => '../node_modules/detox'under app target.README polish (Task #8)
example-percy-cypress,example-percy-java-selenium,example-percy-webdriverio.CI improvements
detox-android-emulator.yml(new) — real Detox runtime viareactivecircus/android-emulator-runneron a free Linux runner. Manual dispatch + nightly cron at 04:00 UTC. AVD snapshot caching for fast subsequent runs. Produces actual Percy builds againstPixel_7_API_34(API level 34, x86_64, google_apis).test.yml— upgraded from parse-only to: install + eslint + tsc + config parse + scripts-executable.detox-bs-android.yml— unchanged; remains workflow_dispatch-only and stays wired for the day BrowserStack ships server-sidetakeScreenshot(cloud_detox_support#L1004).Lint pass
detox.config.js,e2e/*,scripts/*sotest.yml's eslint step is green.Test plan
node -e \"require('./detox.config.js')\"— parsesnpx eslint --ignore-path .gitignore .— cleannpx tsc --noEmit -p .— cleantest -x scripts/upload-apk-to-browserstack.sh— passesdetox-android-emulator.ymlmanually after merge to confirm real Percy buildRequired repo secrets (already documented)
PERCY_TOKEN— App-type Percy project token (starts withapp_)BROWSERSTACK_USERNAME,BROWSERSTACK_ACCESS_KEY— for thedetox-bs-android.ymlworkflowPost-Deploy Monitoring & Validation
detox-android-emulator.ymlmanually to confirm a real Percy build is produced.avd-${api-level}cache key in the Actions UI.timeout-minutes(currently 45).🤖 Generated with Claude Code