Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic committed Feb 11, 2025
1 parent f61797d commit c7998a1
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/actions/create-native-bundle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
mkdir -p ${{ inputs.platform }}/assets
cd Native-Mobile-Resources-main/deployment/native && \
/tmp/mxbuild/modeler/tools/node/linux-x64/node \
/tmp/mxbuild/modeler/tools/node/node_modules/react-native/local-cli/cli.js \
/tmp/mxbuild/modeler/tools/node/node_modules/react-native/cli.js \
bundle --verbose --platform ${{ inputs.platform }} --dev false \
--config "$PWD/metro.config.js" \
--bundle-output $GITHUB_WORKSPACE/${{ inputs.platform }}/index.${{ inputs.platform }}.bundle \
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/start-runtime/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ runs:
- name: "Install Python dependencies"
run: pip install pyaml httplib2
shell: bash
- name: "Setup Java 11"
- name: "Setup Java 21"
id: setup-java
uses: actions/setup-java@v3.10.0
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
java-version: "21"
- name: "Extract deployment package"
run: |
mkdir project
Expand Down
23 changes: 12 additions & 11 deletions .github/scripts/mxbuild.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0
ARG MENDIX_VERSION

RUN \
echo "Installing Java 17..." && \
echo "Installing Java 21..." && \
apt-get -qq update && \
apt-get -qq install -y wget libgdiplus && \
wget -q https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz && \
wget -q https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz || { echo "Failed to download Java 21"; exit 1; } && \
mkdir -p /usr/lib/jvm && \
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
mv /usr/lib/jvm/jdk-17.0.2 /usr/lib/jvm/java-17-openjdk && \
rm /tmp/openjdk.tar.gz
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm || { echo "Failed to extract Java 21"; exit 1; } && \
ls /usr/lib/jvm && \
mv /usr/lib/jvm/jdk-21* /usr/lib/jvm/java-21-openjdk && \
rm /tmp/openjdk.tar.gz

RUN \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz || { echo "Failed to download mxbuild"; exit 1; } && \
mkdir /tmp/mxbuild && \
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
rm /tmp/mxbuild.tar.gz
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild || { echo "Failed to extract mxbuild"; exit 1; } && \
rm /tmp/mxbuild.tar.gz

RUN \
apt-get -qq remove -y wget && \
apt-get clean
apt-get clean

RUN \
echo "#!/bin/bash -x" >/bin/mxbuild && \
echo "dotnet /tmp/mxbuild/modeler/mxbuild.dll --java-home=/usr/lib/jvm/java-17-openjdk --java-exe-path=/usr/lib/jvm/java-17-openjdk/bin/java \$@" >>/bin/mxbuild && \
chmod +x /bin/mxbuild
echo "dotnet /tmp/mxbuild/modeler/mxbuild.dll --java-home=/usr/lib/jvm/java-21-openjdk --java-exe-path=/usr/lib/jvm/java-21-openjdk/bin/java \$@" >>/bin/mxbuild && \
chmod +x /bin/mxbuild

