Skip to content

Commit f24da20

Browse files
authored
Merge branch 'version/mx/10' into moo/moo-1995/fix-ios-silent-mode-audio
2 parents 276a2b0 + 1489c53 commit f24da20

File tree

95 files changed

+810
-727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+810
-727
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Archive Test Results
2+
description: Archive runtime logs, screenshots, and artifacts from test runs
3+
inputs:
4+
platform:
5+
description: Platform (android or ios)
6+
required: true
7+
test-type:
8+
description: Test type (widget name or js-actions)
9+
required: true
10+
workspace-path:
11+
description: Workspace path for artifacts
12+
required: false
13+
default: ${{ github.workspace }}
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Archive runtime logs
19+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
20+
if: always()
21+
with:
22+
name: ${{ inputs.platform }}-runtime-logs-${{ inputs.test-type }}
23+
path: log/*.log
24+
if-no-files-found: ignore
25+
26+
- name: Archive test screenshots
27+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
28+
if: always()
29+
with:
30+
name: ${{ inputs.platform }}-screenshots-${{ inputs.test-type }}
31+
path: ${{ inputs.workspace-path }}/maestro/images/actual/${{ inputs.platform }}/**/*.png
32+
if-no-files-found: ignore
33+
34+
- name: Archive artifacts
35+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
36+
if: always()
37+
with:
38+
name: ${{ inputs.platform }}-artifacts-${{ inputs.test-type }}
39+
path: packages/pluggableWidgets/**/artifacts/
40+
if-no-files-found: ignore

.github/actions/create-native-bundle/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ runs:
1616
apt install curl -y
1717
shell: bash
1818
- name: "Download test project"
19-
run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/main.zip
19+
run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/mx-version/10.zip
2020
shell: bash
2121
- name: "Extract test project"
2222
uses: montudor/action-zip@v1.0.0
2323
with:
2424
args: unzip -qq project.zip
25+
- name: "Rename extracted directory"
26+
run: mv Native-Mobile-Resources-mx-version-10 Native-Mobile-Resources-mx10
27+
shell: bash
2528
- name: "Extract deployment package"
2629
uses: montudor/action-zip@v1.0.0
2730
with:
28-
args: unzip -qq ${{ inputs.mda-file }} -d Native-Mobile-Resources-main/deployment
31+
args: unzip -qq ${{ inputs.mda-file }} -d Native-Mobile-Resources-mx10/deployment
2932
- name: "Create bundle for ${{ inputs.platform }}"
3033
run: |
3134
mkdir -p ${{ inputs.platform }}/assets
32-
cd Native-Mobile-Resources-main/deployment/native && \
35+
cd Native-Mobile-Resources-mx10/deployment/native && \
3336
/tmp/mxbuild/modeler/tools/node/linux-x64/node \
3437
/tmp/mxbuild/modeler/tools/node/node_modules/react-native/cli.js \
3538
bundle --verbose --platform ${{ inputs.platform }} --dev false \
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Setup Maestro"
2+
description: "Install and cache Maestro"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: "Cache Maestro"
7+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
8+
with:
9+
path: $HOME/.local/bin/maestro
10+
key: maestro-${{ runner.os }}-v1
11+
12+
- name: "Install Maestro"
13+
shell: bash
14+
run: |
15+
if [ ! -f "$HOME/.local/bin/maestro/bin/maestro" ]; then
16+
mkdir -p $HOME/.local/bin
17+
curl -L "https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" -o maestro.zip
18+
unzip maestro.zip -d $HOME/.local/bin
19+
chmod +x $HOME/.local/bin/maestro/bin/maestro
20+
fi
21+
echo "$HOME/.local/bin" >> $GITHUB_PATH
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Setup Node with Cached Dependencies'
2+
description: 'Set up Node.js and install dependencies with caching'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: "Set up node"
7+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
8+
with:
9+
node-version-file: .nvmrc
10+
11+
- name: "Cache yarn dependencies"
12+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
13+
with:
14+
path: |
15+
.yarn/cache
16+
.yarn/unplugged
17+
.yarn/install-state.gz
18+
node_modules
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-
22+
23+
- name: "Install dependencies"
24+
shell: bash
25+
run: |
26+
if [ ! -d "node_modules" ]; then
27+
yarn install --immutable
28+
else
29+
echo "Dependencies already installed from cache"
30+
fi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Setup Python Common"
2+
description: "Setup Python and install dependencies"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
7+
with:
8+
python-version: '3.12'
9+
- run: pip install PyYAML httplib2
10+
shell: bash
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Setup Tools"
2+
description: "Common setup for widget and js test jobs"
3+
inputs:
4+
mendix_version:
5+
description: "Mendix version"
6+
required: true
7+
outputs:
8+
java-path:
9+
description: "Path to the installed Java"
10+
value: ${{ steps.setup-java.outputs.path }}
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: "Setup Python and dependencies"
15+
uses: ./.github/actions/setup-python
16+
17+
- name: "Setup Node and dependencies"
18+
uses: ./.github/actions/setup-node-with-cache
19+
20+
- name: "Setup Java 21"
21+
id: setup-java
22+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 #v4
23+
with:
24+
distribution: "temurin"
25+
java-version: "21"
26+
27+
- name: "Cache Mendix runtime"
28+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4
29+
with:
30+
path: tmp/runtime.tar.gz
31+
key: mendix-runtime-${{ inputs.mendix_version }}
32+
33+
- name: "Cache m2ee-tools"
34+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4
35+
with:
36+
path: tmp/m2ee
37+
key: m2ee-tools-v1
38+
39+
- name: "Install Maestro"
40+
uses: ./.github/actions/setup-maestro
41+
42+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Setup Xcode CLI Tools"
2+
description: "Ensure Xcode CLI tools are configured"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: "Verify and set Xcode CLI tools"
7+
shell: bash
8+
run: |
9+
if ! xcode-select --print-path; then
10+
echo "Xcode CLI tools not set. Setting them now."
11+
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
12+
else
13+
echo "Xcode CLI tools are already configured."
14+
fi

