ci: balance shards and reuse pr artifacts

This commit is contained in:
Peter Steinberger
2026-03-24 04:18:58 +00:00
parent 26365f7daf
commit 1bfef17825
6 changed files with 1305 additions and 30 deletions

View File

@@ -162,7 +162,7 @@ jobs:
# Build dist once for Node-relevant changes and share it with downstream jobs.
build-artifacts:
needs: [preflight]
if: github.event_name == 'push' && needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_node == 'true'
if: needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_node == 'true'
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 20
steps:
@@ -234,7 +234,7 @@ jobs:
checks:
needs: [preflight, build-artifacts]
if: always() && needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_node == 'true' && (github.event_name != 'push' || needs.build-artifacts.result == 'success')
if: always() && needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_node == 'true' && needs.build-artifacts.result == 'success'
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 20
strategy:
@@ -327,27 +327,19 @@ jobs:
fi
- name: Download dist artifact
if: github.event_name == 'push' && matrix.task == 'test'
if: matrix.task == 'test'
uses: actions/download-artifact@v8
with:
name: dist-build
path: dist/
- name: Download A2UI bundle artifact
if: github.event_name == 'push' && (matrix.task == 'test' || matrix.task == 'channels')
if: matrix.task == 'test' || matrix.task == 'channels'
uses: actions/download-artifact@v8
with:
name: canvas-a2ui-bundle
path: src/canvas-host/a2ui/
- name: Build A2UI bundle
if: github.event_name != 'push' && (matrix.task == 'test' || matrix.task == 'channels')
run: pnpm canvas:a2ui:bundle
- name: Build dist
if: github.event_name != 'push' && matrix.task == 'test' && matrix.runtime == 'node'
run: pnpm build
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
if: github.event_name != 'pull_request' || matrix.task != 'compat-node22'
run: ${{ matrix.command }}
@@ -592,7 +584,7 @@ jobs:
checks-windows:
needs: [preflight, build-artifacts]
if: always() && needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_windows == 'true' && (github.event_name != 'push' || needs.build-artifacts.result == 'success')
if: always() && needs.preflight.outputs.docs_only != 'true' && needs.preflight.outputs.run_windows == 'true' && needs.build-artifacts.result == 'success'
runs-on: blacksmith-32vcpu-windows-2025
timeout-minutes: 20
env:
@@ -719,27 +711,19 @@ jobs:
echo "OPENCLAW_TEST_SHARD_INDEX=${{ matrix.shard_index }}" >> "$GITHUB_ENV"
- name: Download dist artifact
if: github.event_name == 'push' && matrix.task == 'test'
if: matrix.task == 'test'
uses: actions/download-artifact@v8
with:
name: dist-build
path: dist/
- name: Download A2UI bundle artifact
if: github.event_name == 'push' && matrix.task == 'test'
if: matrix.task == 'test'
uses: actions/download-artifact@v8
with:
name: canvas-a2ui-bundle
path: src/canvas-host/a2ui/
- name: Build A2UI bundle (Windows)
if: github.event_name != 'push' && matrix.task == 'test'
run: pnpm canvas:a2ui:bundle
- name: Build dist (Windows)
if: github.event_name != 'push' && matrix.task == 'test'
run: pnpm build
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
run: ${{ matrix.command }}