




























@@ -54,6 +54,8 @@ jobs:
5454run_checks_fast_core: ${{ steps.manifest.outputs.run_checks_fast_core }}
5555run_checks_fast: ${{ steps.manifest.outputs.run_checks_fast }}
5656checks_fast_core_matrix: ${{ steps.manifest.outputs.checks_fast_core_matrix }}
57+run_plugin_contracts_shards: ${{ steps.manifest.outputs.run_plugin_contracts_shards }}
58+plugin_contracts_matrix: ${{ steps.manifest.outputs.plugin_contracts_matrix }}
5759channel_contracts_matrix: ${{ steps.manifest.outputs.channel_contracts_matrix }}
5860run_checks: ${{ steps.manifest.outputs.run_checks }}
5961checks_matrix: ${{ steps.manifest.outputs.checks_matrix }}
@@ -139,6 +141,9 @@ jobs:
139141 import {
140142 createChannelContractTestShards,
141143 } from "./scripts/lib/channel-contract-test-plan.mjs";
144+ import {
145+ createPluginContractTestShards,
146+ } from "./scripts/lib/plugin-contract-test-plan.mjs";
142147143148 const parseBoolean = (value, fallback = false) => {
144149 if (value === undefined) return fallback;
@@ -161,7 +166,7 @@ jobs:
161166 runNode && parseBoolean(process.env.OPENCLAW_CI_RUN_NODE_FAST_PLUGIN_CONTRACTS);
162167 const runNodeFastCiRouting =
163168 runNode && parseBoolean(process.env.OPENCLAW_CI_RUN_NODE_FAST_CI_ROUTING);
164- const runChecksFastCore = runNodeFull || runNodeFastPluginContracts || runNodeFastCiRouting;
169+ const runPluginContractShards = runNodeFull || runNodeFastPluginContracts;
165170 const runMacos =
166171 parseBoolean(process.env.OPENCLAW_CI_RUN_MACOS) && !docsOnly && isCanonicalRepository;
167172 const runAndroid =
@@ -178,20 +183,9 @@ jobs:
178183 if (runNodeFull) {
179184 checksFastCoreTasks.push(
180185 { check_name: "checks-fast-bundled", runtime: "node", task: "bundled" },
181- {
182- check_name: "checks-fast-contracts-plugins",
183- runtime: "node",
184- task: "contracts-plugins",
185- },
186186 );
187187 } else {
188- if (runNodeFastPluginContracts) {
189- checksFastCoreTasks.push({
190- check_name: "checks-fast-contracts-plugins",
191- runtime: "node",
192- task: runNodeFastCiRouting ? "contracts-plugins-ci-routing" : "contracts-plugins",
193- });
194- } else if (runNodeFastCiRouting) {
188+ if (runNodeFastCiRouting) {
195189 checksFastCoreTasks.push({
196190 check_name: "checks-fast-ci-routing",
197191 runtime: "node",
@@ -226,9 +220,13 @@ jobs:
226220 run_skills_python: runSkillsPython,
227221 run_windows: runWindows,
228222 run_build_artifacts: runNodeFull,
229- run_checks_fast_core: runChecksFastCore,
223+ run_checks_fast_core: checksFastCoreTasks.length > 0,
230224 run_checks_fast: runNodeFull,
231225 checks_fast_core_matrix: createMatrix(checksFastCoreTasks),
226+ run_plugin_contracts_shards: runPluginContractShards,
227+ plugin_contracts_matrix: createMatrix(
228+ runPluginContractShards ? createPluginContractTestShards() : [],
229+ ),
232230 channel_contracts_matrix: createMatrix(
233231 runNodeFull ? createChannelContractTestShards() : [],
234232 ),
@@ -730,6 +728,112 @@ jobs:
730728 ;;
731729 esac
732730731+ checks-fast-plugin-contracts-shard:
732+permissions:
733+contents: read
734+name: ${{ matrix.checkName }}
735+needs: [preflight]
736+if: needs.preflight.outputs.run_plugin_contracts_shards == 'true'
737+runs-on: ${{ github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}
738+timeout-minutes: 60
739+strategy:
740+fail-fast: false
741+matrix: ${{ fromJson(needs.preflight.outputs.plugin_contracts_matrix) }}
742+steps:
743+ - name: Checkout
744+shell: bash
745+env:
746+CHECKOUT_REPO: ${{ github.repository }}
747+CHECKOUT_SHA: ${{ needs.preflight.outputs.checkout_revision }}
748+CHECKOUT_TOKEN: ${{ github.token }}
749+run: |
750+ set -euo pipefail
751+752+ workdir="$GITHUB_WORKSPACE"
753+ auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')"
754+755+ reset_checkout_dir() {
756+ mkdir -p "$workdir"
757+ find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
758+ }
759+760+ checkout_attempt() {
761+ local attempt="$1"
762+763+ reset_checkout_dir
764+ git init "$workdir" >/dev/null
765+ git config --global --add safe.directory "$workdir"
766+ git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}"
767+ git -C "$workdir" config gc.auto 0
768+769+ timeout --signal=TERM 30s git -C "$workdir" \
770+ -c protocol.version=2 \
771+ -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \
772+ fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \
773+ "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1
774+775+ git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1
776+ test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1
777+ echo "checkout attempt ${attempt}/5 succeeded"
778+ }
779+780+ for attempt in 1 2 3 4 5; do
781+ if checkout_attempt "$attempt"; then
782+ exit 0
783+ fi
784+ echo "checkout attempt ${attempt}/5 failed"
785+ sleep $((attempt * 5))
786+ done
787+788+ echo "checkout failed after 5 attempts" >&2
789+ exit 1
790+791+ - name: Setup Node environment
792+uses: ./.github/actions/setup-node-env
793+with:
794+install-bun: "false"
795+796+ - name: Run plugin contract shard
797+env:
798+OPENCLAW_CONTRACT_INCLUDE_PATTERNS_JSON: ${{ toJson(matrix.includePatterns) }}
799+shell: bash
800+run: |
801+ set -euo pipefail
802+ include_file="$RUNNER_TEMP/plugin-contract-include.json"
803+ INCLUDE_FILE="$include_file" node --input-type=module <<'EOF'
804+ import { writeFileSync } from "node:fs";
805+806+ const includePatterns = JSON.parse(process.env.OPENCLAW_CONTRACT_INCLUDE_PATTERNS_JSON ?? "[]");
807+ if (!Array.isArray(includePatterns) || includePatterns.length === 0) {
808+ console.error("Missing plugin contract include patterns");
809+ process.exit(1);
810+ }
811+ writeFileSync(process.env.INCLUDE_FILE, JSON.stringify(includePatterns), "utf8");
812+ EOF
813+ OPENCLAW_VITEST_INCLUDE_FILE="$include_file" pnpm test:contracts:plugins
814+815+ checks-fast-plugin-contracts:
816+permissions:
817+contents: read
818+name: checks-fast-contracts-plugins
819+needs: [preflight, checks-fast-plugin-contracts-shard]
820+if: ${{ !cancelled() && always() && needs.preflight.outputs.run_plugin_contracts_shards == 'true' }}
821+runs-on: ubuntu-24.04
822+timeout-minutes: 5
823+steps:
824+ - name: Verify plugin contract shards
825+env:
826+SHARD_RESULT: ${{ needs.checks-fast-plugin-contracts-shard.result }}
827+run: |
828+ if [ "$SHARD_RESULT" = "cancelled" ]; then
829+ echo "Plugin contract shards were cancelled, usually because a newer commit superseded this run." >&2
830+ exit 1
831+ fi
832+ if [ "$SHARD_RESULT" != "success" ]; then
833+ echo "Plugin contract shards failed: $SHARD_RESULT" >&2
834+ exit 1
835+ fi
836+733837 checks-fast-channel-contracts-shard:
734838permissions:
735839contents: read
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。