Files
hapi/.github/workflows/test.yml
T
weishuandGitHub 7c715843bb ci: merge owner-approved PRs automatically after checks pass (#2217)
* ci: merge owner-approved PRs automatically after checks pass

Approval by the repo owner on a PR should be the only manual step before
merge. The auto-merge workflow squash-merges open PRs the owner approved
at their current head once every required check's latest run on that
head has passed (test, integration, windows-codex-mcp).

Fork PR review events receive no secrets, so a no-op signal workflow
runs on pull_request_review and its completion triggers the privileged
workflow, which runs default-branch code. Merges use AUTO_MERGE_TOKEN, a
user token, so the resulting pushes to main trigger push workflows; the
workflow refuses to merge if that secret is missing.

* ci: load the auto-merge script from main on every trigger

workflow_dispatch checks out the ref chosen by the caller, so a manual
run from a topic branch would execute unmerged merge logic with the
owner's token. Pin the checkout to main.
2026-10-28 13:02:05 +08:00

42 lines
1.7 KiB
YAML

name: Test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test PR automation
run: node --test .github/scripts/pr-review.test.cjs .github/scripts/auto-merge.test.cjs
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun typecheck
- run: bunx playwright install --with-deps chromium
# Required by cli/src/utils/windowsProcessTree.pwsh.test.ts — image
# inspect alone does not pull; silent skip was fake B1 coverage (#1911).
- run: docker pull mcr.microsoft.com/powershell:latest
- run: bun run test:e2e -- terminal-wrap-fidelity.spec.ts composer-copy.spec.ts session-list-scroll.spec.ts cold-initial-tail.spec.ts scrollbar-auto-hide.spec.ts attachment-removal.spec.ts history-navigation-layout.spec.ts share-turn.spec.ts
- run: bun run test
# Serial runner-integration suite: starts real detached runner/session
# process trees against an isolated temp hub, so it runs in its own job
# (never in the parallel unit-test path). See cli/vitest.integration.config.ts.
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run test:cli:integration
windows-codex-mcp:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run --cwd cli test -- src/codex/utils/codexMcpProxy.test.ts