6
6
description : " Provide the SP version to be used (e.g., 10.14.0.43709) - has to be a released version (Default: latest from Mendix versions.json)"
7
7
required : false
8
8
default : " "
9
-
10
9
nt_branch :
11
- description : " Native Template branch to use (Default: master )"
12
- default : " master "
10
+ description : " Native Template branch/tag to use (Leave empty to auto-select based on Mendix version )"
11
+ default : " "
13
12
required : false
14
13
type : string
15
-
16
14
workspace :
17
15
description : " Select a widget to test (Default will run all)"
18
16
required : true
59
57
- video-player-native
60
58
- web-view-native
61
59
60
+ # Run at 0:00 UTC (2:00 AM CET time during summer, 1:00 AM during winter)
61
+ schedule :
62
+ - cron : ' 0 0 * * *'
62
63
# Trigger on PR
63
64
# pull_request:
64
-
65
-
66
65
permissions :
67
66
packages : write
68
-
69
67
jobs :
70
68
scope :
71
69
runs-on : ubuntu-latest
@@ -77,56 +75,15 @@ jobs:
77
75
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
78
76
with :
79
77
fetch-depth : 2 # Fetch the latest two commits and its parent commit
80
-
81
78
- name : " Determine scope"
82
79
id : scope
83
80
run : |
84
- if [ "${{ github.event_name }}" == "pull_request" ]; then
85
- if git cat-file -e ${{ github.event.before }} 2>/dev/null; then
86
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
87
- else
88
- echo "Previous commit not found, using HEAD~1 as fallback"
89
- changed_files=$(git diff --name-only HEAD~1 ${{ github.sha }})
90
- fi
91
-
92
- selected_workspaces=""
93
- for file in $changed_files; do
94
- if [[ $file == packages/pluggableWidgets/* ]]; then
95
- widget=$(echo $file | cut -d'/' -f3)
96
- if [[ ! $selected_workspaces =~ $widget ]]; then
97
- selected_workspaces="$selected_workspaces $widget"
98
- fi
99
- fi
100
- done
101
-
102
- # Trim leading and trailing spaces from selected_workspaces
103
- selected_workspaces=$(echo $selected_workspaces | xargs)
104
-
105
- if [[ -n "$selected_workspaces" ]]; then
106
- echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT
107
- echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT
108
- else
109
- 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"]'
110
- echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT
111
- echo "widgets=${widgets}" >> $GITHUB_OUTPUT
112
- fi
113
- else
114
- if [ -n "${{ github.event.inputs.workspace }}" ] && [ "${{ github.event.inputs.workspace }}" != "*-native" ]; then
115
- selected_workspaces=$(echo "${{ github.event.inputs.workspace }}" | sed 's/,/ /g')
116
- echo "scope=--all --include '${selected_workspaces}'" >> $GITHUB_OUTPUT
117
- echo "widgets=[\"${{ github.event.inputs.workspace }}\"]" >> $GITHUB_OUTPUT
118
- else
119
- 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"]'
120
- echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT
121
- echo "widgets=${widgets}" >> $GITHUB_OUTPUT
122
- fi
123
- fi
124
-
81
+ chmod +x ./.github/scripts/determine-widget-scope.sh
82
+ ./.github/scripts/determine-widget-scope.sh "${{ github.event_name }}" "${{ github.event.inputs.workspace }}" "${{ github.event.before }}" "${{ github.sha }}"
125
83
- name : " Debug Scope Output"
126
84
run : |
127
85
echo "Scope is: ${{ steps.scope.outputs.scope }}"
128
86
echo "Widgets are: ${{ steps.scope.outputs.widgets }}"
129
-
130
87
mendix-version :
131
88
runs-on : ubuntu-22.04
132
89
outputs :
@@ -151,9 +108,49 @@ jobs:
151
108
- name : " Debug Mendix Version"
152
109
run : |
153
110
echo "Mendix Version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}"
154
-
111
+ determine-nt-version :
112
+ needs : [mendix-version]
113
+ runs-on : ubuntu-latest
114
+ outputs :
115
+ nt_branch : ${{ steps.set-output.outputs.nt_branch }}
116
+ steps :
117
+ - name : " Check out code"
118
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
119
+ - name : " Check if nt_branch was specified"
120
+ id : check-input
121
+ run : |
122
+ if [[ -n "${{ github.event.inputs.nt_branch }}" ]]; then
123
+ echo "Using specified nt_branch: ${{ github.event.inputs.nt_branch }}"
124
+ echo "nt_branch=${{ github.event.inputs.nt_branch }}" >> $GITHUB_OUTPUT
125
+ echo "source=input" >> $GITHUB_OUTPUT
126
+ else
127
+ echo "No nt_branch specified, will determine from mendix_version"
128
+ echo "source=auto" >> $GITHUB_OUTPUT
129
+ fi
130
+ - name : " Download mendix_version.json from native-template repo"
131
+ if : steps.check-input.outputs.source == 'auto'
132
+ run : |
133
+ curl -s -o mendix_version.json https://raw.githubusercontent.com/mendix/native-template/master/mendix_version.json
134
+ cat mendix_version.json
135
+ - name : " Determine Native Template version based on Mendix version"
136
+ if : steps.check-input.outputs.source == 'auto'
137
+ id : determine-nt-branch
138
+ run : |
139
+ pip install requests packaging
140
+ python ./.github/scripts/determine-nt-version.py "${{ needs.mendix-version.outputs.mendix_version }}"
141
+ - name : " Set output nt_branch"
142
+ id : set-output
143
+ run : |
144
+ if [[ "${{ steps.check-input.outputs.source }}" == "input" ]]; then
145
+ echo "nt_branch=${{ github.event.inputs.nt_branch }}" >> $GITHUB_OUTPUT
146
+ else
147
+ echo "nt_branch=${{ steps.determine-nt-branch.outputs.nt_branch }}" >> $GITHUB_OUTPUT
148
+ fi
149
+ - name : " Debug final branch output"
150
+ run : |
151
+ echo "Final nt_branch value: ${{ steps.set-output.outputs.nt_branch }}"
155
152
docker-images :
156
- needs : mendix-version
153
+ needs : [ mendix-version]
157
154
runs-on : ubuntu-22.04
158
155
steps :
159
156
- name : " Login to GitHub Container Registry"
@@ -311,14 +308,16 @@ jobs:
311
308
platform : ios
312
309
mda-file : automation.mda
313
310
android-app :
314
- needs : [android-bundle]
311
+ needs : [android-bundle, determine-nt-version ]
315
312
runs-on : ubuntu-22.04
316
313
steps :
314
+ - name : Debug branch value
315
+ run : echo "Using branch ${{ needs.determine-nt-version.outputs.nt_branch }}"
317
316
- name : " Check out Native Template for Native Components Test Project"
318
317
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
319
318
with :
320
319
repository : mendix/native-template
321
- ref : ${{ github.event.inputs .nt_branch || 'master' }}
320
+ ref : ${{ needs.determine-nt-version.outputs .nt_branch }}
322
321
path : native-template
323
322
- name : " Check out code"
324
323
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -377,14 +376,14 @@ jobs:
377
376
name : android-app
378
377
path : native-template/android/app/build/outputs/apk/**/*.apk
379
378
ios-app :
380
- needs : [ios-bundle]
379
+ needs : [ios-bundle, determine-nt-version ]
381
380
runs-on : macos-13
382
381
steps :
383
382
- name : " Check out Native Template for Native Components Test Project"
384
383
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
385
384
with :
386
385
repository : mendix/native-template
387
- ref : ${{ github.event.inputs .nt_branch || 'master' }}
386
+ ref : ${{ needs.determine-nt-version.outputs .nt_branch }}
388
387
path : native-template
389
388
- name : " Check out code"
390
389
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
0 commit comments