Skip to content

Commit d861408

Browse files
committed
ci: remove flaky maestro smoke jobs from main pipeline
1 parent 7f0669f commit d861408

6 files changed

Lines changed: 172 additions & 171 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -323,161 +323,6 @@ jobs:
323323
- name: Verify 16KB page alignment (zig)
324324
run: bash scripts/check-16kb.sh
325325

326-
maestro-android-smoke:
327-
runs-on: ubuntu-latest
328-
strategy:
329-
fail-fast: false
330-
matrix:
331-
engine: [native, zig]
332-
333-
steps:
334-
- name: Checkout
335-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
336-
337-
- name: Setup
338-
uses: ./.github/actions/setup
339-
340-
- name: Install JDK
341-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
342-
with:
343-
distribution: 'zulu'
344-
java-version: '17'
345-
346-
- name: Install Zig
347-
if: matrix.engine == 'zig'
348-
uses: ./.github/actions/setup-zig
349-
350-
- name: Build Zig prebuilts for Android
351-
if: matrix.engine == 'zig'
352-
run: ./scripts/build-zig-android.sh
353-
354-
- name: Install Maestro CLI
355-
run: |
356-
set -euo pipefail
357-
curl -Ls "https://get.maestro.mobile.dev" | bash
358-
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
359-
360-
- name: Run Maestro runtime smoke (${{ matrix.engine }})
361-
uses: reactivecircus/android-emulator-runner@v2
362-
with:
363-
api-level: 34
364-
arch: x86_64
365-
emulator-port: 5554
366-
profile: pixel_6
367-
disable-animations: true
368-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -no-metrics
369-
script: |
370-
./example/android/gradlew -p example/android :app:assembleRelease :app:installRelease --no-daemon --console=plain -PreactNativeArchitectures=x86_64 -Preact_native_file_hash_engine=${{ matrix.engine }}
371-
ANDROID_SERIAL=emulator-5554 bash ./scripts/maestro-runtime-smoke.sh ${{ matrix.engine }}
372-
373-
- name: Upload Maestro artifacts (${{ matrix.engine }})
374-
if: always()
375-
uses: actions/upload-artifact@v4
376-
with:
377-
name: maestro-android-${{ matrix.engine }}-artifacts
378-
if-no-files-found: warn
379-
path: ~/.maestro/tests
380-
381-
maestro-ios-smoke:
382-
runs-on: macos-latest
383-
strategy:
384-
fail-fast: false
385-
matrix:
386-
engine: [native, zig]
387-
env:
388-
XCODE_VERSION: latest-stable
389-
RCT_USE_RN_DEP: 1
390-
RCT_USE_PREBUILT_RNCORE: 1
391-
ZFH_ENGINE: ${{ matrix.engine }}
392-
393-
steps:
394-
- name: Checkout
395-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
396-
397-
- name: Setup
398-
uses: ./.github/actions/setup
399-
400-
- name: Use appropriate Xcode version
401-
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
402-
with:
403-
xcode-version: ${{ env.XCODE_VERSION }}
404-
405-
- name: Install Zig
406-
if: matrix.engine == 'zig'
407-
uses: ./.github/actions/setup-zig
408-
409-
- name: Build Zig prebuilts for iOS
410-
if: matrix.engine == 'zig'
411-
run: ./scripts/build-zig-ios.sh
412-
413-
- name: Install CocoaPods dependencies
414-
run: |
415-
set -euo pipefail
416-
cd example
417-
bundle install
418-
bundle exec pod install --project-directory=ios --repo-update
419-
420-
- name: Install Maestro CLI
421-
run: |
422-
set -euo pipefail
423-
curl -Ls "https://get.maestro.mobile.dev" | bash
424-
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
425-
426-
- name: Build and install iOS app (${{ matrix.engine }})
427-
run: |
428-
set -euo pipefail
429-
430-
SIMULATOR_ID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ {print $2; exit}')
431-
if [[ -z "${SIMULATOR_ID}" ]]; then
432-
echo "No available iPhone simulator found" >&2
433-
exit 1
434-
fi
435-
436-
xcrun simctl boot "$SIMULATOR_ID" || true
437-
xcrun simctl bootstatus "$SIMULATOR_ID" -b
438-
439-
DERIVED_DATA="$RUNNER_TEMP/maestro-ios-${{ matrix.engine }}"
440-
rm -rf "$DERIVED_DATA"
441-
442-
xcodebuild \
443-
-workspace example/ios/FileHashExample.xcworkspace \
444-
-scheme FileHashExample \
445-
-configuration Release \
446-
-sdk iphonesimulator \
447-
-destination "id=$SIMULATOR_ID" \
448-
-derivedDataPath "$DERIVED_DATA" \
449-
CODE_SIGNING_ALLOWED=NO \
450-
build
451-
452-
APP_PATH=$(find "$DERIVED_DATA/Build/Products/Release-iphonesimulator" -maxdepth 1 -name "*.app" | head -n1)
453-
if [[ -z "${APP_PATH}" ]]; then
454-
echo "Built .app not found in $DERIVED_DATA" >&2
455-
exit 1
456-
fi
457-
458-
APP_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist")
459-
if [[ -z "${APP_ID}" ]]; then
460-
echo "Unable to resolve CFBundleIdentifier" >&2
461-
exit 1
462-
fi
463-
464-
xcrun simctl install "$SIMULATOR_ID" "$APP_PATH"
465-
echo "SIMULATOR_ID=$SIMULATOR_ID" >> "$GITHUB_ENV"
466-
echo "APP_ID=$APP_ID" >> "$GITHUB_ENV"
467-
468-
- name: Run Maestro runtime smoke on iOS (${{ matrix.engine }})
469-
run: |
470-
set -euo pipefail
471-
APP_ID="$APP_ID" maestro test ".maestro/runtime-${{ matrix.engine }}-smoke-ios.yaml"
472-
473-
- name: Upload Maestro artifacts iOS (${{ matrix.engine }})
474-
if: always()
475-
uses: actions/upload-artifact@v4
476-
with:
477-
name: maestro-ios-${{ matrix.engine }}-artifacts
478-
if-no-files-found: warn
479-
path: ~/.maestro/tests
480-
481326
build-ios:
482327
runs-on: macos-latest
483328

