ci: add manual pi-ai provider e2e

This commit is contained in:
Yichen Jiang
2026-07-17 23:33:30 +08:00
parent 8d5f08892b
commit b50e02a2b3
3 changed files with 226 additions and 2 deletions
+77
View File
@@ -0,0 +1,77 @@
name: E2E (pi-ai OpenAI and Anthropic)
# This suite spends tokens against two external providers and is intentionally
# opt-in. It has no push, pull_request, schedule, or workflow_call trigger.
on:
workflow_dispatch:
inputs:
openai_model:
description: OpenAI model from pi-ai's installed catalog
required: true
default: gpt-5.5
type: string
anthropic_model:
description: Anthropic model from pi-ai's installed catalog
required: true
default: claude-opus-4-8
type: string
permissions:
contents: read
jobs:
e2e:
runs-on: ubuntu-latest
name: OpenAI Responses + Anthropic Messages
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Enable corepack (pnpm)
run: corepack enable
- name: Resolve pnpm store path
id: pnpm-store
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-24-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-24-pnpm-
- name: Install (immutable)
run: pnpm install --frozen-lockfile
# The tests self-skip locally when a credential is absent. A manually
# dispatched CI run must fail instead of reporting an all-skipped green.
- name: Preflight (require provider API keys)
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY_EXTERNAL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_EXTERNAL }}
run: |
set -euo pipefail
missing=0
for name in OPENAI_API_KEY ANTHROPIC_API_KEY; do
if [ -z "${!name:-}" ]; then
echo "::error::${name} is empty. Configure the corresponding *_EXTERNAL repository secret."
missing=1
fi
done
exit "$missing"
- name: E2E tests (real OpenAI and Anthropic APIs)
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY_EXTERNAL }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY_EXTERNAL }}
DSH_PI_AI_OPENAI_MODEL: ${{ inputs.openai_model }}
DSH_PI_AI_ANTHROPIC_MODEL: ${{ inputs.anthropic_model }}
DSH_E2E_MAX_WORKERS: 2
run: >-
pnpm exec vitest run --config vitest.e2e.config.ts
packages/llm/llm-pi-ai/tests/provider-apis.e2e.ts