Skip to content

Commit 8fcb68e

Browse files
authored
[MOO-1562] Add widget, NT branch and SP version selection when triggering (#182)
2 parents 3cfb241 + 2d40a83 commit 8fcb68e

File tree

4 files changed

+121
-35
lines changed

4 files changed

+121
-35
lines changed

.github/scripts/mxbuild.Dockerfile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0
22
ARG MENDIX_VERSION
33

44
RUN \
5-
echo "Installing Java..." && \
5+
echo "Installing Java 17..." && \
66
apt-get -qq update && \
77
apt-get -qq install -y wget libgdiplus && \
8-
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 && \
9-
mkdir /usr/lib/jvm && \
8+
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 && \
9+
mkdir -p /usr/lib/jvm && \
1010
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
11-
rm /tmp/openjdk.tar.gz
11+
mv /usr/lib/jvm/jdk-17.0.2 /usr/lib/jvm/java-17-openjdk && \
12+
rm /tmp/openjdk.tar.gz
13+
1214
RUN \
1315
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
1416
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz && \
1517
mkdir /tmp/mxbuild && \
1618
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
1719
rm /tmp/mxbuild.tar.gz
20+
1821
RUN \
1922
apt-get -qq remove -y wget && \
2023
apt-get clean
24+
2125
RUN \
2226
echo "#!/bin/bash -x" >/bin/mxbuild && \
23-
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 && \
24-
chmod +x /bin/mxbuild
27+
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 && \
28+
chmod +x /bin/mxbuild
29+
2530
RUN \
2631
echo "#!/bin/bash -x" >/bin/mx && \
2732
echo "dotnet /tmp/mxbuild/modeler/mx.dll \$@" >>/bin/mx && \
28-
chmod +x /bin/mx
33+
chmod +x /bin/mx
34+
35+
ENV M2EE_TOOLS_JAR=/tmp/mxbuild/modeler/tools/m2ee-tools.jar

.github/workflows/NativePipeline.yml

Lines changed: 105 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,63 @@
11
name: Run Native Pipeline
22
on:
33
workflow_dispatch:
4+
inputs:
5+
mendix_version:
6+
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)"
7+
required: false
8+
default: ""
49

5-
# schedule:
6-
# - cron: "0 6 * * *"
10+
nt_branch:
11+
description: "Native Template branch to use (Default: master)"
12+
default: "master"
13+
required: false
14+
type: string
715

8-
# push:
9-
# branches: [master]
16+
workspace:
17+
description: "Select a widget to test (Default will run all)"
18+
required: true
19+
default: "*-native"
20+
type: choice
21+
options:
22+
- "*-native"
23+
- accordion-native
24+
- activity-indicator-native
25+
- animation-native
26+
- app-events-native
27+
- background-gradient-native
28+
- background-image-native
29+
- badge-native
30+
- bar-chart-native
31+
- barcode-scanner-native
32+
- bottom-sheet-native
33+
- carousel-native
34+
- color-picker-native
35+
- column-chart-native
36+
- feedback-native
37+
- floating-action-button-native
38+
- gallery-native
39+
- gallery-text-filter-native
40+
- image-native
41+
- intro-screen-native
42+
- line-chart-native
43+
- listview-swipe-native
44+
- maps-native
45+
- notifications-native
46+
- pie-doughnut-chart-native
47+
- popup-menu-native
48+
- progress-bar-native
49+
- qr-code-native
50+
- radio-buttons-native
51+
- range-slider-native
52+
- rating-native
53+
- repeater-native
54+
- safe-area-view-native
55+
- signature-native
56+
- slider-native
57+
- switch-native
58+
- toggle-buttons-native
59+
- video-player-native
60+
- web-view-native
1061

