BLOG
BlogGuides

Test an Expo app in CI without rebuilding it every time

Native builds are the slow part of mobile CI. Store an Expo fingerprint with each build, skip the build when it has not changed, and test the one you have.

The build is the expensive part#

Running a test on a phone takes minutes. Producing the build to run it on can take far longer. In Expo's write-up of an example pipeline, most of the time is spent waiting on native builds: 19 minutes for Android and 9 for iOS on that run, and Testsy's docs note that an iOS Simulator build can cost 30 to 60 minutes of macOS CI. Most pushes do not change native code, so most of those builds produce the same app.

Expo's answer is the fingerprint: a hash of everything that goes into the native build. If the fingerprint has not changed, the native build has not either.

Store the fingerprint with the build#

Testsy keeps two identifiers for each uploaded build, from app builds from CI:

  • the sha256 of the file, computed on upload;
  • a fingerprint you send with it, for example from @expo/fingerprint.

build find --fingerprint asks whether the project already has a build with that fingerprint. If it has, you skip the native build and run the tests on the existing one.

On GitHub#

Give the action a fingerprint and no build: it only looks the build up, and sets build-needed and build-id. Build only when needed, then test:

- id: fp
  run: echo "fp=$(npx @expo/fingerprint . --platform ios | jq -r .hash)" >> "$GITHUB_OUTPUT"
- id: testsy
  uses: testsy-ai/testsy-action@v1
  with:
    api-key: ${{ secrets.TESTSY_AI_API_KEY }}
    project: p_myproject
    fingerprint: ${{ steps.fp.outputs.fp }}

The docs have the full three-job workflow (look up, build only when build-needed is true, test with whichever build id you have). On GitLab the template's lookup job writes TESTSY_AI_BUILD_NEEDED and TESTSY_AI_BUILD_ID; with any other CI, build find exits 0 when the build exists and 1 when it must be built.

Builds that already exist elsewhere#

If EAS Build has already produced the APK or the zipped .app, give Testsy the artifact link instead of uploading from the pipeline:

node testsy-ai.mjs run --project p_myproject --build https://expo.dev/artifacts/eas/….apk

Testsy fetches it (https only, to a public host) and checks it like an upload. See Import app builds from EAS, Bitrise or S3.

What the build must be#

  • Android: an APK whose native code includes both arm64-v8a and x86_64. For EAS, an eas build -p android --profile preview with "buildType": "apk" in that profile. A React Native or Expo build without x86_64 is refused. Why, and the commands.
  • iOS: a build for the iOS Simulator, the .app folder zipped. How to make one.
  • A release build, not a debug one, for React Native and Expo: a debug build expects a Metro server on your computer, which our devices cannot reach.

This post is part of Mobile release testing: a guide for app teams.

Filed underiPhone and iPadAndroidApp builds and reviewCI, schedules and agents