Skip to content

Commit 09b803f

Browse files
committed
Update build resources logic
1 parent 6dd334e commit 09b803f

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

.github/workflows/NativePipeline.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: "Debug Scope Output"
8585
run: |
8686
echo "Scope is: ${{ steps.scope.outputs.scope }}"
87-
echo "Widgets are: ${{ steps.scope.outputs.widgets }}"
87+
echo "Widgets or js actions are: ${{ steps.scope.outputs.widgets }}"
8888
mendix-version:
8989
runs-on: ubuntu-22.04
9090
outputs:
@@ -197,28 +197,39 @@ jobs:
197197
run: yarn install --immutable
198198
- name: "Force rebuild resources"
199199
run: |
200-
# Always build JS actions if needed
200+
# Build JS actions if needed
201201
if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
202202
[ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
203203
[ "${{ github.event_name }}" = "schedule" ]; then
204204
yarn workspace mobile-resources-native run build
205205
yarn workspace nanoflow-actions-native run build
206206
fi
207-
# Build the rest as usual
208-
yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build
209-
- name: "Unit test"
210-
run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test
211-
- name: "Run build for development"
212-
run: |
213-
if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
207+
208+
# Build widgets if needed (any specific widget, *-native, or nightly)
209+
if [ "${{ github.event.inputs.workspace }}" != "js-actions" ] || \
214210
[ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
215211
[ "${{ github.event_name }}" = "schedule" ]; then
216-
yarn workspace mobile-resources-native run build
217-
yarn workspace nanoflow-actions-native run build
212+
widgets=$(echo '${{ needs.scope.outputs.widgets }}' | jq -r '.[]')
213+
for w in $widgets; do
214+
# Skip JS actions if already built above
215+
if [ "$w" != "mobile-resources-native" ] && [ "$w" != "nanoflow-actions-native" ]; then
216+
yarn workspace $w run build
217+
fi
218+
done
218219
fi
219-
yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build
220-
env:
221-
NODE_OPTIONS: --max_old_space_size=6144
220+
- name: "Unit test"
221+
run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test
222+
# - name: "Run build for development"
223+
# run: |
224+
# if [ "${{ github.event.inputs.workspace }}" = "js-actions" ] || \
225+
# [ "${{ github.event.inputs.workspace }}" = "*-native" ] || \
226+
# [ "${{ github.event_name }}" = "schedule" ]; then
227+
# yarn workspace mobile-resources-native run build
228+
# yarn workspace nanoflow-actions-native run build
229+
# fi
230+
# yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build
231+
# env:
232+
# NODE_OPTIONS: --max_old_space_size=6144
222233
- name: "Upload JS actions resources artifact"
223234
if: ${{ github.event.inputs.workspace == 'js-actions' }}
224235
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"setup-mobile": "yarn setup-android && yarn setup-ios",
3333
"patch-package": "sh ./scripts/patch/patch-package.sh",
3434
"build:widgets": "node ./scripts/widget/buildWidgets.js",
35-
"test:maestro:ios": "bash maestro/run_maestro_tests.sh ios",
36-
"test:maestro:android": "bash maestro/run_maestro_tests.sh android"
35+
"test_widgets:maestro:ios": "bash maestro/run_maestro_widget_tests.sh ios",
36+
"test_widgets:maestro:android": "bash maestro/run_maestro_widget_tests.sh android"
3737
},
3838
"workspaces": {
3939
"packages": [

0 commit comments

Comments
 (0)