Skip to content

Commit 8e4f3a0

Browse files
committed
ci(native-pipeline): pin test project to a SHA; run update-widgets unconditionally
- Pin the mendix/Native-Mobile-Resources download to a commit SHA (NATIVE_MOBILE_RESOURCES_REF, single source of truth, overridable via a new test_project_ref dispatch input) instead of tracking a moving main; rename the ref-named archive dir back to Native-Mobile-Resources-main so downstream paths are unchanged. The repo publishes no tags, so a SHA is the only stable ref. - Split "Move widgets": the mpk overlay stays guarded, but `mx update-widgets` now runs unconditionally so a js-actions dispatch (or any run that builds no mpks) no longer leaves stale Atlas widget defs for the portable-app build.
1 parent b4522c0 commit 8e4f3a0

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

.github/workflows/NativePipeline.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ on:
1515
default: ""
1616
required: false
1717
type: string
18+
test_project_ref:
19+
description: "mendix/Native-Mobile-Resources ref (commit SHA) to build against (leave empty for the pinned default)"
20+
default: ""
21+
required: false
22+
type: string
1823
LOCAL_TEST_ARTIFACT_RUN_ID:
1924
description: "Workflow run ID for local artifact download (leave empty for normal CI). Use the full run ID from the URL, not the run number displayed in UI."
2025
required: false
@@ -96,6 +101,10 @@ env:
96101
# When "true" (set via the update_baselines dispatch input), the maestro run steps tolerate
97102
# assertScreenshot failures so a capture run can produce fresh baselines without going red.
98103
UPDATE_BASELINES: ${{ github.event.inputs.update_baselines || 'false' }}
104+
# Pin the test project (mendix/Native-Mobile-Resources) to a SHA for reproducibility instead
105+
# of tracking a moving `main`. Single source of truth — bump deliberately. The repo publishes
106+
# no tags, so a commit SHA is the only stable ref. Override per run via the dispatch input.
107+
NATIVE_MOBILE_RESOURCES_REF: ${{ github.event.inputs.test_project_ref || 'f0e7c2278578022cc742f82a087e6c4fff2f7159' }}
99108
permissions:
100109
packages: write
101110
jobs:
@@ -318,17 +327,24 @@ jobs:
318327
apt update
319328
apt install -y curl unzip
320329
- name: "Download test project"
321-
run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/main.zip
330+
# Pinned to a SHA (NATIVE_MOBILE_RESOURCES_REF) for reproducible builds.
331+
run: curl -L -o project.zip "https://github.com/mendix/Native-Mobile-Resources/archive/${NATIVE_MOBILE_RESOURCES_REF}.zip"
322332
- name: "Extract test project"
323-
run: unzip -qq project.zip -d .
333+
# GitHub names the archive's top dir after the ref (Native-Mobile-Resources-<ref>);
334+
# rename it back to the stable Native-Mobile-Resources-main that the rest of the job
335+
# references, so pinning the ref doesn't ripple through every downstream path.
336+
run: |
337+
unzip -qq project.zip -d .
338+
rm -rf Native-Mobile-Resources-main
339+
mv "Native-Mobile-Resources-${NATIVE_MOBILE_RESOURCES_REF}" Native-Mobile-Resources-main
324340
- name: "Download resources artifact"
325341
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
326342
with:
327343
name: resources
328344
path: resources
329345
- name: "List resources"
330346
run: ls -R resources
331-
- name: "Move widgets"
347+
- name: "Overlay built widget mpks"
332348
if: ${{ github.event.inputs.workspace != 'js-actions' }}
333349
shell: bash
334350
run: |
@@ -337,8 +353,14 @@ jobs:
337353
newPath="Native-Mobile-Resources-main/widgets/$(basename "$oldPath")"
338354
mv -f "$oldPath" "$newPath"
339355
done
340-
mx update-widgets --loose-version-check Native-Mobile-Resources-main/NativeComponentsTestProject.mpr
341356
fi
357+
- name: "Register widgets in the test project"
358+
# Run unconditionally: update-widgets must sync the project's widget definitions with the
359+
# mpks in widgets/ regardless of whether THIS run overlaid fresh ones. Previously it was
360+
# nested in the mpk-move guard, so a `js-actions` dispatch (or any run that builds no
361+
# mpks) skipped it and left stale Atlas widget defs for the portable-app build.
362+
shell: bash
363+
run: mx update-widgets --loose-version-check Native-Mobile-Resources-main/NativeComponentsTestProject.mpr
342364
- name: "Move mobile-resources"
343365
shell: bash
344366
run: |
@@ -666,8 +688,6 @@ jobs:
666688
- name: "Setup needed tools"
667689
id: setup-needed-tools
668690
uses: ./.github/actions/setup-tools
669-
with:
670-
mendix_version: ${{ needs.mendix-version.outputs.mendix_version }}
671691

672692
- name: "Start Mendix runtime"
673693
uses: ./.github/actions/start-mendix-runtime
@@ -762,8 +782,6 @@ jobs:
762782
- name: "Setup needed tools"
763783
id: setup-needed-tools
764784
uses: ./.github/actions/setup-tools
765-
with:
766-
mendix_version: ${{ needs.mendix-version.outputs.mendix_version }}
767785
- name: "Start Mendix runtime"
768786
uses: ./.github/actions/start-mendix-runtime
769787
with:
@@ -820,8 +838,6 @@ jobs:
820838
- name: "Setup needed tools"
821839
id: setup-needed-tools
822840
uses: ./.github/actions/setup-tools
823-
with:
824-
mendix_version: ${{ needs.mendix-version.outputs.mendix_version }}
825841
- name: "Start Mendix runtime"
826842
uses: ./.github/actions/start-mendix-runtime
827843
with:
@@ -904,8 +920,6 @@ jobs:
904920
- name: "Setup needed tools"
905921
id: setup-needed-tools
906922
uses: ./.github/actions/setup-tools
907-
with:
908-
mendix_version: ${{ needs.mendix-version.outputs.mendix_version }}
909923
- name: "Start Mendix runtime"
910924
uses: ./.github/actions/start-mendix-runtime
911925
with:

0 commit comments

Comments
 (0)