.maestro/runtime-native-smoke-ios.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
appId: ${APP_ID}
1+
appId: "${APP_ID}"
22
---
3-
- launchApp:
4-
clearState: true
3+
- launchApp
54
- extendedWaitUntil:
65
visible: "engine: native"
76
timeout: 15000

.maestro/runtime-zig-smoke-ios.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
appId: ${APP_ID}
1+
appId: "${APP_ID}"
22
---
3-
- launchApp:
4-
clearState: true
3+
- launchApp
54
- extendedWaitUntil:
65
visible: "engine: zig"
76
timeout: 15000

CONTRIBUTING.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ Replace `"<IOS_DEVICE_NAME>"` with your actual iPhone device name.
6161
./scripts/build-zig-ios.sh && (cd example && ZFH_ENGINE=zig bundle exec pod install --project-directory=ios && ZFH_ENGINE=zig npx react-native run-ios --mode Release --device "<IOS_DEVICE_NAME>")
6262
```
6363

64+
### Local development and rebuilds
65+
6466
If you need a full clean rebuild, run `./gradlew clean` (Android) or clean the
65-
Xcode build folder before repeating the commands above.
67+
Xcode build folder before repeating the commands in the sections below.
6668

6769
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
6870

@@ -124,6 +126,77 @@ Remember to add tests for your change if possible. Run the unit tests by:
124126
yarn test
125127
```
126128