1162
pull_request:
1263
# branches: [master]
@@ -23,34 +74,49 @@ jobs:
2374
- name: "Determine scope"
2475
id: scope
2576
run: |
26-
echo "Event name: '${{ github.event_name }}'"
27-
if [ "${{ github.event_name }}" == "pull_request" ]; then
28-
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
77+
if [ -n "${{ github.event.inputs.workspace }}" ] && [ "${{ github.event.inputs.workspace }}" != "*-native" ]; then
78+
selected_workspaces=$(echo "${{ github.event.inputs.workspace }}" | sed 's/,/ /g')
79+
echo "scope=--all --include '${selected_workspaces}'" >> $GITHUB_OUTPUT
2980
else
30-
echo "scope=--include '*-native'" >> $GITHUB_OUTPUT
81+
if [ "${{ github.event_name }}" == "pull_request" ]; then
82+
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
83+
else
84+
echo "scope=--all--include '*-native'" >> $GITHUB_OUTPUT
85+
fi
3186
fi
3287
3388
- name: "Debug Scope Output"
3489
run: |
3590
echo "Scope is: ${{ steps.scope.outputs.scope }}"
91+
3692
mendix-version:
3793
runs-on: ubuntu-22.04
94+
outputs:
95+
mendix_version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}
3896
steps:
3997
- name: "Check out code"
4098
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
41-
- name: "Get Mendix version"
99+
- name: "Get Mendix version from JSON"
42100
id: get-mendix-version
43101
uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 # v0.2.0
44102
with:
45103
path: configs/e2e/mendix-versions.json
46104
prop_path: latest
47-
outputs:
48-
mendix-version: ${{ steps.get-mendix-version.outputs.prop }}
105+
- name: Set Mendix version
106+
id: set-mendix-version
107+
run: |
108+
if [[ -n "${{ github.event.inputs.mendix_version }}" ]]; then
109+
echo "MENDIX_VERSION=${{ github.event.inputs.mendix_version }}" >> $GITHUB_OUTPUT
110+
else
111+
echo "MENDIX_VERSION=${{ steps.get-mendix-version.outputs.prop }}" >> $GITHUB_OUTPUT
112+
fi
113+
- name: "Debug Mendix Version"
114+
run: |
115+
echo "Mendix Version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}"
116+
49117
docker-images:
50118
needs: mendix-version
51119
runs-on: ubuntu-22.04
52-
env:
53-
MENDIX_VERSION: ${{ needs.mendix-version.outputs.mendix-version }}
54120
steps:
55121
- name: "Login to GitHub Container Registry"
56122
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
@@ -60,7 +126,7 @@ jobs:
60126
password: ${{ secrets.GITHUB_TOKEN }}
61127
- name: "Check if docker image already exists"
62128
run: |
63-
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }} || EXIT_CODE=$?
129+
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} || EXIT_CODE=$?
64130
echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV
65131
- name: "Check out code"
66132
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -72,12 +138,11 @@ jobs:
72138
file: ./.github/scripts/mxbuild.Dockerfile
73139
context: ./.github/scripts
74140
build-args: |
75-
MENDIX_VERSION=${{ env.MENDIX_VERSION }}
141+
MENDIX_VERSION=${{ needs.mendix-version.outputs.mendix_version }}
76142
push: true
77-
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }}
78-
secrets: GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
143+
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
79144
resources:
80-
needs: scope
145+
needs: [scope, mendix-version]
81146
runs-on: ubuntu-22.04
82147
permissions:
83148
packages: read
@@ -111,7 +176,11 @@ jobs:
111176
project:
112177
needs: [resources, mendix-version]
113178
runs-on: ubuntu-22.04
114-
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
179+
container:
180+
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
181+
credentials:
182+
username: ${{ github.actor }}
183+
password: ${{ secrets.GITHUB_TOKEN }}
115184
steps:
116185
- name: "Make sure curl is installed"
117186
run: |
@@ -122,12 +191,14 @@ jobs:
122191
- name: "Extract test project"
123192
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
124193
with:
125-
args: unzip -qq project.zip
194+
args: unzip -qq project.zip -d .
126195
- name: "Download resources artifact"
127196
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
128197
with:
129198
name: resources
130199
path: resources
200+
- name: "List resources"
201+
run: ls -R resources
131202
- name: "Move widgets"
132203
shell: bash
133204
run: |
@@ -160,7 +231,11 @@ jobs:
160231
android-bundle:
161232
needs: [project, mendix-version]
162233
runs-on: ubuntu-22.04
163-
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
234+
container:
235+
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
236+
credentials:
237+
username: ${{ github.actor }}
238+
password: ${{ secrets.GITHUB_TOKEN }}
164239
steps:
165240
- name: "Check out code"
166241
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -176,7 +251,11 @@ jobs:
176251
ios-bundle:
177252
needs: [project, mendix-version]
178253
runs-on: ubuntu-22.04
179-
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
254+
container:
255+
image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
256+
credentials:
257+
username: ${{ github.actor }}
258+
password: ${{ secrets.GITHUB_TOKEN }}
180259
steps:
181260
- name: "Check out code"
182261
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -197,7 +276,7 @@ jobs:
197276
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
198277
with:
199278
repository: mendix/native-template
200-
ref: master
279+
ref: ${{ github.event.inputs.nt_branch || 'master' }}
201280
path: native-template
202281
- name: "Check out code"
203282
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -246,7 +325,7 @@ jobs:
246325
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
247326
with:
248327
repository: mendix/native-template
249-
ref: master
328+
ref: ${{ github.event.inputs.nt_branch || 'master' }}
250329
path: native-template
251330
- name: "Check out code"
252331
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
@@ -344,7 +423,7 @@ jobs:
344423
uses: ./.github/actions/start-runtime
345424
with:
346425
mda-file: automation.mda
347-
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
426+
mendix-version: ${{ needs.mendix-version.outputs.mendix_version }}
348427
- name: "Download Android app"
349428
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
350429
with:
@@ -438,7 +517,7 @@ jobs:
438517
uses: ./.github/actions/start-runtime
439518
with:
440519
mda-file: automation.mda
441-
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
520+
mendix-version: ${{ needs.mendix-version.outputs.mendix_version }}
442521
- name: "Download iOS app"
443522
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
444523
with:

configs/e2e/mendix-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"latest": "10.13.0.41393",
2+
"latest": "10.14.0.43709",
33
"8": "8.18.23.62193"
44
}

configs/e2e/native_dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"react-native-file-viewer": "2.1.5",
1717
"react-native-localize": "1.4.2",
1818
"react-native-image-picker": "5.0.1",
19-
"react-native-permissions": "3.3.1",
19+
"react-native-permissions": "4.1.5",
2020
"react-native-webview": "11.26.1"
2121
}

0 commit comments

Comments
 (0)