.github/actions/start-runtime/action.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Download Artifact from Specific Run"
2+
description: "Download an artifact from a specific workflow run using GitHub CLI"
3+
inputs:
4+
artifact_name:
5+
description: "Name of the artifact to download"
6+
required: true
7+
run_id:
8+
description: "Workflow run ID"
9+
required: true
10+
output_dir:
11+
description: "Directory to extract the artifact"
12+
required: true
13+
platform:
14+
description: "Platform (android or ios)"
15+
required: true
16+
github_token:
17+
description: "GitHub token for authentication"
18+
required: true
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: "Install GitHub CLI"
23+
shell: bash
24+
run: |
25+
if ! command -v gh &> /dev/null; then
26+
if [[ "$RUNNER_OS" == "Linux" ]]; then
27+
sudo apt update
28+
sudo apt install -y gh
29+
elif [[ "$RUNNER_OS" == "macOS" ]]; then
30+
brew install gh
31+
fi
32+
fi
33+
- name: "Authenticate GitHub CLI"
34+
shell: bash
35+
run: |
36+
unset GITHUB_TOKEN
37+
echo "${{ inputs.github_token }}" | gh auth login --with-token
38+
- name: "Fetch artifact URL"
39+
id: fetch-artifacts
40+
shell: bash
41+
run: |
42+
echo "Fetching artifacts for run ID: ${{ inputs.run_id }}"
43+
echo "Looking for artifact: ${{ inputs.artifact_name }}"
44+
echo "Note: Use the full run ID from the URL (e.g., 17402124525), not the run number from the UI (e.g., #1269)"
45+
46+
# Check if the run exists
47+
if ! gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}" > /dev/null 2>&1; then
48+
echo "Error: Run ID ${{ inputs.run_id }} not found or not accessible"
49+
echo "Make sure you're using the full run ID from the URL, not the run number displayed in the UI"
50+
exit 1
51+
fi
52+
53+
# Get the artifact URL
54+
url=$(gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}/artifacts" --jq '.artifacts[] | select(.name == "${{ inputs.artifact_name }}") | .archive_download_url' 2>/dev/null || echo "")
55+
56+
if [ -z "$url" ]; then
57+
echo "Error: Artifact '${{ inputs.artifact_name }}' not found in run ${{ inputs.run_id }}"
58+
echo "Available artifacts in this run:"
59+
gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}/artifacts" --jq '.artifacts[].name' 2>/dev/null || echo "No artifacts found or run not accessible"
60+
exit 1
61+
fi
62+
63+
echo "Found artifact URL: $url"
64+
echo "artifacts_url=$url" >> $GITHUB_ENV
65+
- name: "Download and extract artifact"
66+
if: env.artifacts_url != ''
67+
shell: bash
68+
run: |
69+
echo "Downloading artifact from: $artifacts_url"
70+
curl -L -H "Authorization: token ${{ inputs.github_token }}" -o ${{ inputs.platform }}-app.zip "$artifacts_url"
71+
72+
echo "Extracting artifact to: ${{ inputs.output_dir }}"
73+
unzip ${{ inputs.platform }}-app.zip -d ${{ inputs.output_dir }}
74+
75+
echo "Contents of ${{ inputs.output_dir }}:"
76+
ls -la ${{ inputs.output_dir }}/

