@@ -124,15 +124,14 @@ jobs:
124124 registry : ghcr.io
125125 username : ${{ github.actor }}
126126 password : ${{ secrets.GITHUB_TOKEN }}
127+ - name : " Check out code"
128+ uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
127129 - name : " Check if docker image already exists"
128130 run : |
129131 docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} || EXIT_CODE=$?
130132 echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV
131- - name : " Check out code"
132- uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
133- if : ${{ env.IMAGE_MISSING != 0 }}
134133 - name : " Build mxbuild image"
135- if : ${{ env.IMAGE_MISSING != 0 }}
134+ # if: ${{ env.IMAGE_MISSING != 0 }}
136135 uses : docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
137136 with :
138137 file : ./.github/scripts/mxbuild.Dockerfile
@@ -159,6 +158,9 @@ jobs:
159158 cache : yarn
160159 - name : " Install dependencies"
161160 run : yarn install --immutable
161+ - name : " Force rebuild resources"
162+ run : |
163+ yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build # Ensure all resources are rebuilt
162164 - name : " Unit test"
163165 run : yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test
164166 - name : " Run build for development"
@@ -221,8 +223,9 @@ jobs:
221223 if compgen -G 'resources/jsActions/mobile-resources-native/*' > /dev/null; then
222224 mv -f resources/jsActions/nanoflow-actions-native/* Native-Mobile-Resources-main/javascriptsource/nanoflowcommons/actions/
223225 fi
224- - name : " Build test project"
225- run : mxbuild -o automation.mda --loose-version-check Native-Mobile-Resources-main/NativeComponentsTestProject.mpr
226+ - name : " Force rebuild test project"
227+ run : |
228+ mxbuild -o automation.mda --loose-version-check Native-Mobile-Resources-main/NativeComponentsTestProject.mpr # Ensure the project is rebuilt
226229 - name : " Upload MDA"
227230 uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
228231 with :
@@ -317,7 +320,16 @@ jobs:
317320
318321 - name : " Build Android app"
319322 working-directory : native-template/android
320- run : ./gradlew assembleAppstoreDebug assembleAppstoreDebugAndroidTest
323+ run : |
324+ ./gradlew assembleAppstoreDebug assembleAppstoreDebugAndroidTest
325+ if [ $? -ne 0 ]; then
326+ echo "Build failed!"
327+ exit 1
328+ fi
329+ - name : " List APK files"
330+ run : |
331+ echo "Listing APK files in the output directory:"
332+ ls -R native-template/android/app/build/outputs/apk/
321333 - name : " Archive Android app"
322334 uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
323335 with :
@@ -359,7 +371,7 @@ jobs:
359371 run : npm i
360372
361373 - name : " Setup Pods cache"
362- uses : actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
374+ uses : actions/cache@v3
363375 with :
364376 path : native-template/Pods
365377 key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
@@ -382,7 +394,7 @@ jobs:
382394 - name : " Check out code"
383395 uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
384396 - name : " Setup AVD cache"
385- uses : actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
397+ uses : actions/cache@v3
386398 id : avd-cache
387399 with :
388400 path : |
@@ -438,37 +450,43 @@ jobs:
438450 uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
439451 with :
440452 name : mda
441- - name : " List contents of android-app directory"
453+ - name : " List contents of working directory before downloading Android app"
454+ run : ls -R
455+ - name : " Download Android app"
456+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
457+ with :
458+ name : android-app
459+ path : android-app
460+ - name : " List contents of android-app directory after download"
442461 run : ls -R android-app
443462 - name : " Check if Android app APK exists"
444463 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"
464+ if [ ! -f "android-app/appstore/debug/ app-appstore-debug.apk" ]; then
465+ echo "Error: Android app APK not found at path: android-app/appstore/debug/ app-appstore-debug.apk"
447466 exit 1
448467 fi
449468 - name : " Start runtime"
450469 uses : ./.github/actions/start-runtime
451470 with :
452471 mda-file : automation.mda
453472 mendix-version : ${{ needs.mendix-version.outputs.mendix_version }}
454- - name : " Download Android app"
455- uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
456- with :
457- name : android-app
458- path : android-app
459473 - name : " Move android apps to correct location"
460474 run : |
461475 mkdir -p detox/apps
462476 find android-app -type f -iname "*.apk" -exec mv {} detox/apps/ \;
463- - name : " Setup AVD cache"
464- uses : actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
465- id : avd-cache
466- with :
467- path : |
468- /Users/runner/.android/avd/*
469- /Users/runner/.android/adb*
470- /Users/runner/Library/Android/sdk/system-images/**/*
471- key : new_avd_default_3core_and_system_images
477+ - name : " Check if APK files are present"
478+ run : |
479+ echo "Listing APK files in detox/apps directory:"
480+ ls -R detox/apps
481+ # - name: "Setup AVD cache"
482+ # uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
483+ # id: avd-cache
484+ # with:
485+ # path: |
486+ # /Users/runner/.android/avd/*
487+ # /Users/runner/.android/adb*
488+ # /Users/runner/Library/Android/sdk/system-images/**/*
489+ # key: new_avd_default_3core_and_system_images
472490 - name : " Run tests"
473491 uses : reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
474492 with :
@@ -480,14 +498,14 @@ jobs:
480498 ram-size : 4096M
481499 heap-size : 1024M
482500 avd-name : NATIVE_pixel_34
483- force-avd-creation : false
501+ force-avd-creation : true
484502 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
485503 disable-animations : true
486504 script : |
487505 adb shell "rm -fr /data/local/tmp/detox"
488506 adb shell "mkdir -p /data/local/tmp/detox"
489- adb push "/Users/runner/work/native-widgets/native-widgets/ detox/apps/app-appstore-debug.apk" "/data/local/tmp/detox/Application.apk"
490- adb push "/Users/runner/work/native-widgets/native-widgets/ detox/apps/app-appstore-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk"
507+ adb push "detox/apps/app-appstore-debug.apk" "/data/local/tmp/detox/Application.apk"
508+ adb push "detox/apps/app-appstore-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk"
491509 adb shell pm install -r -g -t /data/local/tmp/detox/Application.apk 2>/dev/null
492510 adb shell pm install -r -g -t /data/local/tmp/detox/Test.apk 2>/dev/null
493511 yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test:e2e:android
@@ -547,39 +565,41 @@ jobs:
547565 with :
548566 name : ios-app
549567 path : ios-app
568+ - name : " List contents of ios-app directory"
569+ run : |
570+ echo "Listing contents of ios-app directory:"
571+ ls -R ios-app
550572 - name : " Move iOS app to correct location"
551573 run : |
552574 mkdir -p detox/apps
553575 find ios-app -type d -iname "*.app" -exec cp -R {} detox/apps/ \;
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
561576
562577 - name : " List contents of apps directory"
563- run : ls -R /Users/runner/work/native-widgets/native-widgets/apps
578+ run : |
579+ echo "Listing contents of detox/apps directory:"
580+ ls -R detox/apps
581+
564582 - name : " Check if iOS app exists"
565583 run : |
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
584+ APP_PATH="detox/apps/NativeTemplate.app"
585+ if [ ! -d "$APP_PATH" ]; then
586+ echo "App not found at path: $APP_PATH"
587+ else
588+ echo "App found at path: $APP_PATH"
569589 fi
570590
571591 - name : Install Detox Dependencies
572592 run : |
573593 brew tap wix/brew
574594 brew install applesimutils
575- - name : Check available runtimes
576- run : xcrun simctl list runtimes
577- - name : Check available device types
578- run : xcrun simctl list devicetypes
595+ # - name: Check available runtimes
596+ # run: xcrun simctl list runtimes
597+ # - name: Check available device types
598+ # run: xcrun simctl list devicetypes
579599 - name : Create iOS 17.5 simulator for iPhone 15
580600 run : xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 com.apple.CoreSimulator.SimRuntime.iOS-17-5
581- - name : List supported iOS devices
582- run : applesimutils --list
601+ # - name: List supported iOS devices
602+ # run: applesimutils --list
583603 - name : Boot Simulator
584604 run : xcrun simctl boot "iPhone 15"
585605 - name : Wait for Simulator to Boot
@@ -595,9 +615,6 @@ jobs:
595615 exit 1
596616 fi
597617
598- # - name: "Install iOS app"
599- # run: |
600- # xcrun simctl install "iPhone 15" path/to/your/app.app || echo "Failed to install app"
601618 - name : " List installed apps"
602619 run : xcrun simctl listapps "iPhone 15"
603620
@@ -609,11 +626,16 @@ jobs:
609626 if xcrun simctl list apps | grep -q "com.mendix.native.template"; then
610627 xcrun simctl terminate "iPhone 15" com.mendix.native.template || echo "No app to terminate"
611628 fi
612- - name : " Check if app exists"
629+
630+ - name : " Check if iOS app exists"
613631 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
632+ BINARY_PATH="/Users/runner/work/native-widgets/native-widgets/detox/apps/NativeTemplate.app"
633+ if [ ! -d "$BINARY_PATH" ]; then
634+ echo "App not found at path: $BINARY_PATH"
635+ echo "Listing contents of the apps directory:"
636+ ls -R /Users/runner/work/native-widgets/native-widgets/detox/apps # List contents of the apps directory for debugging
637+ else
638+ echo "App found at path: $BINARY_PATH"
617639 fi
618640
619641 - name : " Run tests"
0 commit comments