Skip to content

Commit

Permalink
[MOO-1562] Add widget, NT branch and SP version selection when trigge…
Browse files Browse the repository at this point in the history
…ring (#182)
  • Loading branch information
NikolaSimsic authored Oct 9, 2024
2 parents 3cfb241 + 2d40a83 commit 8fcb68e
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 35 deletions.
21 changes: 14 additions & 7 deletions .github/scripts/mxbuild.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0
ARG MENDIX_VERSION

RUN \
echo "Installing Java..." && \
echo "Installing Java 17..." && \
apt-get -qq update && \
apt-get -qq install -y wget libgdiplus && \
wget -q https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz && \
mkdir /usr/lib/jvm && \
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 && \
mkdir -p /usr/lib/jvm && \
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
rm /tmp/openjdk.tar.gz
mv /usr/lib/jvm/jdk-17.0.2 /usr/lib/jvm/java-17-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 && \
mkdir /tmp/mxbuild && \
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
rm /tmp/mxbuild.tar.gz

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

RUN \
echo "#!/bin/bash -x" >/bin/mxbuild && \
echo "dotnet /tmp/mxbuild/modeler/mxbuild.dll --java-home=/usr/lib/jvm/jdk-11.0.2 --java-exe-path=/usr/lib/jvm/jdk-11.0.2/bin/java \$@" >>/bin/mxbuild && \
chmod +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

RUN \
echo "#!/bin/bash -x" >/bin/mx && \
echo "dotnet /tmp/mxbuild/modeler/mx.dll \$@" >>/bin/mx && \
chmod +x /bin/mx
chmod +x /bin/mx

ENV M2EE_TOOLS_JAR=/tmp/mxbuild/modeler/tools/m2ee-tools.jar
131 changes: 105 additions & 26 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,63 @@
name: Run Native Pipeline
on:
workflow_dispatch:
inputs:
mendix_version:
description: "Provide the SP version to be used (e.g., 10.14.0.43709) - has to be a released version (Default: latest from Mendix versions.json)"
required: false
default: ""

# schedule:
# - cron: "0 6 * * *"
nt_branch:
description: "Native Template branch to use (Default: master)"
default: "master"
required: false
type: string

# push:
# branches: [master]
workspace:
description: "Select a widget to test (Default will run all)"
required: true
default: "*-native"
type: choice
options:
- "*-native"
- accordion-native
- activity-indicator-native
- animation-native
- app-events-native
- background-gradient-native
- background-image-native
- badge-native
- bar-chart-native
- barcode-scanner-native
- bottom-sheet-native
- carousel-native
- color-picker-native
- column-chart-native
- feedback-native
- floating-action-button-native
- gallery-native
- gallery-text-filter-native
- image-native
- intro-screen-native
- line-chart-native
- listview-swipe-native
- maps-native
- notifications-native
- pie-doughnut-chart-native
- popup-menu-native
- progress-bar-native
- qr-code-native
- radio-buttons-native
- range-slider-native
- rating-native
- repeater-native
- safe-area-view-native
- signature-native
- slider-native
- switch-native
- toggle-buttons-native
- video-player-native
- web-view-native

pull_request:
# branches: [master]
Expand All @@ -23,34 +74,49 @@ jobs:
- name: "Determine scope"
id: scope
run: |
echo "Event name: '${{ github.event_name }}'"
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
if [ -n "${{ github.event.inputs.workspace }}" ] && [ "${{ github.event.inputs.workspace }}" != "*-native" ]; then
selected_workspaces=$(echo "${{ github.event.inputs.workspace }}" | sed 's/,/ /g')
echo "scope=--all --include '${selected_workspaces}'" >> $GITHUB_OUTPUT
else
echo "scope=--include '*-native'" >> $GITHUB_OUTPUT
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
else
echo "scope=--all--include '*-native'" >> $GITHUB_OUTPUT
fi
fi
- name: "Debug Scope Output"
run: |
echo "Scope is: ${{ steps.scope.outputs.scope }}"
mendix-version:
runs-on: ubuntu-22.04
outputs:
mendix_version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: "Get Mendix version"
- name: "Get Mendix version from JSON"
id: get-mendix-version
uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 # v0.2.0
with:
path: configs/e2e/mendix-versions.json
prop_path: latest
outputs:
mendix-version: ${{ steps.get-mendix-version.outputs.prop }}
- name: Set Mendix version
id: set-mendix-version
run: |
if [[ -n "${{ github.event.inputs.mendix_version }}" ]]; then
echo "MENDIX_VERSION=${{ github.event.inputs.mendix_version }}" >> $GITHUB_OUTPUT
else
echo "MENDIX_VERSION=${{ steps.get-mendix-version.outputs.prop }}" >> $GITHUB_OUTPUT
fi
- name: "Debug Mendix Version"
run: |
echo "Mendix Version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}"
docker-images:
needs: mendix-version
runs-on: ubuntu-22.04
env:
MENDIX_VERSION: ${{ needs.mendix-version.outputs.mendix-version }}
steps:
- name: "Login to GitHub Container Registry"
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
Expand All @@ -60,7 +126,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Check if docker image already exists"
run: |
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }} || EXIT_CODE=$?
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
Expand All @@ -72,12 +138,11 @@ jobs:
file: ./.github/scripts/mxbuild.Dockerfile
context: ./.github/scripts
build-args: |
MENDIX_VERSION=${{ env.MENDIX_VERSION }}
MENDIX_VERSION=${{ needs.mendix-version.outputs.mendix_version }}
push: true
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }}
secrets: GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
resources:
needs: scope
needs: [scope, mendix-version]
runs-on: ubuntu-22.04
permissions:
packages: read
Expand Down Expand Up @@ -111,7 +176,11 @@ jobs:
project:
needs: [resources, mendix-version]
runs-on: ubuntu-22.04
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
container:
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Make sure curl is installed"
run: |
Expand All @@ -122,12 +191,14 @@ jobs:
- name: "Extract test project"
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
with:
args: unzip -qq project.zip
args: unzip -qq project.zip -d .
- name: "Download resources artifact"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: resources
path: resources
- name: "List resources"
run: ls -R resources
- name: "Move widgets"
shell: bash
run: |
Expand Down Expand Up @@ -160,7 +231,11 @@ jobs:
android-bundle:
needs: [project, mendix-version]
runs-on: ubuntu-22.04
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
container:
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -176,7 +251,11 @@ jobs:
ios-bundle:
needs: [project, mendix-version]
runs-on: ubuntu-22.04
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
container:
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -197,7 +276,7 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
repository: mendix/native-template
ref: master
ref: ${{ github.event.inputs.nt_branch || 'master' }}
path: native-template
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand Down Expand Up @@ -246,7 +325,7 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
repository: mendix/native-template
ref: master
ref: ${{ github.event.inputs.nt_branch || 'master' }}
path: native-template
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand Down Expand Up @@ -344,7 +423,7 @@ jobs:
uses: ./.github/actions/start-runtime
with:
mda-file: automation.mda
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
mendix-version: ${{ needs.mendix-version.outputs.mendix_version }}
- name: "Download Android app"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
Expand Down Expand Up @@ -438,7 +517,7 @@ jobs:
uses: ./.github/actions/start-runtime
with:
mda-file: automation.mda
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
mendix-version: ${{ needs.mendix-version.outputs.mendix_version }}
- name: "Download iOS app"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
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.13.0.41393",
"latest": "10.14.0.43709",
"8": "8.18.23.62193"
}
2 changes: 1 addition & 1 deletion configs/e2e/native_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"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",
"react-native-permissions": "4.1.5",
"react-native-webview": "11.26.1"
}

0 comments on commit 8fcb68e

Please sign in to comment.