Files
openprose__prose/.github/workflows/cli-real-harness-smoke.yml

89 lines
2.3 KiB
YAML

name: CLI Real Harness Smoke
on:
pull_request:
paths:
- "cli/**"
- ".github/workflows/cli-real-harness-smoke.yml"
push:
branches:
- main
paths:
- "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
- codex
- claude-sdk
- claude
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
- codex
- claude-sdk
- claude
defaults:
run:
working-directory: 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 Node
if: ${{ env.SHOULD_RUN == 'true' }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: cli/package-lock.json
- name: Install dependencies
if: ${{ env.SHOULD_RUN == 'true' }}
run: npm ci
- name: Build CLI
if: ${{ env.SHOULD_RUN == 'true' }}
run: npm run build
- name: Install Claude Code CLI when requested
if: ${{ env.SHOULD_RUN == 'true' && startsWith(matrix.harness, 'claude') }}
run: npm install --global @anthropic-ai/claude-code
- name: Run real harness smokes
if: ${{ env.SHOULD_RUN == 'true' }}
run: npm run smoke:harness -- --harness "${{ matrix.harness }}"