From faa8e272912febe2e9dd1667832fc6df9e682e7f Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 20 Mar 2026 00:27:17 -0700 Subject: [PATCH] fix(ci): share compat matrix and restore skill python gating --- .github/workflows/ci.yml | 65 +++++++++------------------- scripts/ci-changed-scope.mjs | 2 +- src/scripts/ci-changed-scope.test.ts | 10 +++++ 3 files changed, 31 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fd76c2f9f0..d892d3f30df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,26 +215,37 @@ jobs: - runtime: bun task: test command: pnpm canvas:a2ui:bundle && bunx vitest run --config vitest.unit.config.ts + - runtime: node + task: compat-node22 + node_version: "22.x" + cache_key_suffix: "node22" + command: | + pnpm build + pnpm test + node scripts/stage-bundled-plugin-runtime-deps.mjs + node --import tsx scripts/release-check.ts steps: - - name: Skip bun lane on pull requests - if: github.event_name == 'pull_request' && matrix.runtime == 'bun' - run: echo "Skipping Bun compatibility lane on pull requests." + - name: Skip compatibility lanes on pull requests + if: github.event_name == 'pull_request' && (matrix.runtime == 'bun' || matrix.task == 'compat-node22') + run: echo "Skipping push-only lane on pull requests." - name: Checkout - if: github.event_name != 'pull_request' || matrix.runtime != 'bun' + if: github.event_name != 'pull_request' || (matrix.runtime != 'bun' && matrix.task != 'compat-node22') uses: actions/checkout@v6 with: submodules: false - name: Setup Node environment - if: matrix.runtime != 'bun' || github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || (matrix.runtime != 'bun' && matrix.task != 'compat-node22') uses: ./.github/actions/setup-node-env with: + node-version: "${{ matrix.node_version || '24.x' }}" + cache-key-suffix: "${{ matrix.cache_key_suffix || 'node24' }}" install-bun: "${{ matrix.runtime == 'bun' }}" use-sticky-disk: "false" - name: Configure Node test resources - if: (github.event_name != 'pull_request' || matrix.runtime != 'bun') && matrix.task == 'test' && matrix.runtime == 'node' + if: (github.event_name != 'pull_request' || (matrix.runtime != 'bun' && matrix.task != 'compat-node22')) && matrix.runtime == 'node' && (matrix.task == 'test' || matrix.task == 'compat-node22') env: SHARD_COUNT: ${{ matrix.shard_count || '' }} SHARD_INDEX: ${{ matrix.shard_index || '' }} @@ -249,11 +260,11 @@ jobs: fi - name: Run ${{ matrix.task }} (${{ matrix.runtime }}) - if: matrix.runtime != 'bun' || github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || (matrix.runtime != 'bun' && matrix.task != 'compat-node22') run: ${{ matrix.command }} extension-fast: - name: "extension-fast (${{ matrix.extension }})" + name: "extension-fast" needs: [docs-scope, changed-scope, changed-extensions] if: needs.docs-scope.outputs.docs_only != 'true' && needs.changed-scope.outputs.run_node == 'true' && needs.changed-extensions.outputs.has_changed_extensions == 'true' runs-on: blacksmith-16vcpu-ubuntu-2404 @@ -464,45 +475,9 @@ jobs: - name: Check docs run: pnpm check:docs - compat-node22: - name: "compat-node22" - needs: [docs-scope, changed-scope] - if: github.event_name == 'push' && needs.docs-scope.outputs.docs_only != 'true' && needs.changed-scope.outputs.run_node == 'true' - runs-on: blacksmith-16vcpu-ubuntu-2404 - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - submodules: false - - - name: Setup Node 22 compatibility environment - uses: ./.github/actions/setup-node-env - with: - node-version: "22.x" - cache-key-suffix: "node22" - install-bun: "false" - use-sticky-disk: "false" - - - name: Configure Node 22 test resources - run: | - # Keep the compatibility lane aligned with the default Node test lane. - echo "OPENCLAW_TEST_WORKERS=2" >> "$GITHUB_ENV" - echo "OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144" >> "$GITHUB_ENV" - - - name: Build under Node 22 - run: pnpm build - - - name: Run tests under Node 22 - run: pnpm test - - - name: Verify npm pack under Node 22 - run: | - node scripts/stage-bundled-plugin-runtime-deps.mjs - node --import tsx scripts/release-check.ts - skills-python: needs: [docs-scope, changed-scope] - if: needs.docs-scope.outputs.docs_only != 'true' && needs.changed-scope.outputs.run_skills_python == 'true' + if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_skills_python == 'true') runs-on: blacksmith-16vcpu-ubuntu-2404 steps: - name: Checkout diff --git a/scripts/ci-changed-scope.mjs b/scripts/ci-changed-scope.mjs index c5ed28319b1..bc17ea97cca 100644 --- a/scripts/ci-changed-scope.mjs +++ b/scripts/ci-changed-scope.mjs @@ -4,7 +4,7 @@ import { appendFileSync } from "node:fs"; /** @typedef {{ runNode: boolean; runMacos: boolean; runAndroid: boolean; runWindows: boolean; runSkillsPython: boolean }} ChangedScope */ const DOCS_PATH_RE = /^(docs\/|.*\.mdx?$)/; -const SKILLS_PYTHON_SCOPE_RE = /^skills\//; +const SKILLS_PYTHON_SCOPE_RE = /^(skills\/|pyproject\.toml$)/; const CI_WORKFLOW_SCOPE_RE = /^\.github\/workflows\/ci\.yml$/; const MACOS_PROTOCOL_GEN_RE = /^(apps\/macos\/Sources\/OpenClawProtocol\/|apps\/shared\/OpenClawKit\/Sources\/OpenClawProtocol\/)/; diff --git a/src/scripts/ci-changed-scope.test.ts b/src/scripts/ci-changed-scope.test.ts index 682cfb8d9b3..284851c5694 100644 --- a/src/scripts/ci-changed-scope.test.ts +++ b/src/scripts/ci-changed-scope.test.ts @@ -124,6 +124,16 @@ describe("detectChangedScope", () => { }); }); + it("runs Python skill tests when shared Python config changes", () => { + expect(detectChangedScope(["pyproject.toml"])).toEqual({ + runNode: true, + runMacos: false, + runAndroid: false, + runWindows: false, + runSkillsPython: true, + }); + }); + it("runs platform lanes when the CI workflow changes", () => { expect(detectChangedScope([".github/workflows/ci.yml"])).toEqual({ runNode: true,