Merge pull request #7094 from deepseek-harness/worktree/ci-schedule

ci: cut PR check latency across the slow lanes
This commit is contained in:
imccyu authored and GitHub committed 2026-10-24 14:58:40 +08:00
1 parent a2a5f832d8
commit b9266aefd6
32 files changed
+937 -421

No files matched your search

@@ -264,6 +264,10 @@ jobs:
- name: Build single-exe
env:
DSH_BUILD_CLIENT_PROFILE: official
# Brotli runs at quality 9 through the vendored pkg patch: the same
# payload measured 16.3 s at quality 9 against 132.8 s at pkg's default
# quality 11, for an archive 10% larger. Which quality each lane uses is
# therefore not a workflow choice.
run: >-
pnpm exec tsx scripts/build-exe-for-python-sdk.ts --targets=${{ matrix.target }}
${{ inputs.ci && github.event_name == 'pull_request' && '--build-artifacts' || '' }}
+30 -4
View File
@@ -3,7 +3,9 @@ name: Build PR preview
# Every push to a pull request publishes that pull request's preview to
# Cloudflare Pages under its own branch alias, behind Cloudflare Access. The
# upload carries build products only: the workflow never grants the deployment
# platform access to this repository's sources.
# platform access to this repository's sources. This lane also owns the
# aggregate test and script type checks that the required Linux consumers no
# longer repeat on every pull request.
on:
pull_request:
@@ -32,7 +34,13 @@ env:
jobs:
preview:
runs-on: ubuntu-24.04
# The required outcome is the build, which runs four TypeScript programs
# (Host and Client package compilation, then each face's aggregate test and
# script check) after the Typert pass. Publishing is best effort: transport,
# Access, and comment failures warn instead of failing the check.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-4vcpu-ubuntu-2404'
|| 'ubuntu-24.04' }}
name: cloudflare pages preview
steps:
- uses: actions/[email protected]
@@ -70,8 +78,11 @@ jobs:
# apps/web consumes workspace packages as built lib products, and
# build:preview packs the image through the packer's installed bin
# (lib/bin.js), so neither half exists before the artifact build runs.
- name: Build workspace
run: pnpm run build:artifacts
# The required Linux consumers emit artifacts only; the complete build
# here also runs the aggregate test and script checks, which share the
# Typert output and the two package compilations.
- name: Build workspace and check aggregate programs
run: pnpm run build
- name: Build the preview page and pack the VFS image
env:
@@ -88,6 +99,8 @@ jobs:
cp apps/web/dist/preview.html apps/web/dist/index.html
- name: Upload to Cloudflare Pages
id: upload
continue-on-error: true
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@@ -112,6 +125,8 @@ jobs:
# Accept-Encoding is sent because a browser sends it; the assertion is
# about what the platform does with a body that is already compressed.
- name: Verify the protected deployment serves the image
id: verify
continue-on-error: true
env:
CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }}
CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }}
@@ -151,6 +166,8 @@ jobs:
# idempotent: a pull request opened before this workflow existed never
# sees an `opened` event, and every later push must not restate the URL.
- name: Comment the preview URL
id: comment
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
@@ -168,3 +185,12 @@ jobs:
"$marker" \
"[Preview for #$PR](https://pr-$PR.${CF_PROJECT}.pages.dev) (requires Cloudflare Access sign-in)" \
| gh pr comment "$PR" --body-file -
# Publishing stays outside the required verdict: a Cloudflare, Access, or
# comment failure warns, while a build failure still fails this check.
- name: Report preview publication failures
if: steps.upload.outcome == 'failure' || steps.verify.outcome == 'failure' || steps.comment.outcome == 'failure'
run: |
message='preview publication failed; the build passed, see the upload, verify, and comment steps'
echo "::warning::$message"
echo "$message" >> "$GITHUB_STEP_SUMMARY"
+72 -3
View File
@@ -202,12 +202,81 @@ jobs:
path: .coverage-times.json
key: coverage-times-Linux-${{ runner.environment }}-${{ vars.DSH_CI_FAILOVER_LINUX || 'enterprise' }}-${{ github.run_id }}-${{ github.run_attempt }}
# Lint and duplication get their own lane instead of riding the artifact
# consumers: a red lint no longer costs the snapshot and artifact consumers a
# full rerun. The lane compiles package declarations because oxlint's
# type-aware rules read them.
node-24-lint:
if: github.event_name == 'pull_request'
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-8vcpu-ubuntu-2404'
|| vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
&& github.event.pull_request.user.login != 'dependabot[bot]'
&& fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
|| 'dsh-ubuntu-24-04-16core' }}
name: node 24 / lint
env:
# Shared hosts expose host CPUs, not an isolated allocation.
DSH_GATE_CONCURRENCY: ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '8' || '' }}
DSH_OXLINT_THREADS: ${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted' && github.event.pull_request.user.login != 'dependabot[bot]' && '8' || '' }}
steps:
# Runner cleanup owns tool caches and fixtures, including cancelled runs.
- name: Use runner-owned temporary storage
run: |
echo "TMPDIR=${{ runner.temp }}" >> "$GITHUB_ENV"
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Redirect Node compile cache to runner temp
run: echo "NODE_COMPILE_CACHE=${{ runner.temp }}/node-compile-cache" >> "$GITHUB_ENV"
- uses: pnpm/[email protected]
with:
dest: ${{ runner.temp }}/setup-pnpm-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/[email protected]
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Configure pnpm store path
id: pnpm-store
run: |
store_root="$HOME/.local/share/pnpm/store"
echo "PNPM_CONFIG_STORE_DIR=$store_root" >> "$GITHUB_ENV"
store_path=$(PNPM_CONFIG_STORE_DIR="$store_root" pnpm store path --silent)
echo "path=$store_path" >> "$GITHUB_OUTPUT"
- uses: actions/cache/[email protected]
if: vars.DSH_CI_FAILOVER_LINUX != 'selfhosted' || github.event.pull_request.user.login == 'dependabot[bot]'
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ env.PRIMARY_NODE_VERSION }}-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# oxlint's type-aware rules resolve workspace imports through the package
# declarations, so this lane compiles them without bundling anything.
- name: Compile package declarations
run: pnpm run typecheck
- name: Run lint and duplication
run: pnpm run check:ci:lint:contracts-ready
node-24-bench:
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-4vcpu-ubuntu-2404'
|| 'ubuntu-24.04' }}
name: node 24 / benchmarks
# Wall-clock budgets need an otherwise idle runner, so this job runs the
# benchmark lane alone instead of joining a concurrent gate aggregate.
# benchmark lane alone instead of joining a concurrent gate aggregate, and
# keeps its own two-file parallelism inside that runner. The self-hosted
# failover pool is shared, so the benchmarks stay on hosted Linux there.
timeout-minutes: 20
steps:
- uses: actions/[email protected]
@@ -503,7 +572,7 @@ jobs:
&& github.event.pull_request.user.login != 'dependabot[bot]'
&& fromJSON('["self-hosted", "linux", "x64", "vm-backup"]')
|| 'ubuntu-latest' }}
needs: [node-24, node-24-coverage, node-24-bench, node-24-consumers, node-compat]
needs: [node-24, node-24-coverage, node-24-lint, node-24-bench, node-24-consumers, node-compat]
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
steps:
- name: Fail if any needed job did not succeed
+1 -1
View File
@@ -122,6 +122,6 @@ jobs:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
DEEPSEEK_BASE_URL: https://api.deepseek.com/anthropic
DSH_PRIMARY_RUNTIME: ${{ github.workspace }}/.cache/e2e-office/primary-runtime
DSH_E2E_MAX_WORKERS: 4
DSH_E2E_MAX_WORKERS: 6
DSH_EXAMPLE_MODE: lib
run: pnpm run test:e2e
+16 -6
View File
@@ -30,7 +30,8 @@ jobs:
name: Dependency layout
# Persistent runners accept only trusted, credential-free rehearsals.
runs-on: >-
${{ vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
${{ vars.DSH_CI_FAILOVER_LINUX == 'blacksmith' && 'blacksmith-4vcpu-ubuntu-2404'
|| vars.DSH_CI_FAILOVER_LINUX == 'selfhosted'
&& github.repository == 'deepseek-harness/deepseek-harness'
&& github.actor != 'dependabot[bot]'
&& ((github.event_name == 'push' && github.ref == 'refs/heads/master')
@@ -80,11 +81,20 @@ jobs:
- name: Install (immutable)
run: pnpm install --frozen-lockfile
- name: Verify dependency policy
run: pnpm run verify-package-dependencies
- name: Verify npm install layout
run: pnpm run verify-npm-install-layout
# The two verifications read different inputs (manifests versus an npm
# install in a scratch directory), so they run beside each other.
- name: Verify dependency policy and npm install layout
run: |
pnpm run verify-package-dependencies &
dependencies_pid=$!
pnpm run verify-npm-install-layout &
layout_pid=$!
dependencies_status=0
wait "$dependencies_pid" || dependencies_status=$?
layout_status=0
wait "$layout_pid" || layout_status=$?
if (( dependencies_status != 0 )); then exit "$dependencies_status"; fi
exit "$layout_status"
pack:
name: Pack npm tarballs