129+
### Local Maestro smoke runs (Android/iOS, native/zig)
130+
131+
Use these commands to run the same Maestro smoke checks locally that CI uses.
132+
133+
Notes:
134+
135+
- If `maestro` is not installed yet, install it once: `curl -Ls "https://get.maestro.mobile.dev" | bash`
136+
Then make sure `$HOME/.maestro/bin` is in your `PATH` for the current shell.
137+
- For Android, set `-PreactNativeArchitectures` to match your local emulator ABI.
138+
Apple Silicon emulators are usually `arm64-v8a`; GitHub Actions Linux uses `x86_64`.
139+
- The Android commands below auto-pick the first connected device from `adb devices`.
140+
If you have more than one device/emulator attached, set `ANDROID_SERIAL` manually before running them.
141+
- For iOS, always pass `--device "$SIMULATOR_ID"` to Maestro. If Android and iOS devices are both running, Maestro can otherwise pick the wrong device.
142+
143+
```sh
144+
# 1) Android / native / local emulator
145+
ANDROID_SERIAL="${ANDROID_SERIAL:-$(adb devices | awk '$2 == "device" { print $1; exit }')}"
146+
[[ -n "$ANDROID_SERIAL" ]] || { echo "No Android device/emulator found" >&2; exit 1; }
147+
adb -s "$ANDROID_SERIAL" uninstall preeternal.reactnativefilehash.example || true
148+
./example/android/gradlew -p example/android :app:installRelease --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -Preact_native_file_hash_engine=native
149+
ANDROID_SERIAL="$ANDROID_SERIAL" MAESTRO_CLI_NO_ANALYTICS=1 MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 bash ./scripts/maestro-runtime-smoke.sh native
150+
151+
# 2) Android / zig / local emulator
152+
ANDROID_SERIAL="${ANDROID_SERIAL:-$(adb devices | awk '$2 == "device" { print $1; exit }')}"
153+
[[ -n "$ANDROID_SERIAL" ]] || { echo "No Android device/emulator found" >&2; exit 1; }
154+
adb -s "$ANDROID_SERIAL" uninstall preeternal.reactnativefilehash.example || true
155+
./scripts/build-zig-android.sh
156+
./example/android/gradlew -p example/android :app:installRelease --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -Preact_native_file_hash_engine=zig
157+
ANDROID_SERIAL="$ANDROID_SERIAL" MAESTRO_CLI_NO_ANALYTICS=1 MAESTRO_DRIVER_STARTUP_TIMEOUT=300000 bash ./scripts/maestro-runtime-smoke.sh zig
158+
159+
# 3) iOS / native / local simulator
160+
SIMULATOR_ID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ {print $2; exit}')
161+
DERIVED_DATA="$TMPDIR/maestro-ios-native"
162+
rm -rf "$DERIVED_DATA"
163+
xcrun simctl boot "$SIMULATOR_ID" || true
164+
xcrun simctl bootstatus "$SIMULATOR_ID" -b
165+
(cd example && env -u ZFH_ENGINE bundle exec pod install --project-directory=ios)
166+
xcodebuild -workspace example/ios/FileHashExample.xcworkspace -scheme FileHashExample -configuration Release -sdk iphonesimulator -destination "id=$SIMULATOR_ID" -derivedDataPath "$DERIVED_DATA" CODE_SIGNING_ALLOWED=NO build
167+
APP_PATH=$(find "$DERIVED_DATA/Build/Products/Release-iphonesimulator" -maxdepth 1 -name "*.app" | head -n1)
168+
APP_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist")
169+
xcrun simctl uninstall "$SIMULATOR_ID" "$APP_ID" || true
170+
xcrun simctl install "$SIMULATOR_ID" "$APP_PATH"
171+
MAESTRO_CLI_NO_ANALYTICS=1 maestro --device "$SIMULATOR_ID" test -e APP_ID="$APP_ID" .maestro/runtime-native-smoke-ios.yaml
172+
173+
# 4) iOS / zig / local simulator
174+
SIMULATOR_ID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ {print $2; exit}')
175+
DERIVED_DATA="$TMPDIR/maestro-ios-zig"
176+
rm -rf "$DERIVED_DATA"
177+
xcrun simctl boot "$SIMULATOR_ID" || true
178+
xcrun simctl bootstatus "$SIMULATOR_ID" -b
179+
./scripts/build-zig-ios.sh
180+
(cd example && ZFH_ENGINE=zig bundle exec pod install --project-directory=ios)
181+
xcodebuild -workspace example/ios/FileHashExample.xcworkspace -scheme FileHashExample -configuration Release -sdk iphonesimulator -destination "id=$SIMULATOR_ID" -derivedDataPath "$DERIVED_DATA" CODE_SIGNING_ALLOWED=NO build
182+
APP_PATH=$(find "$DERIVED_DATA/Build/Products/Release-iphonesimulator" -maxdepth 1 -name "*.app" | head -n1)
183+
APP_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist")
184+
xcrun simctl uninstall "$SIMULATOR_ID" "$APP_ID" || true
185+
xcrun simctl install "$SIMULATOR_ID" "$APP_PATH"
186+
MAESTRO_CLI_NO_ANALYTICS=1 maestro --device "$SIMULATOR_ID" test -e APP_ID="$APP_ID" .maestro/runtime-zig-smoke-ios.yaml
187+
```
188+
189+
### Release checklist
190+
191+
Before publishing a release, run all four local Maestro smoke commands from the section above:
192+
193+
- Android / native
194+
- Android / zig
195+
- iOS / native
196+
- iOS / zig
197+
198+
Maestro smoke is intentionally not part of GitHub Actions CI for this repository.
199+
Hosted emulator/simulator runs were too slow and too flaky, so these checks are kept local before release.
127200

128201
### Commit message convention
129202

example/ios/FileHashExample/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<key>NSPhotoLibraryUsageDescription</key>
3737
<string>This app needs access to your photo library to pick files for hashing.</string>
3838
<key>RCTNewArchEnabled</key>
39-
<false/>
39+
<true/>
4040
<key>UILaunchStoryboardName</key>
4141
<string>LaunchScreen</string>
4242
<key>UIRequiredDeviceCapabilities</key>

0 commit comments

Comments
 (0)