From 1823be79ce7910e282d34e9540b3dfbebefbd213 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 7 Aug 2026 11:37:04 +0800 Subject: [PATCH] fix(ci): provision native Android resources for frozen current-contract targets (#120081) --- .github/workflows/ci.yml | 4 +++- test/scripts/ci-workflow-guards.test.ts | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a48b5d38e1f..49f75503bab8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,6 +113,7 @@ jobs: run_openclawkit_tests: ${{ steps.manifest.outputs.run_openclawkit_tests }} run_ios_build: ${{ steps.manifest.outputs.run_ios_build }} run_android_job: ${{ steps.manifest.outputs.run_android_job }} + use_compatible_android_ci: ${{ steps.manifest.outputs.use_compatible_android_ci }} run_protocol_event_coverage: ${{ steps.manifest.outputs.run_protocol_event_coverage }} android_matrix: ${{ steps.manifest.outputs.android_matrix }} steps: @@ -708,6 +709,7 @@ jobs: run_openclawkit_tests: runMacos && supportsOpenClawKitTests, run_ios_build: runIosBuild, run_android_job: runAndroid, + use_compatible_android_ci: useCompatibleAndroidCi, run_protocol_event_coverage: runProtocolEventCoverage, android_matrix: createMatrix( runAndroid @@ -3483,7 +3485,7 @@ jobs: uses: ./.ci-workflow/.github/actions/setup-android-toolchain - name: Setup Node environment for native resources - if: needs.preflight.outputs.compatibility_target != 'true' + if: needs.preflight.outputs.use_compatible_android_ci != 'true' uses: ./.github/actions/setup-node-env with: install-bun: "false" diff --git a/test/scripts/ci-workflow-guards.test.ts b/test/scripts/ci-workflow-guards.test.ts index 0f7c7ac9b26d..2bf75d132059 100644 --- a/test/scripts/ci-workflow-guards.test.ts +++ b/test/scripts/ci-workflow-guards.test.ts @@ -2287,6 +2287,12 @@ NODE const runStep = workflow.jobs.android.steps.find( (step: WorkflowStep) => step.name === "Run Android ${{ matrix.task }}", ); + const nativeResourcesSetup = expectDefined( + workflow.jobs.android.steps.find( + (step: WorkflowStep) => step.name === "Setup Node environment for native resources", + ), + "Android native resources Node setup", + ); expect(source).toContain('task: useCompatibleAndroidCi ? "test-play-compat" : "test-play"'); expect(source).toContain( @@ -2301,6 +2307,11 @@ NODE expect(runStep.run).toContain(":app:lintPlayDebug"); expect(runStep.run).toContain(":app:lintThirdPartyDebug"); expect(runStep.run).toContain(":benchmark:assembleDebug"); + expect(nativeResourcesSetup.uses).toBe("./.github/actions/setup-node-env"); + expect(nativeResourcesSetup.if).toBe( + "needs.preflight.outputs.use_compatible_android_ci != 'true'", + ); + expect(nativeResourcesSetup.with).toMatchObject({ "install-bun": "false" }); }); it("runs canonical main CI single-flight while coalescing the pending tip", () => { @@ -4503,6 +4514,7 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}" const legacy = runCiManifestFixture({ bundledPlanner: false }); expect(legacy.status, legacy.output).toBe(0); expect(legacy.outputs.historical_target).toBe("true"); + expect(legacy.outputs.use_compatible_android_ci).toBe("true"); expect(legacy.outputs.run_ios_build).toBe("false"); expect(legacy.outputs.run_native_i18n).toBe("false"); expect(legacy.outputs.run_openclawkit_tests).toBe("false"); @@ -4533,6 +4545,7 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}" const current = runCiManifestFixture({ bundledPlanner: true }); expect(current.status, current.output).toBe(0); + expect(current.outputs.use_compatible_android_ci).toBe("false"); expect(current.outputs.run_ios_build).toBe("true"); expect(current.outputs.run_native_i18n).toBe("true"); expect(current.outputs.run_openclawkit_tests).toBe("true"); @@ -4552,6 +4565,15 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}" { check_name: "android-ktlint", task: "ktlint" }, ]); + const releaseCandidateCurrent = runCiManifestFixture({ + bundledPlanner: true, + historicalCompatibility: false, + releaseCandidateCompatibility: true, + }); + expect(releaseCandidateCurrent.status, releaseCandidateCurrent.output).toBe(0); + expect(releaseCandidateCurrent.outputs.compatibility_target).toBe("true"); + expect(releaseCandidateCurrent.outputs.use_compatible_android_ci).toBe("false"); + const currentMissingAndroidCapabilities = runCiManifestFixture({ androidCiCapabilities: false, bundledPlanner: true,