RUN \
echo "#!/bin/bash -x" >/bin/mx && \
Expand Down
111 changes: 54 additions & 57 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
else
echo "scope=--all--include '*-native'" >> $GITHUB_OUTPUT
echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT
fi
fi
Expand Down Expand Up @@ -124,15 +124,14 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: "Check if docker image already exists"
run: |
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} || EXIT_CODE=$?
echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
if: ${{ env.IMAGE_MISSING != 0 }}
- name: "Build mxbuild image"
if: ${{ env.IMAGE_MISSING != 0 }}
# if: ${{ env.IMAGE_MISSING != 0 }}
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
file: ./.github/scripts/mxbuild.Dockerfile
Expand Down Expand Up @@ -303,23 +302,32 @@ jobs:
- name: "Install dependencies"
working-directory: native-template
run: npm i
- name: "Setup JDK 17"
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
- name: "Setup JDK"
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: gradle
- name: "Build Android app"
working-directory: native-template/android
run: ./gradlew assembleAppstoreDebug assembleAppstoreDebugAndroidTest
run: |
./gradlew assembleAppstoreDebug assembleAppstoreDebugAndroidTest
if [ $? -ne 0 ]; then
echo "Build failed!"
exit 1
fi
- name: "List APK files"
run: |
echo "Listing APK files in the output directory:"
ls -R native-template/android/app/build/outputs/apk/
- name: "Archive Android app"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: android-app
path: native-template/android/app/build/outputs/apk/**/*.apk
ios-app:
needs: [ios-bundle]
runs-on: macos-12
runs-on: macos-13
steps:
- name: "Check out Native Template for Native Components Test Project"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -342,6 +350,14 @@ jobs:
node-version-file: native-template/.nvmrc
cache: npm
cache-dependency-path: native-template/package-lock.json
- name: "Cache iOS Build"
uses: actions/cache@v3
with:
path: native-template/ios/build
key: ${{ runner.os }}-ios-build-${{ hashFiles('native-template/ios/**/*.swift', 'native-template/ios/**/*.h', 'native-template/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-ios-build-
- name: "Copy files to the right location"
run: |
mv bundles/ios/index.ios.bundle native-template/ios/Bundle/index.ios.bundle
Expand All @@ -353,7 +369,7 @@ jobs:
run: npm i

- name: "Setup Pods cache"
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
uses: actions/cache@v3
with:
path: native-template/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
Expand All @@ -370,39 +386,10 @@ jobs:
with:
name: ios-app
path: native-template/ios/build/Build/Products/**/*.app
android-avd:
runs-on: macos-12
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: "Setup AVD cache"
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
id: avd-cache
with:
path: |
/Users/runner/.android/avd/*
/Users/runner/.android/adb*
/Users/runner/Library/Android/sdk/system-images/**/*
key: pixel_30_x86_64_default_3core_and_system_images
- name: "Create AVD and generate snapshot for caching"
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
with:
api-level: 30
target: default
arch: x86_64
profile: pixel
cores: 3
ram-size: 4096M
heap-size: 512M
avd-name: NATIVE_pixel_30
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "AVD created"

android-tests:
needs: [scope, mendix-version, project, android-app, android-avd]
runs-on: macos-12
needs: [scope, mendix-version, project, android-app]
runs-on: ubuntu-22.04
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -419,6 +406,8 @@ jobs:
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: mda
- name: "List contents of working directory before downloading Android app"
run: ls -R
- name: "Start runtime"
uses: ./.github/actions/start-runtime
with:
Expand All @@ -429,24 +418,32 @@ jobs:
with:
name: android-app
path: android-app
- name: "List contents of android-app directory after download"
run: ls -R android-app
- name: "Check if Android app APK exists"
run: |
if [ ! -f "android-app/appstore/debug/app-appstore-debug.apk" ]; then
echo "Error: Android app APK not found at path: android-app/appstore/debug/app-appstore-debug.apk"
exit 1
fi
- name: "Move android apps to correct location"
run: |
mkdir -p detox/apps
find android-app -type f -iname "*.apk" -exec mv {} detox/apps/ \;
- name: "Setup AVD cache"
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
id: avd-cache
with:
path: |
/Users/runner/.android/avd/*
/Users/runner/.android/adb*
/Users/runner/Library/Android/sdk/system-images/**/*
key: pixel_30_x86_64_default_3core_and_system_images
- name: "Check if APK files are present"
run: |
echo "Listing APK files in detox/apps directory:"
ls -R detox/apps
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: "Run tests"
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
uses: reactivecircus/android-emulator-runner@v2.32.0
with:
api-level: 30
target: default
target: google_apis
arch: x86_64
profile: pixel
cores: 3
Expand Down Expand Up @@ -489,7 +486,7 @@ jobs:
if-no-files-found: ignore
ios-tests:
needs: [scope, mendix-version, project, ios-app]
runs-on: macos-12
runs-on: macos-15
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -507,8 +504,8 @@ jobs:
with:
name: mda
# Used when new xCode version of simulator should be created
- name: Update Xcode
run: sudo xcode-select --switch /Applications/Xcode_14.0.1.app
# - name: Update Xcode
# run: sudo xcode-select --switch /Applications/Xcode_14.0.1.app
- name: "Clean detox framework cache"
run: npx detox clean-framework-cache
- name: "Build detox framework cache"
Expand Down
2 changes: 1 addition & 1 deletion configs/e2e/mendix-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"latest": "10.18.1.55792",
"latest": "10.19.0.57669",
"8": "8.18.23.62193"
}
4 changes: 2 additions & 2 deletions detox/detox.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const ANDROID_SDK_VERSION = "30"; // Set to 30 because: https://github.com/wix/Detox/issues/3071
const ANDROID_DEVICE_TYPE = "pixel";
const IOS_SDK_VERSION = "16.0";
const IOS_DEVICE_TYPE = "iPhone 14";
const IOS_SDK_VERSION = "18.1";
const IOS_DEVICE_TYPE = "iPhone 16";

module.exports = {
ANDROID_SDK_VERSION,
Expand Down

0 comments on commit c7998a1

Please sign in to comment.