From 658802017d437c8a25e88ccb1edef6b98fca7b52 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Tue, 2 Sep 2025 13:29:08 +0200 Subject: [PATCH 1/8] Force cleanup workspace --- .github/workflows/NativePipeline.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index e21c6244a..f294706c2 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -555,10 +555,24 @@ jobs: widget: ${{ fromJson(needs.scope.outputs.widgets) }} fail-fast: false steps: + - name: "Force cleanup workspace" + run: | + # Kill any Git processes + sudo pkill -f git || true + sudo pkill -f xcodebuild || true + + # Clean workspace completely + cd /Users/runner/work/native-widgets/ || true + rm -rf * .* 2>/dev/null || true + + # Wait a moment for processes to terminate + sleep 2 + continue-on-error: true - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 + clean: true - name: "Download project MDA file" uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: @@ -670,10 +684,25 @@ jobs: runs-on: macos-15 timeout-minutes: 90 steps: + - name: "Clean up any Git locks" + run: | + # Kill any hanging git processes + sudo pkill -f git || true + + # Remove any existing Git lock files + find . -name "*.lock" -type f -delete 2>/dev/null || true + + # Remove .git directory entirely for fresh start + rm -rf .git || true + + # Add a small random delay to stagger operations + sleep $((RANDOM % 10)) + continue-on-error: true - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 + clean: true - name: "Download project MDA file" uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: From 3fd642db0334088ea8216fd6fb3cae5e500c6df1 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Tue, 2 Sep 2025 14:05:34 +0200 Subject: [PATCH 2/8] feat: force clean workspace --- .github/workflows/NativePipeline.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index f294706c2..3a73bf346 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -561,9 +561,17 @@ jobs: sudo pkill -f git || true sudo pkill -f xcodebuild || true - # Clean workspace completely - cd /Users/runner/work/native-widgets/ || true - rm -rf * .* 2>/dev/null || true + # Only clean the repository contents, not the workspace structure + if [ -d "/Users/runner/work/native-widgets/native-widgets" ]; then + cd /Users/runner/work/native-widgets/native-widgets + # Remove git locks specifically + find . -name "*.lock" -type f -delete 2>/dev/null || true + # Remove .git directory for fresh clone + rm -rf .git 2>/dev/null || true + # Remove repository contents but keep the directory structure + rm -rf * 2>/dev/null || true + rm -rf .[!.]* 2>/dev/null || true + fi # Wait a moment for processes to terminate sleep 2 @@ -573,6 +581,7 @@ jobs: with: fetch-depth: 0 clean: true + ref: ${{ github.sha }} - name: "Download project MDA file" uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: From 45f92d9f44d1ee82113643adc41961990913b2a2 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Tue, 2 Sep 2025 15:11:51 +0200 Subject: [PATCH 3/8] feat: improve artifacts download from specific run --- .../action.yaml | 38 +++++++++++++-- .github/workflows/NativePipeline.yml | 48 +++++++++++++++++-- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/.github/actions/use-arficats-from-specific-run/action.yaml b/.github/actions/use-arficats-from-specific-run/action.yaml index ac4075172..694d61649 100644 --- a/.github/actions/use-arficats-from-specific-run/action.yaml +++ b/.github/actions/use-arficats-from-specific-run/action.yaml @@ -13,6 +13,9 @@ inputs: platform: description: "Platform (android or ios)" required: true + github_token: + description: "GitHub token for authentication" + required: true runs: using: "composite" steps: @@ -31,16 +34,43 @@ runs: shell: bash run: | unset GITHUB_TOKEN - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + echo "${{ inputs.github_token }}" | gh auth login --with-token - name: "Fetch artifact URL" id: fetch-artifacts shell: bash run: | - url=$(gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}/artifacts" --jq '.artifacts[] | select(.name == "${{ inputs.artifact_name }}") | .archive_download_url') + echo "Fetching artifacts for run ID: ${{ inputs.run_id }}" + echo "Looking for artifact: ${{ inputs.artifact_name }}" + echo "Note: Use the full run ID from the URL (e.g., 17402124525), not the run number from the UI (e.g., #1269)" + + # Check if the run exists + if ! gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}" > /dev/null 2>&1; then + echo "Error: Run ID ${{ inputs.run_id }} not found or not accessible" + echo "Make sure you're using the full run ID from the URL, not the run number displayed in the UI" + exit 1 + fi + + # Get the artifact URL + url=$(gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}/artifacts" --jq '.artifacts[] | select(.name == "${{ inputs.artifact_name }}") | .archive_download_url' 2>/dev/null || echo "") + + if [ -z "$url" ]; then + echo "Error: Artifact '${{ inputs.artifact_name }}' not found in run ${{ inputs.run_id }}" + echo "Available artifacts in this run:" + gh api "repos/${{ github.repository }}/actions/runs/${{ inputs.run_id }}/artifacts" --jq '.artifacts[].name' 2>/dev/null || echo "No artifacts found or run not accessible" + exit 1 + fi + + echo "Found artifact URL: $url" echo "artifacts_url=$url" >> $GITHUB_ENV - name: "Download and extract artifact" if: env.artifacts_url != '' shell: bash run: | - curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o ${{ inputs.platform }}-app.zip "$artifacts_url" - unzip ${{ inputs.platform }}-app.zip -d ${{ inputs.output_dir }} \ No newline at end of file + echo "Downloading artifact from: $artifacts_url" + curl -L -H "Authorization: token ${{ inputs.github_token }}" -o ${{ inputs.platform }}-app.zip "$artifacts_url" + + echo "Extracting artifact to: ${{ inputs.output_dir }}" + unzip ${{ inputs.platform }}-app.zip -d ${{ inputs.output_dir }} + + echo "Contents of ${{ inputs.output_dir }}:" + ls -la ${{ inputs.output_dir }}/ \ No newline at end of file diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 3a73bf346..1ff54d37a 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -16,7 +16,7 @@ on: required: false type: string LOCAL_TEST_ARTIFACT_RUN_ID: - description: "Workflow run ID for local artifact download (leave empty for normal CI)" + 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." required: false default: "" workspace: @@ -305,6 +305,8 @@ jobs: android-bundle: needs: [project, mendix-version] runs-on: ubuntu-22.04 + # Skip this job if we're using artifacts from a specific run + if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} container: image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} credentials: @@ -325,6 +327,8 @@ jobs: ios-bundle: needs: [project, mendix-version] runs-on: ubuntu-22.04 + # Skip this job if we're using artifacts from a specific run + if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} container: image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} credentials: @@ -345,6 +349,8 @@ jobs: android-app: needs: [android-bundle, determine-nt-version] runs-on: ubuntu-22.04 + # Skip this job if we're using artifacts from a specific run, but allow it to run if android-bundle was skipped + if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' && always() && (needs.android-bundle.result == 'success') }} steps: - name: Debug branch value run: echo "Using branch ${{ needs.determine-nt-version.outputs.nt_branch }}" @@ -413,6 +419,8 @@ jobs: ios-app: needs: [ios-bundle, determine-nt-version] runs-on: macos-13 + # Skip this job if we're using artifacts from a specific run, but allow it to run if ios-bundle was skipped + if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' && always() && (needs.ios-bundle.result == 'success') }} steps: - name: "Check out Native Template for Native Components Test Project" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -473,7 +481,8 @@ jobs: android-widget-tests: needs: [scope, mendix-version, project, android-app] - if: ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }} + # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped) + 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') }} runs-on: ubuntu-22.04 timeout-minutes: 60 strategy: @@ -499,7 +508,9 @@ jobs: run_id: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID }} output_dir: android-app platform: android + github_token: ${{ secrets.GITHUB_TOKEN }} - name: "Download Android app" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: android-app @@ -546,7 +557,8 @@ jobs: ios-widget-tests: needs: [scope, mendix-version, project, ios-app] - if: ${{ github.event.inputs.workspace != 'js-actions' || github.event_name == 'schedule' }} + # Run if project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped) + 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') }} runs-on: macos-15 timeout-minutes: 60 strategy: @@ -595,7 +607,9 @@ jobs: run_id: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID }} output_dir: ios-app platform: ios + github_token: ${{ secrets.GITHUB_TOKEN }} - name: "Download iOS app" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: ios-app @@ -630,8 +644,9 @@ jobs: test-type: ${{ matrix.widget }} android-js-tests: - if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}} needs: [mendix-version, project, android-app] + # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped) + if: ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions') && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }} runs-on: ubuntu-22.04 timeout-minutes: 90 steps: @@ -643,7 +658,18 @@ jobs: uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: mda + # Used only for local testing, will be empty on GitHub + - name: "Download Android app from specific run" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID != '' }} + uses: ./.github/actions/use-arficats-from-specific-run + with: + artifact_name: android-app + run_id: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID }} + output_dir: android-app + platform: android + github_token: ${{ secrets.GITHUB_TOKEN }} - name: "Download Android app" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: android-app @@ -688,8 +714,9 @@ jobs: test-type: js-actions ios-js-tests: - if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}} needs: [mendix-version, project, ios-app] + # Run if project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped) + if: ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions') && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }} runs-on: macos-15 timeout-minutes: 90 steps: @@ -716,7 +743,18 @@ jobs: uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: mda + # Used only for local testing, will be empty on GitHub + - name: "Download iOS app from specific run" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID != '' }} + uses: ./.github/actions/use-arficats-from-specific-run + with: + artifact_name: ios-app + run_id: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID }} + output_dir: ios-app + platform: ios + github_token: ${{ secrets.GITHUB_TOKEN }} - name: "Download iOS app" + if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: ios-app From 4ddc3c51c9f04b84aae40d610e34ad2fc207d935 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Tue, 2 Sep 2025 15:44:51 +0200 Subject: [PATCH 4/8] feat: fix git lock --- .github/workflows/NativePipeline.yml | 68 ++++++++++++++++++---------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 1ff54d37a..43a5bc20b 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -357,7 +357,7 @@ jobs: - name: "Check out Native Template for Native Components Test Project" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - repository: mendix/native-template + repository: mendix/native-template:wq ref: ${{ needs.determine-nt-version.outputs.nt_branch }} path: native-template - name: "Check out code" @@ -569,24 +569,31 @@ jobs: steps: - name: "Force cleanup workspace" run: | - # Kill any Git processes - sudo pkill -f git || true - sudo pkill -f xcodebuild || true + # Kill all Git and Xcode processes aggressively + sudo pkill -9 -f git || true + sudo pkill -9 -f xcodebuild || true + sudo pkill -9 -f node || true + + # Wait for processes to be killed + sleep 5 - # Only clean the repository contents, not the workspace structure - if [ -d "/Users/runner/work/native-widgets/native-widgets" ]; then - cd /Users/runner/work/native-widgets/native-widgets - # Remove git locks specifically - find . -name "*.lock" -type f -delete 2>/dev/null || true - # Remove .git directory for fresh clone - rm -rf .git 2>/dev/null || true - # Remove repository contents but keep the directory structure - rm -rf * 2>/dev/null || true - rm -rf .[!.]* 2>/dev/null || true + # Clean the workspace contents while preserving directory structure + cd /Users/runner/work/native-widgets + if [ -d "native-widgets" ]; then + cd native-widgets + + # Force remove all git state and locks with extreme prejudice + sudo rm -rf .git || true + find . -name "*.lock" -type f -exec sudo rm -f {} \; 2>/dev/null || true + find . -name ".git*" -exec sudo rm -rf {} \; 2>/dev/null || true + + # Remove all other contents + sudo find . -mindepth 1 -not -path "./.git*" -delete 2>/dev/null || true fi - # Wait a moment for processes to terminate - sleep 2 + # Final wait and process cleanup + sudo pkill -9 -f git || true + sleep 3 continue-on-error: true - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -722,17 +729,30 @@ jobs: steps: - name: "Clean up any Git locks" run: | - # Kill any hanging git processes - sudo pkill -f git || true + # Kill all git and related processes aggressively + sudo pkill -9 -f git || true + sudo pkill -9 -f node || true - # Remove any existing Git lock files - find . -name "*.lock" -type f -delete 2>/dev/null || true + # Wait for processes to be killed + sleep 5 - # Remove .git directory entirely for fresh start - rm -rf .git || true + # Clean the workspace contents while preserving directory structure + cd /Users/runner/work/native-widgets + if [ -d "native-widgets" ]; then + cd native-widgets + + # Force remove git state and locks + sudo rm -rf .git || true + find . -name "*.lock" -type f -exec sudo rm -f {} \; 2>/dev/null || true + find . -name ".git*" -exec sudo rm -rf {} \; 2>/dev/null || true + + # Remove all other contents + sudo find . -mindepth 1 -not -path "./.git*" -delete 2>/dev/null || true + fi - # Add a small random delay to stagger operations - sleep $((RANDOM % 10)) + # Final cleanup + sudo pkill -9 -f git || true + sleep $((RANDOM % 5 + 3)) continue-on-error: true - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 From 1565372c69831504ebe51a0b8637036ae35baf86 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Tue, 2 Sep 2025 17:32:01 +0200 Subject: [PATCH 5/8] feat: revert to state before fresh-checkout --- .github/workflows/NativePipeline.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 43a5bc20b..fc4885445 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -598,7 +598,8 @@ jobs: - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - fetch-depth: 0 + fetch-depth: 1 + fetch-tags: false clean: true ref: ${{ github.sha }} - name: "Download project MDA file" @@ -757,7 +758,8 @@ jobs: - name: "Check out code" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - fetch-depth: 0 + fetch-depth: 1 + fetch-tags: false clean: true - name: "Download project MDA file" uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 From 034850a7058a6aac78764376a1eef6f3675c8abf Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Wed, 3 Sep 2025 10:22:23 +0200 Subject: [PATCH 6/8] feat: use ubuntu-22.04 and macos-15 everywhere --- .github/workflows/NativePipeline.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index fc4885445..4ec5d702d 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -96,7 +96,7 @@ jobs: echo "Scope is: ${{ steps.scope.outputs.scope }}" echo "Widgets or js actions are: ${{ steps.scope.outputs.widgets }}" mendix-version: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: mendix_version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }} steps: @@ -162,7 +162,7 @@ jobs: echo "Final nt_branch value: ${{ steps.set-output.outputs.nt_branch }}" docker-images: needs: [mendix-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: "Login to GitHub Container Registry" uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 @@ -189,7 +189,7 @@ jobs: tags: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} resources: needs: [scope, mendix-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: packages: read contents: read @@ -245,7 +245,7 @@ jobs: packages/jsActions/nanoflow-actions-native/dist/**/* project: needs: [resources, mendix-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }} credentials: @@ -304,7 +304,7 @@ jobs: path: automation.mda android-bundle: needs: [project, mendix-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # Skip this job if we're using artifacts from a specific run if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} container: @@ -326,7 +326,7 @@ jobs: mda-file: automation.mda ios-bundle: needs: [project, mendix-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # Skip this job if we're using artifacts from a specific run if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' }} container: @@ -348,7 +348,7 @@ jobs: mda-file: automation.mda android-app: needs: [android-bundle, determine-nt-version] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # Skip this job if we're using artifacts from a specific run, but allow it to run if android-bundle was skipped if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' && always() && (needs.android-bundle.result == 'success') }} steps: @@ -357,7 +357,7 @@ jobs: - name: "Check out Native Template for Native Components Test Project" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - repository: mendix/native-template:wq + repository: mendix/native-template ref: ${{ needs.determine-nt-version.outputs.nt_branch }} path: native-template - name: "Check out code" @@ -418,7 +418,7 @@ jobs: path: native-template/android/app/build/outputs/apk/**/*.apk ios-app: needs: [ios-bundle, determine-nt-version] - runs-on: macos-13 + runs-on: macos-15 # Skip this job if we're using artifacts from a specific run, but allow it to run if ios-bundle was skipped if: ${{ github.event.inputs.LOCAL_TEST_ARTIFACT_RUN_ID == '' && always() && (needs.ios-bundle.result == 'success') }} steps: @@ -483,7 +483,7 @@ jobs: needs: [scope, mendix-version, project, android-app] # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped) 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') }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 60 strategy: max-parallel: 5 @@ -655,7 +655,7 @@ jobs: needs: [mendix-version, project, android-app] # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped) if: ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions') && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 90 steps: - name: "Check out code" From ffd7455f160a49cab81a39c03756b8d176e46ea1 Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Wed, 3 Sep 2025 12:39:08 +0200 Subject: [PATCH 7/8] feat: resolve review finding --- .github/workflows/NativePipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 4ec5d702d..ceabfa397 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -499,7 +499,7 @@ jobs: uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: mda - # Used only for local testing, will be empty on GitHub + # Used only when specific run id is provided when triggering the jbo - name: "Download Android app from specific run" if: ${{ env.LOCAL_TEST_ARTIFACT_RUN_ID != '' }} uses: ./.github/actions/use-arficats-from-specific-run From a0013726cb41c476af2505ee6f9a254c4ee79a9d Mon Sep 17 00:00:00 2001 From: Nikola Simsic Date: Wed, 3 Sep 2025 12:47:52 +0200 Subject: [PATCH 8/8] feat: include js actions when triggered from PR --- .github/scripts/determine-widget-scope.sh | 33 ++++++++++++++++++----- .github/workflows/NativePipeline.yml | 8 +++--- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/scripts/determine-widget-scope.sh b/.github/scripts/determine-widget-scope.sh index 333ca4e56..e3e886db7 100644 --- a/.github/scripts/determine-widget-scope.sh +++ b/.github/scripts/determine-widget-scope.sh @@ -10,6 +10,9 @@ current_commit="$4" # List of all native widgets all_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"]' +# Combined widgets and JS actions for default cases +all_widgets_and_js='["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","mobile-resources-native","nanoflow-actions-native"]' + if [ "$event_name" == "pull_request" ]; then if git cat-file -e "$before_commit" 2>/dev/null; then changed_files=$(git diff --name-only "$before_commit" "$current_commit") @@ -19,24 +22,42 @@ if [ "$event_name" == "pull_request" ]; then fi selected_workspaces="" + js_actions_changed=false + for file in $changed_files; do if [[ $file == packages/pluggableWidgets/* ]]; then widget=$(echo $file | cut -d'/' -f3) if [[ ! $selected_workspaces =~ $widget ]]; then selected_workspaces="$selected_workspaces $widget" fi + elif [[ $file == packages/jsActions/mobile-resources-native/* ]] || [[ $file == packages/jsActions/nanoflow-actions-native/* ]]; then + js_actions_changed=true fi done # Trim leading and trailing spaces from selected_workspaces selected_workspaces=$(echo $selected_workspaces | xargs) - if [[ -n "$selected_workspaces" ]]; then + # Build the final scope and widgets output + if [[ -n "$selected_workspaces" ]] && [[ "$js_actions_changed" == "true" ]]; then + # Both widgets and JS actions changed + # Convert space-separated widget names to JSON array format + widget_array=$(echo "$selected_workspaces" | sed 's/ /","/g') + echo "scope=--all --include '$selected_workspaces mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT + echo "widgets=[\"$widget_array\",\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT + elif [[ -n "$selected_workspaces" ]] && [[ "$js_actions_changed" == "false" ]]; then + # Only widgets changed + widget_array=$(echo "$selected_workspaces" | sed 's/ /","/g') echo "scope=--all --include '$selected_workspaces'" >> $GITHUB_OUTPUT - echo "widgets=[\"$selected_workspaces\"]" >> $GITHUB_OUTPUT + echo "widgets=[\"$widget_array\"]" >> $GITHUB_OUTPUT + elif [[ -z "$selected_workspaces" ]] && [[ "$js_actions_changed" == "true" ]]; then + # Only JS actions changed + echo "scope=--all --include 'mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT + echo "widgets=[\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT else - echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT - echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT + # No specific changes detected in widgets or JS actions, run everything + echo "scope=--all --include '*-native mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT + echo "widgets=${all_widgets_and_js}" >> $GITHUB_OUTPUT fi else if [ -n "$input_workspace" ] && [ "$input_workspace" != "*-native" ] && [ "$input_workspace" != "js-actions" ]; then @@ -47,8 +68,8 @@ else echo "scope=--all --include 'mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT echo "widgets=[\"mobile-resources-native\",\"nanoflow-actions-native\"]" >> $GITHUB_OUTPUT else - echo "scope=--all --include '*-native'" >> $GITHUB_OUTPUT - echo "widgets=${all_widgets}" >> $GITHUB_OUTPUT + echo "scope=--all --include '*-native mobile-resources-native nanoflow-actions-native'" >> $GITHUB_OUTPUT + echo "widgets=${all_widgets_and_js}" >> $GITHUB_OUTPUT fi fi diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index ceabfa397..60f852e8f 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -652,9 +652,9 @@ jobs: test-type: ${{ matrix.widget }} android-js-tests: - needs: [mendix-version, project, android-app] + needs: [scope, mendix-version, project, android-app] # Run if project succeeds and either android-app succeeds OR we're using custom artifacts (android-app was skipped) - if: ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions') && always() && needs.project.result == 'success' && (needs.android-app.result == 'success' || needs.android-app.result == 'skipped') }} + 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') }} runs-on: ubuntu-24.04 timeout-minutes: 90 steps: @@ -722,9 +722,9 @@ jobs: test-type: js-actions ios-js-tests: - needs: [mendix-version, project, ios-app] + needs: [scope, mendix-version, project, ios-app] # Run if project succeeds and either ios-app succeeds OR we're using custom artifacts (ios-app was skipped) - if: ${{ (github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions') && always() && needs.project.result == 'success' && (needs.ios-app.result == 'success' || needs.ios-app.result == 'skipped') }} + 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') }} runs-on: macos-15 timeout-minutes: 90 steps: