Skip to content

Commit 8bd06d8

Browse files
committed
ci: distribute lint and publish reusable SDK cache
1 parent bb6b03b commit 8bd06d8

9 files changed

Lines changed: 526 additions & 47 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,8 +3227,8 @@ jobs:
32273227
echo "fingerprint=$fingerprint" >> "$GITHUB_OUTPUT"
32283228
echo "enabled=true" >> "$GITHUB_OUTPUT"
32293229
else
3230-
# Older targets build this boundary through their candidate-owned
3231-
# runner, but cannot produce the v2 cache fingerprint safely.
3230+
# Historical targets without this preparer retain their own
3231+
# declaration setup and do not consume the shared archive.
32323232
echo "enabled=false" >> "$GITHUB_OUTPUT"
32333233
fi
32343234
@@ -3392,13 +3392,19 @@ jobs:
33923392
# not just ui/src/i18n; any ui-touching diff (run_ui_tests) or
33933393
# i18n-tooling diff must run it. oxlint always runs.
33943394
lint_args=(--threads=8)
3395+
hosted_extension_stripe=""
33953396
if [ "$HOSTED_RUNNER_STRIPES" = "true" ]; then
3396-
# Five dedicated hosted jobs own the aggregated core Programs. Keep
3397-
# extension preparation in this sixth lane except when the exact
3398-
# merge-tree release lint job already owns it.
3397+
# Five dedicated hosted jobs own the aggregated core Programs.
3398+
# Historical and hybrid targets keep extension ownership here.
33993399
lint_args=(--only=extensions --only=scripts --threads=1)
34003400
if [ "$RELEASE_GATE" = "true" ]; then
34013401
lint_args=(--only=scripts --threads=1)
3402+
elif [ "$RUNNER_PROFILE" = "github" ] &&
3403+
grep -q -- '--extension-stripe' scripts/run-oxlint-shards.mts 2>/dev/null; then
3404+
# Six existing hosted lint jobs divide the independently bounded
3405+
# extension Programs without running two Programs concurrently.
3406+
hosted_extension_stripe="6/6"
3407+
lint_args=(--only=scripts --threads=1)
34023408
fi
34033409
export GOMAXPROCS=2
34043410
# Match local Go GC policy; thread limits alone leave the
@@ -3415,11 +3421,17 @@ jobs:
34153421
# The candidate's older shard runner owns all three source
34163422
# groups; do not split core stripes it cannot represent.
34173423
pnpm lint
3418-
elif [ "$RUN_CONTROL_UI_I18N" = "true" ] || [ "$RUN_UI_TESTS" = "true" ]; then
3419-
pnpm lint "${lint_args[@]}"
34203424
else
3421-
echo "[skip] changed scope cannot affect control-UI i18n catalogs"
3422-
node --import tsx scripts/run-oxlint-shards.mts "${lint_args[@]}"
3425+
if [ -n "$hosted_extension_stripe" ]; then
3426+
node --import tsx scripts/run-oxlint-shards.mts \
3427+
--only=extensions --extension-stripe="$hosted_extension_stripe" --threads=1
3428+
fi
3429+
if [ "$RUN_CONTROL_UI_I18N" = "true" ] || [ "$RUN_UI_TESTS" = "true" ]; then
3430+
pnpm lint "${lint_args[@]}"
3431+
else
3432+
echo "[skip] changed scope cannot affect control-UI i18n catalogs"
3433+
node --import tsx scripts/run-oxlint-shards.mts "${lint_args[@]}"
3434+
fi
34233435
fi
34243436
if [ "$FORMAT_CHECK" = "true" ]; then
34253437
pnpm format:check
@@ -3562,10 +3574,41 @@ jobs:
35623574
install-bun: "false"
35633575
dependency-cache: ${{ vars.OPENCLAW_CI_RUNNER_BACKEND != 'github' && runner.environment == 'self-hosted' && github.event_name != 'workflow_dispatch' && github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'openclaw/openclaw') && 'true' || 'false' }}
35643576

3577+
- name: Compute extension boundary input fingerprint
3578+
id: extension-boundary-inputs
3579+
if: needs.preflight.outputs.runner_profile == 'github' && !inputs.release_gate
3580+
shell: bash
3581+
run: |
3582+
set -euo pipefail
3583+
if [[ -f scripts/prepare-extension-package-boundary-artifacts.mts ]]; then
3584+
fingerprint="$(git rev-parse HEAD)"
3585+
echo "fingerprint=$fingerprint" >> "$GITHUB_OUTPUT"
3586+
echo "enabled=true" >> "$GITHUB_OUTPUT"
3587+
else
3588+
# Historical targets without this preparer retain their own
3589+
# declaration setup and do not consume the shared archive.
3590+
echo "enabled=false" >> "$GITHUB_OUTPUT"
3591+
fi
3592+
3593+
- name: Cache extension package boundary artifacts for hosted core lint
3594+
if: needs.preflight.outputs.cache_mode != 'off' && needs.preflight.outputs.runner_profile == 'github' && !inputs.release_gate && steps.extension-boundary-inputs.outputs.enabled == 'true'
3595+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3596+
with:
3597+
path: |
3598+
packages/plugin-sdk/dist
3599+
.artifacts/extension-package-boundary/plugins
3600+
.artifacts/extension-package-boundary/*.json
3601+
.artifacts/extension-package-boundary/compile
3602+
key: ${{ runner.os }}-extension-package-boundary-v4-${{ steps.extension-boundary-inputs.outputs.fingerprint }}
3603+
restore-keys: |
3604+
${{ runner.os }}-extension-package-boundary-v4-
3605+
35653606
- name: Run hosted core lint stripe
35663607
env:
35673608
GOMAXPROCS: "2"
35683609
OPENCLAW_LOCAL_CHECK: "0"
3610+
RELEASE_GATE: ${{ inputs.release_gate && 'true' || 'false' }}
3611+
RUNNER_PROFILE: ${{ needs.preflight.outputs.runner_profile }}
35693612
run: |
35703613
set -euo pipefail
35713614
# Older candidates run their complete lint set in check-lint; their
@@ -3576,6 +3619,11 @@ jobs:
35763619
fi
35773620
node --import tsx scripts/run-oxlint-shards.mts \
35783621
--only=core --split-core --core-stripe=${{ matrix.stripe }}/5 --threads=1
3622+
if [ "$RUNNER_PROFILE" = "github" ] && [ "$RELEASE_GATE" != "true" ] &&
3623+
grep -q -- '--extension-stripe' scripts/run-oxlint-shards.mts 2>/dev/null; then
3624+
node --import tsx scripts/run-oxlint-shards.mts \
3625+
--only=extensions --extension-stripe=${{ matrix.stripe }}/6 --threads=1
3626+
fi
35793627
35803628
# The github/hybrid planner profile stripes the 14 serial core test-type
35813629
# graphs (~34-42s per graph on either runner class; tsgo saturates a machine
@@ -3707,8 +3755,8 @@ jobs:
37073755
echo "fingerprint=$fingerprint" >> "$GITHUB_OUTPUT"
37083756
echo "enabled=true" >> "$GITHUB_OUTPUT"
37093757
else
3710-
# Older targets build this boundary through their candidate-owned
3711-
# runner, but cannot produce the v2 cache fingerprint safely.
3758+
# Historical targets without this preparer retain their own
3759+
# declaration setup and do not consume the shared archive.
37123760
echo "enabled=false" >> "$GITHUB_OUTPUT"
37133761
fi
37143762

‎.github/workflows/vitest-cache-warm.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,44 @@ jobs:
6868
.cache/openclaw-pnpm-store
6969
key: ${{ steps.setup-node-env.outputs.dependency-cache-key }}
7070

71+
# Seal this owner before the full build creates sibling package dist trees.
72+
# Those trees are resolution topology, but intentionally are not in this payload.
73+
- name: Restore native SDK boundary cache
74+
id: extension-package-boundary-cache
75+
if: ${{ matrix.platform == 'linux' && steps.setup-node-env.outputs.cache-mode == 'read-write' }}
76+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
77+
with:
78+
path: |
79+
packages/plugin-sdk/dist
80+
.artifacts/extension-package-boundary/plugins
81+
.artifacts/extension-package-boundary/*.json
82+
.artifacts/extension-package-boundary/compile
83+
key: ${{ runner.os }}-extension-package-boundary-v4-${{ github.sha }}
84+
restore-keys: |
85+
${{ runner.os }}-extension-package-boundary-v4-
86+
87+
- name: Prepare native SDK boundary cache
88+
if: ${{ matrix.platform == 'linux' }}
89+
run: node --import ./scripts/tsx.mjs scripts/prepare-extension-package-boundary-artifacts.mts --mode=package-boundary
90+
91+
- name: Save native SDK boundary cache
92+
if: ${{ matrix.platform == 'linux' && steps.setup-node-env.outputs.cache-mode == 'read-write' && steps.extension-package-boundary-cache.outputs.cache-hit != 'true' }}
93+
continue-on-error: true
94+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
95+
with:
96+
path: |
97+
packages/plugin-sdk/dist
98+
.artifacts/extension-package-boundary/plugins
99+
.artifacts/extension-package-boundary/*.json
100+
.artifacts/extension-package-boundary/compile
101+
key: ${{ runner.os }}-extension-package-boundary-v4-${{ github.sha }}
102+
103+
# Packaged declarations must see the same tree as ordinary build consumers.
104+
# The native lint output belongs only in its completed cache archive.
105+
- name: Clear native SDK boundary output before build
106+
if: ${{ matrix.platform == 'linux' }}
107+
run: rm -rf packages/plugin-sdk/dist
108+
71109
- name: Warm build cache
72110
if: ${{ matrix.platform == 'linux' }}
73111
env:

0 commit comments

Comments
 (0)