.github/scripts/determine-widget-scope.sh

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ current_commit="$4"
1010
# List of all native widgets
1111
all_widgets='["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","pie-doughnut-chart-native","popup-menu-native","progress-bar-native","progress-circle-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"]'
1212

13+
# Combined widgets and JS actions for default cases
14+
all_widgets_and_js='["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","pie-doughnut-chart-native","popup-menu-native","progress-bar-native","progress-circle-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","mobile-resources-native","nanoflow-actions-native"]'
15+
1316
if [ "$event_name" == "pull_request" ]; then
1417
if git cat-file -e "$before_commit" 2>/dev/null; then
1518
changed_files=$(git diff --name-only "$before_commit" "$current_commit")
@@ -19,24 +22,42 @@ if [ "$event_name" == "pull_request" ]; then
1922
fi
2023

2124
selected_workspaces=""
25+
js_actions_changed=false
26+
2227
for file in $changed_files; do
2328
if [[ $file == packages/pluggableWidgets/* ]]; then
2429
widget=$(echo $file | cut -d'/' -f3)
2530
if [[ ! $selected_workspaces =~ $widget ]]; then
2631
selected_workspaces="$selected_workspaces $widget"
2732
fi
33+
elif [[ $file == packages/jsActions/mobile-resources-native/* ]] || [[ $file == packages/jsActions/nanoflow-actions-native/* ]]; then
34+
js_actions_changed=true
2835
fi
2936
done
3037

3138
# Trim leading and trailing spaces from selected_workspaces
3239
selected_workspaces=$(echo $selected_workspaces | xargs)
3340

34-
if [[ -n "$selected_workspaces" ]]; then
41+
# Build the final scope and widgets output
42+
if [[ -n "$selected_workspaces" ]] && [[ "$js_actions_changed" == "true" ]]; then
43+
# Both widgets and JS actions changed
44+
# Convert space-separated widget names to JSON array format
45+
widget_array=$(echo "$selected_workspaces" | sed 's/ /","/g')
46+
echo "scope=--all --include '$selected_workspaces mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT
47+
echo "widgets=[\"$widget_array\",\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT
48+
elif [[ -n "$selected_workspaces" ]] && [[ "$js_actions_changed" == "false" ]]; then
49+
# Only widgets changed
50+
widget_array=$(echo "$selected_workspaces" | sed 's/ /","/g')
3551
echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT
36-
echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT
52+
echo "widgets=[\"$widget_array\"]" >> $GITHUB_OUTPUT
53+
elif [[ -z "$selected_workspaces" ]] && [[ "$js_actions_changed" == "true" ]]; then
54+
# Only JS actions changed
55+
echo "scope=--all --include 'mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT
56+
echo "widgets=[\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT
3757
else
38-
echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT
39-
echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT
58+
# No specific changes detected in widgets or JS actions, run everything
59+
echo "scope=--all --include '*-native mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT
60+
echo "widgets=${all_widgets_and_js}" >> $GITHUB_OUTPUT
4061
fi
4162
else
4263
if [ -n "$input_workspace" ] && [ "$input_workspace" != "*-native" ] && [ "$input_workspace" != "js-actions" ]; then
@@ -47,8 +68,8 @@ else
4768
echo "scope=--all --include 'mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT
4869
echo "widgets=[\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT
4970
else
50-
echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT
51-
echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT
71+
echo "scope=--all --include '*-native mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT
72+
echo "widgets=${all_widgets_and_js}" >> $GITHUB_OUTPUT
5273
fi
5374
fi
5475

0 commit comments

Comments
 (0)