18
18
type : choice
19
19
options :
20
20
- " *-native"
21
+ - js-actions
21
22
- accordion-native
22
23
- activity-indicator-native
23
24
- animation-native
83
84
- name : " Debug Scope Output"
84
85
run : |
85
86
echo "Scope is: ${{ steps.scope.outputs.scope }}"
86
- echo "Widgets are: ${{ steps.scope.outputs.widgets }}"
87
+ echo "Widgets or js actions are: ${{ steps.scope.outputs.widgets }}"
87
88
mendix-version :
88
89
runs-on : ubuntu-22.04
89
90
outputs :
@@ -196,14 +197,35 @@ jobs:
196
197
run : yarn install --immutable
197
198
- name : " Force rebuild resources"
198
199
run : |
199
- yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build # Ensure all resources are rebuilt
200
+ # Build JS actions if needed
201
+ if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
202
+ [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
203
+ [ "${{ github.event_name }}" = "schedule" ]; then
204
+ yarn workspace mobile-resources-native run build
205
+ yarn workspace nanoflow-actions-native run build
206
+ fi
207
+
208
+ # Build widgets if needed (any specific widget, *-native, or nightly)
209
+ if [ "${{ github.event.inputs.workspace }}" != "js-actions" ] || \
210
+ [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
211
+ [ "${{ github.event_name }}" = "schedule" ]; then
212
+ widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]')
213
+ for w in $widgets; do
214
+ yarn workspace $w run build
215
+ done
216
+ fi
200
217
- name : " Unit test"
201
218
run : yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test
202
- - name : " Run build for development"
203
- run : yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build
204
- env :
205
- NODE_OPTIONS : --max_old_space_size=6144
206
- - name : " Upload resources artifact"
219
+ - name : " Upload JS actions resources artifact"
220
+ if : ${{ github.event.inputs.workspace == 'js-actions' }}
221
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
222
+ with :
223
+ name : resources
224
+ path : |
225
+ packages/jsActions/mobile-resources-native/dist/**/*
226
+ packages/jsActions/nanoflow-actions-native/dist/**/*
227
+ - name : " Upload widget and JS actions resources artifact"
228
+ if : ${{ github.event.inputs.workspace != 'js-actions' }}
207
229
uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
208
230
with :
209
231
name : resources
@@ -238,6 +260,7 @@ jobs:
238
260
- name : " List resources"
239
261
run : ls -R resources
240
262
- name : " Move widgets"
263
+ if : ${{ github.event.inputs.workspace != 'js-actions' }}
241
264
shell : bash
242
265
run : |
243
266
if compgen -G 'resources/pluggableWidgets/**/dist/*/*.mpk' > /dev/null; then
@@ -436,8 +459,9 @@ jobs:
436
459
name : ios-app
437
460
path : native-template/ios/build/Build/Products/**/*.app
438
461
439
- android-tests :
462
+ android-widget- tests :
440
463
needs : [scope, mendix-version, project, android-app]
464
+ if : ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }}
441
465
runs-on : ubuntu-22.04
442
466
timeout-minutes : 60
443
467
strategy :
@@ -518,7 +542,7 @@ jobs:
518
542
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
519
543
sudo udevadm control --reload-rules
520
544
sudo udevadm trigger --name-match=kvm
521
- - name : " Run the android tests"
545
+ - name : " Run android tests"
522
546
uses : reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.0.0
523
547
with :
524
548
api-level : 30
@@ -529,9 +553,9 @@ jobs:
529
553
disable-animations : true
530
554
script : |
531
555
chmod +x maestro/helpers/prepare_android.sh
532
- chmod +x maestro/run_maestro_tests .sh
556
+ chmod +x maestro/run_maestro_widget_tests .sh
533
557
bash maestro/helpers/prepare_android.sh
534
- bash maestro/run_maestro_tests .sh android "${{ matrix.widget }}"
558
+ bash maestro/run_maestro_widget_tests .sh android "${{ matrix.widget }}"
535
559
536
560
- name : " Archive runtime logs"
537
561
uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
@@ -555,8 +579,9 @@ jobs:
555
579
path : packages/pluggableWidgets/**/artifacts/
556
580
if-no-files-found : ignore
557
581
558
- ios-tests :
582
+ ios-widget- tests :
559
583
needs : [scope, mendix-version, project, ios-app]
584
+ if : ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }}
560
585
runs-on : macos-15
561
586
timeout-minutes : 60
562
587
strategy :
@@ -645,9 +670,9 @@ jobs:
645
670
- name : " Run iOS tests"
646
671
run : |
647
672
chmod +x maestro/helpers/prepare_ios.sh
648
- chmod +x maestro/run_maestro_tests .sh
673
+ chmod +x maestro/run_maestro_widget_tests .sh
649
674
bash maestro/helpers/prepare_ios.sh
650
- bash maestro/run_maestro_tests .sh ios "${{ matrix.widget }}"
675
+ bash maestro/run_maestro_widget_tests .sh ios "${{ matrix.widget }}"
651
676
652
677
- name : " Archive runtime logs"
653
678
uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
@@ -671,8 +696,176 @@ jobs:
671
696
path : packages/pluggableWidgets/**/artifacts/
672
697
if-no-files-found : ignore
673
698
699
+ android-js-tests :
700
+ if : ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}}
701
+ needs : [mendix-version, project, android-app]
702
+ runs-on : ubuntu-22.04
703
+ timeout-minutes : 90
704
+ steps :
705
+ - name : " Check out code"
706
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
707
+ with :
708
+ fetch-depth : 0
709
+ - name : " Set up node"
710
+ uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
711
+ with :
712
+ node-version-file : .nvmrc
713
+ cache : yarn
714
+ - name : " Install dependencies"
715
+ run : yarn install --immutable
716
+ - name : " Download project MDA file"
717
+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
718
+ with :
719
+ name : mda
720
+ - name : " Download Android app"
721
+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
722
+ with :
723
+ name : android-app
724
+ path : android-app
725
+ - name : " Start runtime"
726
+ uses : ./.github/actions/start-runtime
727
+ with :
728
+ mda-file : automation.mda
729
+ mendix-version : ${{ needs.mendix-version.outputs.mendix_version }}
730
+ - name : " Install Maestro"
731
+ run : |
732
+ mkdir -p $HOME/.local/bin
733
+ curl -L "https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" -o maestro.zip
734
+ unzip maestro.zip -d $HOME/.local/bin
735
+ chmod +x $HOME/.local/bin/maestro/bin/maestro
736
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
737
+ - name : Verify maestro
738
+ run : $HOME/.local/bin/maestro/bin/maestro --version
739
+ - name : Set up Android SDK
740
+ run : echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV
741
+ - name : Enable KVM
742
+ run : |
743
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
744
+ sudo udevadm control --reload-rules
745
+ sudo udevadm trigger --name-match=kvm
746
+ - name : " Run android tests"
747
+ uses : reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.0.0
748
+ with :
749
+ api-level : 30
750
+ target : google_apis
751
+ arch : x86_64
752
+ profile : pixel
753
+ emulator-options : " -no-window -gpu swiftshader_indirect -no-boot-anim -no-snapshot -memory 4096 -cores 4"
754
+ disable-animations : true
755
+ script : |
756
+ chmod +x maestro/helpers/prepare_android.sh
757
+ chmod +x maestro/run_maestro_jsactions_tests.sh
758
+ bash maestro/helpers/prepare_android.sh
759
+ bash maestro/run_maestro_jsactions_tests.sh android
760
+
761
+ - name : " Archive runtime logs"
762
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
763
+ if : always()
764
+ with :
765
+ name : android-runtime-logs-js-actions
766
+ path : log/*.log
767
+ if-no-files-found : ignore
768
+ - name : " Archive test screenshots"
769
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
770
+ if : always()
771
+ with :
772
+ name : android-screenshots-js-actions
773
+ path : ${{ github.workspace }}/maestro/images/actual/android/**/*.png
774
+ if-no-files-found : ignore
775
+ - name : " Archive artifacts"
776
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
777
+ if : always()
778
+ with :
779
+ name : android-artifacts-js-actions
780
+ path : packages/pluggableWidgets/**/artifacts/
781
+ if-no-files-found : ignore
782
+
783
+ ios-js-tests :
784
+ if : ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}}
785
+ needs : [mendix-version, project, ios-app]
786
+ runs-on : macos-15
787
+ timeout-minutes : 90
788
+ steps :
789
+ - name : " Check out code"
790
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
791
+ with :
792
+ fetch-depth : 0
793
+ - name : " Set up node"
794
+ uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
795
+ with :
796
+ node-version-file : .nvmrc
797
+ cache : yarn
798
+ - name : " Install dependencies"
799
+ run : |
800
+ yarn cache clean
801
+ yarn install --immutable
802
+ - name : " Download project MDA file"
803
+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
804
+ with :
805
+ name : mda
806
+ - name : " Start runtime"
807
+ uses : ./.github/actions/start-runtime
808
+ with :
809
+ mda-file : automation.mda
810
+ mendix-version : ${{ needs.mendix-version.outputs.mendix_version }}
811
+
812
+ - name : " Download iOS app"
813
+ uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
814
+ with :
815
+ name : ios-app
816
+ path : ios-app
817
+ - name : Check iOS App Path
818
+ run : ls ios-app
819
+
820
+ - name : " Verify Xcode CLI Tools"
821
+ run : |
822
+ if ! xcode-select --print-path; then
823
+ echo "Xcode CLI tools not set. Setting them now."
824
+ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
825
+ else
826
+ echo "Xcode CLI tools are already configured."
827
+ fi
828
+ - name : " Install Maestro"
829
+ run : |
830
+ mkdir -p $HOME/.local/bin
831
+ curl -L "https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" -o maestro.zip
832
+ unzip maestro.zip -d $HOME/.local/bin
833
+ chmod +x $HOME/.local/bin/maestro/bin/maestro
834
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
835
+ - name : " Verify maestro"
836
+ run : $HOME/.local/bin/maestro/bin/maestro --version
837
+ - name : " List Available Simulators"
838
+ run : xcrun simctl list devices
839
+ - name : " Run iOS tests"
840
+ run : |
841
+ chmod +x maestro/helpers/prepare_ios.sh
842
+ chmod +x maestro/run_maestro_jsactions_tests.sh
843
+ bash maestro/helpers/prepare_ios.sh
844
+ bash maestro/run_maestro_jsactions_tests.sh ios
845
+
846
+ - name : " Archive runtime logs"
847
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
848
+ if : always()
849
+ with :
850
+ name : ios-runtime-logs-js-actions
851
+ path : log/*.log
852
+ if-no-files-found : ignore
853
+ - name : " Archive test screenshots"
854
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
855
+ if : always()
856
+ with :
857
+ name : ios-screenshots-js-actions
858
+ path : ${{ github.workspace }}/maestro/images/actual/ios/**/*.png
859
+ if-no-files-found : ignore
860
+ - name : " Archive artifacts"
861
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
862
+ if : always()
863
+ with :
864
+ name : ios-artifacts-js-actions
865
+ path : packages/pluggableWidgets/**/artifacts/
866
+ if-no-files-found : ignore
674
867
compare-screenshots :
675
- needs : [scope, android-tests, ios-tests]
868
+ needs : [scope, android-widget- tests, ios-widget-tests, android-js-tests, ios-js -tests]
676
869
runs-on : ubuntu-latest
677
870
if : always()
678
871
env :
@@ -690,6 +883,10 @@ jobs:
690
883
gh run download ${{ github.run_id }} --name android-screenshots-${widget} --dir images/actual/android/ || true
691
884
ls -l images/actual/android/
692
885
done
886
+ # Download JS actions screenshots
887
+ echo "Downloading android-screenshots-js-actions"
888
+ gh run download ${{ github.run_id }} --name android-screenshots-js-actions --dir images/actual/android/ || true
889
+ ls -l images/actual/android/
693
890
694
891
- name : " Download iOS screenshots"
695
892
run : |
@@ -700,8 +897,11 @@ jobs:
700
897
gh run download ${{ github.run_id }} --name ios-screenshots-${widget} --dir images/actual/ios/ || true
701
898
ls -l images/actual/ios/
702
899
done
900
+ # Download JS actions screenshots
901
+ echo "Downloading ios-screenshots-js-actions"
902
+ gh run download ${{ github.run_id }} --name ios-screenshots-js-actions --dir images/actual/ios/ || true
903
+ ls -l images/actual/ios/
703
904
704
-
705
905
- name : " Set up node"
706
906
uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
707
907
with :
0 commit comments