8888 outputs :
8989 scope : ${{ steps.scope.outputs.scope }}
9090 widgets : ${{ steps.scope.outputs.widgets }}
91+ widgets_to_test : ${{ steps.scope.outputs.widgets_to_test }}
92+ js_actions_changed : ${{ steps.scope.outputs.js_actions_changed }}
9193 steps :
9294 - name : " Check out code"
9395 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -101,7 +103,9 @@ jobs:
101103 - name : " Debug Scope Output"
102104 run : |
103105 echo "Scope is: ${{ steps.scope.outputs.scope }}"
104- echo "Widgets or js actions are: ${{ steps.scope.outputs.widgets }}"
106+ echo "Widgets to build: ${{ steps.scope.outputs.widgets }}"
107+ echo "Widgets to test: ${{ steps.scope.outputs.widgets_to_test }}"
108+ echo "JS actions changed: ${{ steps.scope.outputs.js_actions_changed }}"
105109 mendix-version :
106110 runs-on : ubuntu-24.04
107111 outputs :
@@ -214,23 +218,20 @@ jobs:
214218 run : yarn install --immutable
215219 - name : " Force rebuild resources"
216220 run : |
217- # Build JS actions if needed
218- if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
221+ # Build JS actions if needed (when js_actions_changed is true OR when workspace explicitly includes them)
222+ if [ "${{ needs.scope.outputs.js_actions_changed }}" = "true" ] || \
223+ [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
219224 [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
220225 [ "${{ github.event_name }}" = "schedule" ]; then
221226 yarn workspace mobile-resources-native run build
222227 yarn workspace nanoflow-actions-native run build
223228 fi
224229
225- # Build widgets if needed (any specific widget, *-native, or nightly)
226- if [ "${{ github.event.inputs.workspace }}" != "js-actions" ] || \
227- [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
228- [ "${{ github.event_name }}" = "schedule" ]; then
230+ # Build widgets from scope
229231 widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]')
230232 for w in $widgets; do
231233 yarn workspace $w run build
232234 done
233- fi
234235 - name : " Unit test"
235236 run : yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test
236237 - name : " Upload JS actions resources artifact"
@@ -269,8 +270,8 @@ jobs:
269270 uses : montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
270271 with :
271272 args : unzip -qq project.zip -d .
272- - name : " Rename extracted directory" # Doing this since mxbuild fails with - path too long
273- run : mv Native-Mobile-Resources-mx-version-10 Native-Mobile-Resources -mx10
273+ - name : " Rename test project directory"
274+ run : mv Native-Mobile-Resources-mx-version-10 NMR -mx10
274275 - name : " Download resources artifact"
275276 uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
276277 with :
@@ -284,28 +285,28 @@ jobs:
284285 run : |
285286 if compgen -G 'resources/pluggableWidgets/**/dist/*/*.mpk' > /dev/null; then
286287 for oldPath in resources/pluggableWidgets/**/dist/*/*.mpk; do
287- newPath=Native-Mobile-Resources -mx10/widgets/$(basename $oldPath)
288+ newPath=NMR -mx10/widgets/$(basename $oldPath)
288289 mv -f $oldPath $newPath
289290 done
290- mx update-widgets --loose-version-check Native-Mobile-Resources -mx10/NativeComponentsTestProject.mpr
291+ mx update-widgets --loose-version-check NMR -mx10/NativeComponentsTestProject.mpr
291292 fi
292293 - name : " Move mobile-resources"
293294 shell : bash
294295 run : |
295296 if compgen -G 'resources/jsActions/mobile-resources-native/dist/*' > /dev/null; then
296- rm -rf Native-Mobile-Resources -mx10/javascriptsource/nativemobileresources/actions/node_modules
297- mv -f resources/jsActions/mobile-resources-native/dist/* Native-Mobile-Resources -mx10/javascriptsource/nativemobileresources/actions/
297+ rm -rf NMR -mx10/javascriptsource/nativemobileresources/actions/node_modules
298+ mv -f resources/jsActions/mobile-resources-native/dist/* NMR -mx10/javascriptsource/nativemobileresources/actions/
298299 fi
299300 - name : " Move nanoflow-actions"
300301 shell : bash
301302 run : |
302303 if compgen -G 'resources/jsActions/nanoflow-actions-native/dist/*' > /dev/null; then
303- rm -rf Native-Mobile-Resources -mx10/javascriptsource/nanoflowcommons/actions/node_modules
304- mv -f resources/jsActions/nanoflow-actions-native/dist/* Native-Mobile-Resources -mx10/javascriptsource/nanoflowcommons/actions/
304+ rm -rf NMR -mx10/javascriptsource/nanoflowcommons/actions/node_modules
305+ mv -f resources/jsActions/nanoflow-actions-native/dist/* NMR -mx10/javascriptsource/nanoflowcommons/actions/
305306 fi
306307 - name : " Force rebuild test project"
307308 run : |
308- mxbuild -o automation.mda --loose-version-check Native-Mobile-Resources -mx10/NativeComponentsTestProject.mpr
309+ mxbuild -o automation.mda --loose-version-check NMR -mx10/NativeComponentsTestProject.mpr
309310 - name : " Upload MDA"
310311 uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
311312 with :
@@ -490,14 +491,14 @@ jobs:
490491
491492 android-widget-tests :
492493 needs : [scope, mendix-version, project, android-app]
493- # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped)
494- if : ${{ (github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule') && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }}
494+ # Run if widgets need testing (widgets_to_test is not empty) and project succeeds
495+ if : ${{ needs.scope.outputs.widgets_to_test != '[]' && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }}
495496 runs-on : ubuntu-24.04
496497 timeout-minutes : 60
497498 strategy :
498499 max-parallel : 5
499500 matrix :
500- widget : ${{ fromJson(needs.scope.outputs.widgets ) }}
501+ widget : ${{ fromJson(needs.scope.outputs.widgets_to_test ) }}
501502 fail-fast : false
502503 steps :
503504 - name : " Check out code"
@@ -566,14 +567,14 @@ jobs:
566567
567568 ios-widget-tests :
568569 needs : [scope, mendix-version, project, ios-app]
569- # Run if project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped)
570- if : ${{ (github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule') && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }}
570+ # Run if widgets need testing (widgets_to_test is not empty) and project succeeds
571+ if : ${{ needs.scope.outputs.widgets_to_test != '[]' && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }}
571572 runs-on : macos-15
572573 timeout-minutes : 60
573574 strategy :
574575 max-parallel : 5
575576 matrix :
576- widget : ${{ fromJson(needs.scope.outputs.widgets ) }}
577+ widget : ${{ fromJson(needs.scope.outputs.widgets_to_test ) }}
577578 fail-fast : false
578579 steps :
579580 - name : " Force cleanup workspace"
@@ -662,8 +663,8 @@ jobs:
662663
663664 android-js-tests :
664665 needs : [scope, mendix-version, project, android-app]
665- # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped)
666- if : ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions' || contains( needs.scope.outputs.widgets, 'mobile-resources-native') || contains(needs.scope.outputs.widgets, 'nanoflow-actions-native')) && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }}
666+ # Run if JS actions changed and project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped)
667+ if : ${{ needs.scope.outputs.js_actions_changed == 'true' && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }}
667668 runs-on : ubuntu-24.04
668669 timeout-minutes : 90
669670 steps :
@@ -732,8 +733,8 @@ jobs:
732733
733734 ios-js-tests :
734735 needs : [scope, mendix-version, project, ios-app]
735- # Run if project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped)
736- if : ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions' || contains( needs.scope.outputs.widgets, 'mobile-resources-native') || contains(needs.scope.outputs.widgets, 'nanoflow-actions-native')) && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }}
736+ # Run if JS actions changed and project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped)
737+ if : ${{ needs.scope.outputs.js_actions_changed == 'true' && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }}
737738 runs-on : macos-15
738739 timeout-minutes : 90
739740 steps :
@@ -830,7 +831,7 @@ jobs:
830831
831832 - name : " Download Android screenshots"
832833 run : |
833- widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]')
834+ widgets=$(echo '${{ needs.scope.outputs.widgets_to_test }}' | jq -r '.[]')
834835 mkdir -p images/actual/android/
835836 for widget in $widgets; do
836837 echo "Downloading android-screenshots-${widget}"
@@ -844,7 +845,7 @@ jobs:
844845
845846 - name : " Download iOS screenshots"
846847 run : |
847- widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]')
848+ widgets=$(echo '${{ needs.scope.outputs.widgets_to_test }}' | jq -r '.[]')
848849 mkdir -p images/actual/ios/
849850 for widget in $widgets; do
850851 echo "Downloading ios-screenshots-${widget}"
0 commit comments