Files
openprose__prose/.github/workflows/cli-real-harness-smoke.yml
dan f9c84b834e Fix CLI workflows for the pnpm-workspace consolidation (#89)
* Fix CLI workflows for the pnpm-workspace consolidation

The Reactor consolidation moved the CLI into the pnpm workspace, but the
npm-to-pnpm workflow conversion was incomplete and broke CI on main.

- Add the missing pnpm/action-setup step before every setup-node that
  sets cache: pnpm (cli-real-harness-smoke, cli-release-check, release).
  Without pnpm on PATH, setup-node fails: "Unable to locate executable
  file: pnpm".
- Rework the npm-package-smoke job to pack with pnpm. npm pack does not
  rewrite the workspace: protocol dependency on @openprose/reactor;
  pnpm pack does. The install smoke now resolves that dependency from a
  locally packed reactor tarball so it does not depend on the registry.

* Build the Reactor dependency before the CLI compiles in CI

After the workspace consolidation the CLI typechecks and builds against
@openprose/reactor, which must be built first.

- Add a "Build workspace" step before every CLI typecheck/build step
  (node-checks, release-tarball-smoke, cli-real-harness-smoke, and the
  release workflow's verify-cli and release-assets jobs).
- Drop the deleted tools/cli/package-lock.json entries from
  .version-bump.json so bump-version.sh --check no longer fails.

* Drop Node 18 from the CLI check matrix

The CLI now requires Node 20+ (engines.node >=20.0.0, enforced by
install.sh). The Node 18 matrix leg fails install.sh's version gate.
2026-05-20 23:03:27 -07:00

89 lines
2.3 KiB
YAML

name: CLI Real Harness Smoke
on:
pull_request:
paths:
- "tools/cli/**"
- ".github/workflows/cli-real-harness-smoke.yml"
push:
branches:
- main
paths:
- "tools/cli/**"
- ".github/workflows/cli-real-harness-smoke.yml"
workflow_dispatch:
inputs:
harness:
description: "Harness to smoke."
required: true
default: all
type: choice
options:
- all
- codex-sdk
- claude-sdk
permissions:
contents: read
concurrency:
group: cli-real-harness-smoke-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke:
name: Smoke ${{ matrix.harness }} harness
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
harness:
- codex-sdk
- claude-sdk
defaults:
run:
working-directory: tools/cli
env:
SHOULD_RUN: ${{ github.event_name != 'workflow_dispatch' || inputs.harness == 'all' || inputs.harness == matrix.harness }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
PROSE_CODEX_APPROVAL_POLICY: never
PROSE_CODEX_SANDBOX_MODE: danger-full-access
steps:
- name: Skip unrequested harness
if: ${{ env.SHOULD_RUN != 'true' }}
run: echo "Skipping ${{ matrix.harness }} because workflow_dispatch requested ${{ inputs.harness }}."
- name: Checkout
if: ${{ env.SHOULD_RUN == 'true' }}
uses: actions/checkout@v4
- name: Setup pnpm
if: ${{ env.SHOULD_RUN == 'true' }}
uses: pnpm/action-setup@v4
- name: Setup Node
if: ${{ env.SHOULD_RUN == 'true' }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
if: ${{ env.SHOULD_RUN == 'true' }}
run: corepack enable && pnpm install --frozen-lockfile --dir ../..
- name: Build workspace
if: ${{ env.SHOULD_RUN == 'true' }}
run: pnpm --dir ../.. run build
- name: Build CLI
if: ${{ env.SHOULD_RUN == 'true' }}
run: npm run build
- name: Run real harness smokes
if: ${{ env.SHOULD_RUN == 'true' }}
run: npm run smoke:harness -- --harness "${{ matrix.harness }}"