diff --git a/.github/actions/start-runtime/action.yml b/.github/actions/start-runtime/action.yml index e6c5142ea..21ba5c9a2 100644 --- a/.github/actions/start-runtime/action.yml +++ b/.github/actions/start-runtime/action.yml @@ -27,7 +27,7 @@ runs: run: | mkdir project unzip -qq ${{ inputs.mda-file }} -d project - cp .github/configs/m2ee-native.yml project/m2ee-native.yml + cp configs/e2e/m2ee-native.yml project/m2ee-native.yml sed -i -- 's=$ROOT_PATH=${{ github.workspace }}=g' project/m2ee-native.yml sed -i -- 's=$JAVA_HOME=${{ steps.setup-java.outputs.path }}=g' project/m2ee-native.yml shell: bash diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 102695c76..aaf20ab4c 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -84,7 +84,6 @@ jobs: with: node-version-file: .nvmrc cache: yarn - cache-dependency-path: "**/yarn.lock" - name: "Install dependencies" run: yarn install --immutable --immutable-cache --check-cache - name: "Unit test" @@ -196,9 +195,13 @@ jobs: - name: "Check out Native Template for Native Components Test Project" uses: actions/checkout@v3.4.0 with: - repository: mendix/native-content-test-app + repository: mendix/native-template ref: main - ssh-key: ${{ secrets.NATIVE_CONTENT_TEST_APP }} + path: native_template + - name: "Check out code" + uses: actions/checkout@v3.4.0 + with: + path: native_widgets - name: "Download Android bundle and assets" uses: actions/download-artifact@v3.0.2 with: @@ -206,30 +209,34 @@ jobs: path: bundles/android - name: "Copy files to the right location" run: | - mv bundles/android/index.android.bundle android/app/src/main/assets/index.android.bundle - cp -r bundles/android/assets/* android/app/src/main/res/ + mv bundles/android/index.android.bundle native_template/android/app/src/main/assets/index.android.bundle + cp -r bundles/android/assets/* native_template/android/app/src/main/res/ + mv native_widgets/configs/e2e/config.json native_template/ + mv native_widgets/configs/e2e/.dependencies native_template/ + mv native_widgets/configs/e2e/.native_dependencies native_template/ - name: "Set up Node" uses: actions/setup-node@v3.6.0 with: - node-version: 14 + node-version-file: .nvmrc cache: npm - cache-dependency-path: "**/package-lock.json" - name: "Install dependencies" run: npm ci + - name: "Configure" + run: npm run configure - name: "Setup JDK 11" - uses: actions/setup-java@16cca5479d7c6b6843f6a6515640ba33c6501543 #v3.4.0 + uses: actions/setup-java@v3.10.0 with: java-version: 11 distribution: temurin cache: gradle - name: "Build Android app" + working-directory: ./native_template/android run: ./gradlew assembleAppstoreRelease assembleAndroidTest -DtestBuildType=release - working-directory: ./android - name: "Archive Android app" uses: actions/upload-artifact@v3.1.2 with: name: android-app - path: android/app/build/outputs/apk/**/*.apk + path: native_template/android/app/build/outputs/apk/**/*.apk ios-app: needs: [ios-bundle] runs-on: macos-12 @@ -237,9 +244,13 @@ jobs: - name: "Check out Native Template for Native Components Test Project" uses: actions/checkout@v3.4.0 with: - repository: mendix/native-content-test-app + repository: mendix/native-template ref: main - ssh-key: ${{ secrets.NATIVE_CONTENT_TEST_APP }} + path: native_template + - name: "Check out code" + uses: actions/checkout@v3.4.0 + with: + path: native_widgets - name: "Download iOS bundle and assets" uses: actions/download-artifact@v3.0.2 with: @@ -247,16 +258,20 @@ jobs: path: bundles/ios - name: "Copy files to the right location" run: | - mv bundles/ios/index.ios.bundle ios/Bundle/index.ios.bundle - mv bundles/ios/assets/assets ios/Bundle/ + mv bundles/ios/index.ios.bundle native_template/ios/Bundle/index.ios.bundle + mv bundles/ios/assets/assets native_template/ios/Bundle/ + mv native_widgets/configs/e2e/config.json native_template/ + mv native_widgets/configs/e2e/.dependencies native_template/ + mv native_widgets/configs/e2e/.native_dependencies native_template/ - name: "Set up Node" uses: actions/setup-node@v3.6.0 with: - node-version: 14 + node-version-file: .nvmrc cache: npm - cache-dependency-path: "**/package-lock.json" - name: "Install Node dependencies" run: npm ci + - name: "Configure" + run: npm run configure - name: "Setup Pods cache" uses: actions/cache@v3.3.1 with: @@ -268,13 +283,13 @@ jobs: run: pod install working-directory: ./ios - name: "Build iOS app" + working-directory: ./native_template/ios run: xcodebuild -workspace NativeTemplate.xcworkspace -scheme nativeTemplate -configuration Debug -sdk iphonesimulator -derivedDataPath build - working-directory: ./ios - name: "Archive iOS app" uses: actions/upload-artifact@v3.1.2 with: name: ios-app - path: ios/build/Build/Products/**/*.app + path: native_template/ios/build/Build/Products/**/*.app android-avd: runs-on: macos-12 steps: @@ -316,7 +331,6 @@ jobs: with: node-version-file: .nvmrc cache: yarn - cache-dependency-path: "**/yarn.lock" - name: "Install dependencies" run: yarn install --immutable --immutable-cache --check-cache - name: "Download project MDA file" @@ -402,7 +416,6 @@ jobs: with: node-version-file: .nvmrc cache: yarn - cache-dependency-path: "**/yarn.lock" - name: "Install dependencies" run: yarn install --immutable --immutable-cache --check-cache - name: "Download project MDA file" diff --git a/configs/e2e/.dependencies b/configs/e2e/.dependencies new file mode 100644 index 000000000..bb383e53c --- /dev/null +++ b/configs/e2e/.dependencies @@ -0,0 +1,14 @@ +{ + "react-native-maps": "0.31.1", + "react-native-geocoder": "0.5.0", + "react-native-action-button": "2.8.5", + "react-native-material-menu": "1.2.0", + "react-native-linear-gradient": "2.5.6", + "@react-native-community/netinfo": "5.9.7", + "@react-native-community/art": "1.2.0", + "react-native-system-navigation-bar": "1.0.2", + "react-native-camera": "3.40.0", + "react-native-view-shot": "3.1.2", + "react-native-blob-util": "0.16.2", + "react-native-file-viewer": "2.1.5" +} \ No newline at end of file diff --git a/configs/e2e/.native_dependencies b/configs/e2e/.native_dependencies new file mode 100644 index 000000000..605ea5d91 --- /dev/null +++ b/configs/e2e/.native_dependencies @@ -0,0 +1,20 @@ +{ + "react-native-maps": "0.31.1", + "react-native-geocoder": "0.5.0", + "react-native-device-info": "8.0.1", + "react-native-action-button": "2.8.5", + "react-native-material-menu": "1.2.0", + "react-native-linear-gradient": "2.5.6", + "@react-native-community/netinfo": "5.9.7", + "@react-native-community/art": "1.2.0", + "react-native-system-navigation-bar": "1.0.2", + "react-native-video": "5.2.1", + "@react-native-community/async-storage": "1.12.1", + "react-native-camera": "3.40.0", + "react-native-view-shot": "3.1.2", + "react-native-blob-util": "0.16.2", + "react-native-file-viewer": "2.1.5", + "react-native-localize": "1.4.2", + "react-native-image-picker": "5.0.1", + "react-native-permissions": "3.3.1" +} \ No newline at end of file diff --git a/configs/e2e/config.json b/configs/e2e/config.json new file mode 100644 index 000000000..d04e3077b --- /dev/null +++ b/configs/e2e/config.json @@ -0,0 +1,140 @@ +{ + "configVersion": 2, + "appIdentifier": "com.mendix.nativecomponentstestproject", + "appName": "NativeComponentsTestProject", + "bundleName": { + "main": "NativeComponent", + "dev": "NativeComponDev" + }, + "deviceTarget": { + "phone": true, + "tablet": false + }, + "orientation": { + "portrait": true, + "landscape": true + }, + "permissions": [ + { + "title": "Camera", + "name": "android.permission.CAMERA", + "platform": "android", + "required": false + }, + { + "title": "Fine Location", + "name": "android.permission.ACCESS_FINE_LOCATION", + "platform": "android", + "required": false + }, + { + "title": "Coarse Location", + "name": "android.permission.ACCESS_COARSE_LOCATION", + "platform": "android", + "required": false + }, + { + "title": "Background Location", + "name": "android.permission.ACCESS_BACKGROUND_LOCATION", + "platform": "android", + "required": false + }, + { + "title": "Location - When In Use Usage", + "name": "NSLocationWhenInUseUsageDescription", + "purpose": "To use that feature, the app needs access to your location.", + "platform": "ios", + "required": true + }, + { + "title": "Location - Always And When in Use Usage", + "name": "NSLocationAlwaysAndWhenInUseUsageDescription", + "purpose": "To use that feature, the app needs access to your location.", + "platform": "ios", + "required": true + }, + { + "title": "Camera Usage", + "name": "NSCameraUsageDescription", + "purpose": "The camera can be used to open apps by scanning a QR code.", + "platform": "ios", + "required": false + }, + { + "title": "Internet", + "name": "android.permission.INTERNET", + "platform": "android", + "required": true + }, + { + "title": "Read External Storage", + "name": "android.permission.READ_EXTERNAL_STORAGE", + "platform": "android", + "required": true + }, + { + "title": "System Alert Window", + "name": "android.permission.SYSTEM_ALERT_WINDOW", + "platform": "android", + "required": true + }, + { + "title": "Write External Storage", + "name": "android.permission.WRITE_EXTERNAL_STORAGE", + "platform": "android", + "required": true + }, + { + "title": "Location - Always Usage", + "name": "NSLocationAlwaysUsageDescription", + "purpose": "To use that feature, the app needs access to your location.", + "platform": "ios", + "required": true + } + ], + "capabilities": { + "deepLink": { + "value": "", + "enabled": false, + "android": { + "webLinks": [ + { + "host": "", + "path": "" + } + ] + } + }, + "maps": { + "value": "test", + "enabled": true + }, + "mapsIos": { + "enabled": false + }, + "pushNotifications": { + "enabled": true + }, + "crashlytics": { + "enabled": false + }, + "firebaseAndroid": { + "enabled": true + }, + "firebaseIos": { + "enabled": true + }, + "localNotifications": { + "enabled": true + }, + "appCenterOTA": { + "enabled": false + }, + "nativeOTA": { + "enabled": false + } + }, + "appVersion": "0.0.0", + "buildNumber": 1, + "runtimeUrl": "http://localhost:8080" +} \ No newline at end of file diff --git a/.github/configs/m2ee-native.yml b/configs/e2e/m2ee-native.yml similarity index 100% rename from .github/configs/m2ee-native.yml rename to configs/e2e/m2ee-native.yml