@@ -310,10 +310,10 @@ jobs:
310310 distribution : temurin
311311 cache : gradle
312312
313- - name : " Check Java Version"
314- run : java -version
315- - name : " Check JAVA_HOME"
316- run : echo $JAVA_HOME
313+ # - name: "Check Java Version"
314+ # run: java -version
315+ # - name: "Check JAVA_HOME"
316+ # run: echo $JAVA_HOME
317317
318318 - name : " Build Android app"
319319 working-directory : native-template/android
@@ -377,7 +377,7 @@ jobs:
377377 name : ios-app
378378 path : native-template/ios/build/Build/Products/**/*.app
379379 android-avd :
380- runs-on : macos-13
380+ runs-on : ubuntu-22.04
381381 steps :
382382 - name : " Check out code"
383383 uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -389,39 +389,39 @@ jobs:
389389 /Users/runner/.android/avd/*
390390 /Users/runner/.android/adb*
391391 /Users/runner/Library/Android/sdk/system-images/**/*
392- key : pixel_34_arm64_v8a_default_3core_and_system_images
393- - name : " Kill existing emulator instances"
394- run : |
395- adb devices | grep emulator | awk '{print $1}' | xargs -r adb -s kill-server
392+ key : new_avd_default_3core_and_system_images
393+ # - name: "Kill existing emulator instances"
394+ # run: |
395+ # adb devices | grep emulator | awk '{print $1}' | xargs -r adb -s kill-server
396396 - name : " Create AVD and generate snapshot for caching"
397- if : steps.avd-cache.outputs.cache-hit != 'true'
398- uses : reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
397+ # if: steps.avd-cache.outputs.cache-hit != 'true'
398+ uses : reactivecircus/android-emulator-runner@v2.32.0
399399 with :
400400 api-level : 34
401401 target : default
402- arch : arm64-v8a
402+ arch : x86_64
403403 profile : pixel
404404 cores : 3
405405 ram-size : 4096M
406406 heap-size : 1024M
407407 avd-name : NATIVE_pixel_34
408- force-avd-creation : false
408+ force-avd-creation : true
409409 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
410410 disable-animations : true
411411 script : |
412412 echo "AVD created"
413413 sleep 5
414- - name : " List available AVDs"
415- run : |
416- echo "Available AVDs:"
417- emulator -list-avds
418- - name : " Check AVD logs"
419- run : |
420- echo "AVD logs:"
421- cat /Users/runner/.android/avd/NATIVE_pixel_34.avd/*.log || echo "No logs found"
414+ # - name: "List available AVDs"
415+ # run: |
416+ # echo "Available AVDs:"
417+ # emulator -list-avds
418+ # - name: "Check AVD logs"
419+ # run: |
420+ # echo "AVD logs:"
421+ # cat /Users/runner/.android/avd/NATIVE_pixel_34.avd/*.log || echo "No logs found"
422422 android-tests :
423423 needs : [scope, mendix-version, project, android-app, android-avd]
424- runs-on : macos-14
424+ runs-on : ubuntu-22.04
425425 steps :
426426 - name : " Check out code"
427427 uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -438,6 +438,14 @@ jobs:
438438 uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
439439 with :
440440 name : mda
441+ - name : " List contents of android-app directory"
442+ run : ls -R android-app
443+ - name : " Check if Android app APK exists"
444+ run : |
445+ if [ ! -f "android-app/app-appstore-debug.apk" ]; then
446+ echo "Error: Android app APK not found at path: android-app/app-appstore-debug.apk"
447+ exit 1
448+ fi
441449 - name : " Start runtime"
442450 uses : ./.github/actions/start-runtime
443451 with :
@@ -460,17 +468,17 @@ jobs:
460468 /Users/runner/.android/avd/*
461469 /Users/runner/.android/adb*
462470 /Users/runner/Library/Android/sdk/system-images/**/*
463- key : pixel_30_arm64_v8a_default_3core_and_system_images
471+ key : new_avd_default_3core_and_system_images
464472 - name : " Run tests"
465473 uses : reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
466474 with :
467475 api-level : 34
468476 target : default
469- arch : arm64-v8a
477+ arch : x86_64
470478 profile : pixel
471479 cores : 3
472480 ram-size : 4096M
473- heap-size : 512M
481+ heap-size : 1024M
474482 avd-name : NATIVE_pixel_34
475483 force-avd-creation : false
476484 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
@@ -543,13 +551,23 @@ jobs:
543551 run : |
544552 mkdir -p detox/apps
545553 find ios-app -type d -iname "*.app" -exec cp -R {} detox/apps/ \;
546- - name : " Check if app is running and terminate if necessary"
554+ # - name: "Check if app is running and terminate if necessary"
555+ # run: |
556+ # if xcrun simctl list apps | grep -q "com.mendix.native.template"; then
557+ # xcrun simctl terminate F8BAF834-0C86-4B68-B1BE-64167CF51C2B com.mendix.native.template || echo "No app to terminate"
558+ # else
559+ # echo "App is not running"
560+ # fi
561+
562+ - name : " List contents of apps directory"
563+ run : ls -R /Users/runner/work/native-widgets/native-widgets/apps
564+ - name : " Check if iOS app exists"
547565 run : |
548- if xcrun simctl list apps | grep -q "com.mendix.native.template"; then
549- xcrun simctl terminate F8BAF834-0C86-4B68-B1BE-64167CF51C2B com.mendix.native.template || echo "No app to terminate"
550- else
551- echo "App is not running"
566+ if [ ! -d "/Users/runner/work/native-widgets/native-widgets/apps/NativeTemplate.app" ]; then
567+ echo "App not found at path: /Users/runner/work/native-widgets/native-widgets/apps/NativeTemplate.app"
568+ exit 1
552569 fi
570+
553571 - name : Install Detox Dependencies
554572 run : |
555573 brew tap wix/brew
@@ -558,11 +576,49 @@ jobs:
558576 run : xcrun simctl list runtimes
559577 - name : Check available device types
560578 run : xcrun simctl list devicetypes
561- - name : Create iOS 17.5 simulator for iPhone 14
562- run : xcrun simctl create "iPhone 14 " com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-17-5
579+ - name : Create iOS 17.5 simulator for iPhone 15
580+ run : xcrun simctl create "iPhone 15 " com.apple.CoreSimulator.SimDeviceType.iPhone-15 com.apple.CoreSimulator.SimRuntime.iOS-17-5
563581 - name : List supported iOS devices
564582 run : applesimutils --list
583+ - name : Boot Simulator
584+ run : xcrun simctl boot "iPhone 15"
585+ - name : Wait for Simulator to Boot
586+ run : |
587+ while ! xcrun simctl list | grep "Booted"; do
588+ echo "Waiting for simulator to boot..."
589+ sleep 5
590+ done
591+ - name : " Check if simulator is booted"
592+ run : |
593+ if ! xcrun simctl list | grep -q "Booted"; then
594+ echo "Simulator is not booted!"
595+ exit 1
596+ fi
597+
598+ # - name: "Install iOS app"
599+ # run: |
600+ # xcrun simctl install "iPhone 15" path/to/your/app.app || echo "Failed to install app"
601+ - name : " List installed apps"
602+ run : xcrun simctl listapps "iPhone 15"
603+
604+ - name : " Wait for app to be ready"
605+ run : sleep 10
606+
607+ - name : " Terminate app if running"
608+ run : |
609+ if xcrun simctl list apps | grep -q "com.mendix.native.template"; then
610+ xcrun simctl terminate "iPhone 15" com.mendix.native.template || echo "No app to terminate"
611+ fi
612+ - name : " Check if app exists"
613+ run : |
614+ if [ ! -d "${{ github.workspace }}/apps/NativeTemplate.app" ]; then
615+ echo "App not found at path: ${{ github.workspace }}/apps/NativeTemplate.app"
616+ exit 1
617+ fi
618+
565619 - name : " Run tests"
620+ env :
621+ DETOX_LOGLEVEL : trace
566622 run : yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test:e2e:ios
567623 - name : " Archive runtime logs"
568624 uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
0 commit comments